1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

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
This commit is contained in:
Peter Eisentraut
2024-11-28 08:19:22 +01:00
parent 97525bc5c8
commit 7f798aca1d
158 changed files with 491 additions and 550 deletions

View File

@ -800,7 +800,7 @@ startup_cb_wrapper(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool i
state.callback_name = "startup";
state.report_location = InvalidXLogRecPtr;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -828,7 +828,7 @@ shutdown_cb_wrapper(LogicalDecodingContext *ctx)
state.callback_name = "shutdown";
state.report_location = InvalidXLogRecPtr;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -862,7 +862,7 @@ begin_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn)
state.callback_name = "begin";
state.report_location = txn->first_lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -894,7 +894,7 @@ commit_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "commit";
state.report_location = txn->final_lsn; /* beginning of commit record */
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -935,7 +935,7 @@ begin_prepare_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn)
state.callback_name = "begin_prepare";
state.report_location = txn->first_lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -980,7 +980,7 @@ prepare_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "prepare";
state.report_location = txn->final_lsn; /* beginning of prepare record */
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1025,7 +1025,7 @@ commit_prepared_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "commit_prepared";
state.report_location = txn->final_lsn; /* beginning of commit record */
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1071,7 +1071,7 @@ rollback_prepared_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "rollback_prepared";
state.report_location = txn->final_lsn; /* beginning of commit record */
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1114,7 +1114,7 @@ change_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "change";
state.report_location = change->lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1156,7 +1156,7 @@ truncate_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "truncate";
state.report_location = change->lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1195,7 +1195,7 @@ filter_prepare_cb_wrapper(LogicalDecodingContext *ctx, TransactionId xid,
state.callback_name = "filter_prepare";
state.report_location = InvalidXLogRecPtr;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1226,7 +1226,7 @@ filter_by_origin_cb_wrapper(LogicalDecodingContext *ctx, RepOriginId origin_id)
state.callback_name = "filter_by_origin";
state.report_location = InvalidXLogRecPtr;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1262,7 +1262,7 @@ message_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "message";
state.report_location = message_lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1298,7 +1298,7 @@ stream_start_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "stream_start";
state.report_location = first_lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1347,7 +1347,7 @@ stream_stop_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "stream_stop";
state.report_location = last_lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1396,7 +1396,7 @@ stream_abort_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "stream_abort";
state.report_location = abort_lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1441,7 +1441,7 @@ stream_prepare_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "stream_prepare";
state.report_location = txn->final_lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1482,7 +1482,7 @@ stream_commit_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "stream_commit";
state.report_location = txn->final_lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1523,7 +1523,7 @@ stream_change_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "stream_change";
state.report_location = change->lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1577,7 +1577,7 @@ stream_message_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "stream_message";
state.report_location = message_lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1618,7 +1618,7 @@ stream_truncate_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "stream_truncate";
state.report_location = change->lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@ -1657,7 +1657,7 @@ update_progress_txn_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
state.callback_name = "update_progress_txn";
state.report_location = lsn;
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.arg = &state;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;

View File

@ -760,7 +760,7 @@ copy_read_data(void *outbuf, int minread, int maxread)
if (avail > maxread)
avail = maxread;
memcpy(outbuf, &copybuf->data[copybuf->cursor], avail);
outbuf = (void *) ((char *) outbuf + avail);
outbuf = (char *) outbuf + avail;
copybuf->cursor += avail;
maxread -= avail;
bytesread += avail;

View File

@ -2546,7 +2546,7 @@ check_synchronized_standby_slots(char **newval, void **extra, GucSource source)
ptr += strlen(slot_name) + 1;
}
*extra = (void *) config;
*extra = config;
pfree(rawname);
list_free(elemlist);

View File

@ -1029,7 +1029,7 @@ check_synchronous_standby_names(char **newval, void **extra, GucSource source)
return false;
memcpy(pconf, syncrep_parse_result, syncrep_parse_result->config_size);
*extra = (void *) pconf;
*extra = pconf;
/*
* We need not explicitly clean up syncrep_parse_result. It, and any