1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +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

@@ -747,7 +747,7 @@ pg_prepared_xact(PG_FUNCTION_ARGS)
* out as a result set.
*/
status = (Working_State *) palloc(sizeof(Working_State));
funcctx->user_fctx = (void *) status;
funcctx->user_fctx = status;
status->ngxacts = GetPreparedTransactionList(&status->array);
status->currIdx = 0;
@@ -1707,8 +1707,7 @@ ProcessRecords(char *bufptr, TransactionId xid,
bufptr += MAXALIGN(sizeof(TwoPhaseRecordOnDisk));
if (callbacks[record->rmid] != NULL)
callbacks[record->rmid] (xid, record->info,
(void *) bufptr, record->len);
callbacks[record->rmid] (xid, record->info, bufptr, record->len);
bufptr += MAXALIGN(record->len);
}

View File

@@ -1913,7 +1913,7 @@ ApplyWalRecord(XLogReaderState *xlogreader, XLogRecord *record, TimeLineID *repl
/* Setup error traceback support for ereport() */
errcallback.callback = rm_redo_error_callback;
errcallback.arg = (void *) xlogreader;
errcallback.arg = xlogreader;
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
@@ -4821,7 +4821,7 @@ check_recovery_target_lsn(char **newval, void **extra, GucSource source)
myextra = (XLogRecPtr *) guc_malloc(ERROR, sizeof(XLogRecPtr));
*myextra = lsn;
*extra = (void *) myextra;
*extra = myextra;
}
return true;
}
@@ -4985,7 +4985,7 @@ check_recovery_target_timeline(char **newval, void **extra, GucSource source)
myextra = (RecoveryTargetTimeLineGoal *) guc_malloc(ERROR, sizeof(RecoveryTargetTimeLineGoal));
*myextra = rttg;
*extra = (void *) myextra;
*extra = myextra;
return true;
}
@@ -5021,7 +5021,7 @@ check_recovery_target_xid(char **newval, void **extra, GucSource source)
myextra = (TransactionId *) guc_malloc(ERROR, sizeof(TransactionId));
*myextra = xid;
*extra = (void *) myextra;
*extra = myextra;
}
return true;
}