mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user