Skip to content

Commit 6499008

Browse files
committed
pg_dump: Add const decorations
Add const decorations to the *info arguments of the dump* functions, to clarify that they don't modify that argument. Many other nearby functions modify their arguments, so this can help clarify these different APIs a bit. Discussion: https://www.postgresql.org/message-id/flat/012d3030-9a2c-99a1-ed2d-988978b5632f%40enterprisedb.com
1 parent 4ad5611 commit 6499008

File tree

4 files changed

+176
-176
lines changed

4 files changed

+176
-176
lines changed

src/bin/pg_dump/pg_backup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ typedef int DumpId;
248248
* Function pointer prototypes for assorted callback methods.
249249
*/
250250

251-
typedef int (*DataDumperPtr) (Archive *AH, void *userArg);
251+
typedef int (*DataDumperPtr) (Archive *AH, const void *userArg);
252252

253253
typedef void (*SetupWorkerPtrType) (Archive *AH);
254254

src/bin/pg_dump/pg_backup_archiver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ struct _tocEntry
382382
int nDeps; /* number of dependencies */
383383

384384
DataDumperPtr dataDumper; /* Routine to dump data for object */
385-
void *dataDumperArg; /* Arg for above routine */
385+
const void *dataDumperArg; /* Arg for above routine */
386386
void *formatData; /* TOC Entry data specific to file format */
387387

388388
/* working state while dumping/restoring */
@@ -421,7 +421,7 @@ typedef struct _archiveOpts
421421
const DumpId *deps;
422422
int nDeps;
423423
DataDumperPtr dumpFn;
424-
void *dumpArg;
424+
const void *dumpArg;
425425
} ArchiveOpts;
426426
#define ARCHIVE_OPTS(...) &(ArchiveOpts){__VA_ARGS__}
427427
/* Called to add a TOC entry */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy