aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/file/buffile.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-12-30 10:02:59 +0100
committerPeter Eisentraut <peter@eisentraut.org>2022-12-30 10:12:24 +0100
commitfaf3750657a8271e2a28c054fd83e47302ac1eb4 (patch)
tree540b948f2605d2758aa4cb0e9af047198080d726 /src/backend/storage/file/buffile.c
parent5f2f99c9c62d754c19e090cb57fdd929438ea519 (diff)
downloadpostgresql-faf3750657a8271e2a28c054fd83e47302ac1eb4.tar.gz
postgresql-faf3750657a8271e2a28c054fd83e47302ac1eb4.zip
Add const to BufFileWrite
Make data buffer argument to BufFileWrite a const pointer and bubble this up to various callers and related APIs. This makes the APIs clearer and more consistent. Discussion: https://www.postgresql.org/message-id/flat/11dda853-bb5b-59ba-a746-e168b1ce4bdb%40enterprisedb.com
Diffstat (limited to 'src/backend/storage/file/buffile.c')
-rw-r--r--src/backend/storage/file/buffile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/storage/file/buffile.c b/src/backend/storage/file/buffile.c
index b07cca28d60..2202ba43f7f 100644
--- a/src/backend/storage/file/buffile.c
+++ b/src/backend/storage/file/buffile.c
@@ -622,7 +622,7 @@ BufFileRead(BufFile *file, void *ptr, size_t size)
* ereport().
*/
void
-BufFileWrite(BufFile *file, void *ptr, size_t size)
+BufFileWrite(BufFile *file, const void *ptr, size_t size)
{
size_t nthistime;
@@ -655,7 +655,7 @@ BufFileWrite(BufFile *file, void *ptr, size_t size)
file->pos += nthistime;
if (file->nbytes < file->pos)
file->nbytes = file->pos;
- ptr = (char *) ptr + nthistime;
+ ptr = (const char *) ptr + nthistime;
size -= nthistime;
}
}