diff options
| author | Peter Eisentraut <peter@eisentraut.org> | 2024-11-28 08:19:22 +0100 |
|---|---|---|
| committer | Peter Eisentraut <peter@eisentraut.org> | 2024-11-28 08:27:20 +0100 |
| commit | 7f798aca1d5df290aafad41180baea0ae311b4ee (patch) | |
| tree | b4c8132ec85c21f6c72308b5857defd70958de69 /src/bin | |
| parent | 97525bc5c8ffb31475d23955d08e9ec9c1408f33 (diff) | |
Remove useless casts to (void *)
Many of them just seem to have been copied around for no real reason.
Their presence causes (small) risks of hiding actual type mismatches
or silently discarding qualifiers
Discussion: https://www.postgresql.org/message-id/flat/461ea37c-8b58-43b4-9736-52884e862820@eisentraut.org
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/pg_dump/pg_backup_archiver.c | 4 | ||||
| -rw-r--r-- | src/bin/pg_dump/pg_backup_custom.c | 6 | ||||
| -rw-r--r-- | src/bin/pg_dump/pg_backup_directory.c | 6 | ||||
| -rw-r--r-- | src/bin/pg_dump/pg_backup_tar.c | 8 | ||||
| -rw-r--r-- | src/bin/psql/mainloop.c | 2 | ||||
| -rw-r--r-- | src/bin/psql/startup.c | 2 |
6 files changed, 14 insertions, 14 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index 33182d5b445..59e7941a0c3 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -1466,7 +1466,7 @@ StartRestoreLO(ArchiveHandle *AH, Oid oid, bool drop) { /* First time through (in this process) so allocate the buffer */ AH->lo_buf_size = LOBBUFSIZE; - AH->lo_buf = (void *) pg_malloc(LOBBUFSIZE); + AH->lo_buf = pg_malloc(LOBBUFSIZE); } AH->lo_buf_used = 0; @@ -2182,7 +2182,7 @@ ReadStr(ArchiveHandle *AH) else { buf = (char *) pg_malloc(l + 1); - AH->ReadBufPtr(AH, (void *) buf, l); + AH->ReadBufPtr(AH, buf, l); buf[l] = '\0'; } diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c index ecaad7321a3..e44b887eb29 100644 --- a/src/bin/pg_dump/pg_backup_custom.c +++ b/src/bin/pg_dump/pg_backup_custom.c @@ -137,7 +137,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH) /* Set up a private area. */ ctx = (lclContext *) pg_malloc0(sizeof(lclContext)); - AH->formatData = (void *) ctx; + AH->formatData = ctx; /* * Now open the file @@ -205,7 +205,7 @@ _ArchiveEntry(ArchiveHandle *AH, TocEntry *te) else ctx->dataState = K_OFFSET_NO_DATA; - te->formatData = (void *) ctx; + te->formatData = ctx; } /* @@ -241,7 +241,7 @@ _ReadExtraToc(ArchiveHandle *AH, TocEntry *te) if (ctx == NULL) { ctx = (lclTocEntry *) pg_malloc0(sizeof(lclTocEntry)); - te->formatData = (void *) ctx; + te->formatData = ctx; } ctx->dataState = ReadOffset(AH, &(ctx->dataPos)); diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c index 7be8d5487d4..cb82f8734ed 100644 --- a/src/bin/pg_dump/pg_backup_directory.c +++ b/src/bin/pg_dump/pg_backup_directory.c @@ -140,7 +140,7 @@ InitArchiveFmt_Directory(ArchiveHandle *AH) /* Set up our private context */ ctx = (lclContext *) pg_malloc0(sizeof(lclContext)); - AH->formatData = (void *) ctx; + AH->formatData = ctx; ctx->dataFH = NULL; ctx->LOsTocFH = NULL; @@ -246,7 +246,7 @@ _ArchiveEntry(ArchiveHandle *AH, TocEntry *te) else tctx->filename = NULL; - te->formatData = (void *) tctx; + te->formatData = tctx; } /* @@ -285,7 +285,7 @@ _ReadExtraToc(ArchiveHandle *AH, TocEntry *te) if (tctx == NULL) { tctx = (lclTocEntry *) pg_malloc0(sizeof(lclTocEntry)); - te->formatData = (void *) tctx; + te->formatData = tctx; } tctx->filename = ReadStr(AH); diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 41ee52b1d69..b5ba3b46dd9 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -152,7 +152,7 @@ InitArchiveFmt_Tar(ArchiveHandle *AH) * Set up some special context used in compressing data. */ ctx = pg_malloc0_object(lclContext); - AH->formatData = (void *) ctx; + AH->formatData = ctx; ctx->filePos = 0; ctx->isSpecialScript = 0; @@ -219,7 +219,7 @@ InitArchiveFmt_Tar(ArchiveHandle *AH) ctx->hasSeek = checkSeek(ctx->tarFH); - ctx->FH = (void *) tarOpen(AH, "toc.dat", 'r'); + ctx->FH = tarOpen(AH, "toc.dat", 'r'); ReadHead(AH); ReadToc(AH); tarClose(AH, ctx->FH); /* Nothing else in the file... */ @@ -247,7 +247,7 @@ _ArchiveEntry(ArchiveHandle *AH, TocEntry *te) ctx->filename = NULL; ctx->TH = NULL; } - te->formatData = (void *) ctx; + te->formatData = ctx; } static void @@ -269,7 +269,7 @@ _ReadExtraToc(ArchiveHandle *AH, TocEntry *te) if (ctx == NULL) { ctx = pg_malloc0_object(lclTocEntry); - te->formatData = (void *) ctx; + te->formatData = ctx; } ctx->filename = ReadStr(AH); diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c index c24e38d988c..4cf5603353d 100644 --- a/src/bin/psql/mainloop.c +++ b/src/bin/psql/mainloop.c @@ -69,7 +69,7 @@ MainLoop(FILE *source) /* Create working state */ scan_state = psql_scan_create(&psqlscan_callbacks); cond_stack = conditional_stack_create(); - psql_scan_set_passthrough(scan_state, (void *) cond_stack); + psql_scan_set_passthrough(scan_state, cond_stack); query_buf = createPQExpBuffer(); previous_buf = createPQExpBuffer(); diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index 036caaec2ff..db30ddc94da 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -399,7 +399,7 @@ main(int argc, char *argv[]) cell->val, strlen(cell->val), pset.encoding, standard_strings()); cond_stack = conditional_stack_create(); - psql_scan_set_passthrough(scan_state, (void *) cond_stack); + psql_scan_set_passthrough(scan_state, cond_stack); successResult = HandleSlashCmds(scan_state, cond_stack, |
