Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+1-1
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

+2-2
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)