diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2025-02-12 08:50:13 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2025-02-12 08:50:13 +0100 |
commit | 827b4060a8e35047c1adc9ca2ab3d8e7ad905df0 (patch) | |
tree | 1235f34ef0ea04f9ccb22dd8f9c648e0e9c3ed06 /src/backend/access/heap/heapam_xlog.c | |
parent | 506183bce73a2b22308a54876f0a56a249bc26e9 (diff) |
Remove unnecessary (char *) casts [mem]
Remove (char *) casts around memory functions such as memcmp(),
memcpy(), or memset() where the cast is useless. Since these
functions don't take char * arguments anyway, these casts are at best
complicated casts to (void *), about which see commit 7f798aca1d5.
Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Discussion: https://www.postgresql.org/message-id/flat/fd1fcedb-3492-4fc8-9e3e-74b97f2db6c7%40eisentraut.org
Diffstat (limited to 'src/backend/access/heap/heapam_xlog.c')
-rw-r--r-- | src/backend/access/heap/heapam_xlog.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/access/heap/heapam_xlog.c b/src/backend/access/heap/heapam_xlog.c index 469d11d5912..30f4c2d3c67 100644 --- a/src/backend/access/heap/heapam_xlog.c +++ b/src/backend/access/heap/heapam_xlog.c @@ -480,11 +480,11 @@ heap_xlog_insert(XLogReaderState *record) newlen = datalen - SizeOfHeapHeader; Assert(datalen > SizeOfHeapHeader && newlen <= MaxHeapTupleSize); - memcpy((char *) &xlhdr, data, SizeOfHeapHeader); + memcpy(&xlhdr, data, SizeOfHeapHeader); data += SizeOfHeapHeader; htup = &tbuf.hdr; - MemSet((char *) htup, 0, SizeofHeapTupleHeader); + MemSet(htup, 0, SizeofHeapTupleHeader); /* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */ memcpy((char *) htup + SizeofHeapTupleHeader, data, @@ -625,10 +625,10 @@ heap_xlog_multi_insert(XLogReaderState *record) newlen = xlhdr->datalen; Assert(newlen <= MaxHeapTupleSize); htup = &tbuf.hdr; - MemSet((char *) htup, 0, SizeofHeapTupleHeader); + MemSet(htup, 0, SizeofHeapTupleHeader); /* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */ memcpy((char *) htup + SizeofHeapTupleHeader, - (char *) tupdata, + tupdata, newlen); tupdata += newlen; @@ -854,14 +854,14 @@ heap_xlog_update(XLogReaderState *record, bool hot_update) recdata += sizeof(uint16); } - memcpy((char *) &xlhdr, recdata, SizeOfHeapHeader); + memcpy(&xlhdr, recdata, SizeOfHeapHeader); recdata += SizeOfHeapHeader; tuplen = recdata_end - recdata; Assert(tuplen <= MaxHeapTupleSize); htup = &tbuf.hdr; - MemSet((char *) htup, 0, SizeofHeapTupleHeader); + MemSet(htup, 0, SizeofHeapTupleHeader); /* * Reconstruct the new tuple using the prefix and/or suffix from the |