diff options
| author | Peter Eisentraut <peter@eisentraut.org> | 2022-07-16 08:42:15 +0200 |
|---|---|---|
| committer | Peter Eisentraut <peter@eisentraut.org> | 2022-07-16 08:50:49 +0200 |
| commit | 9fd45870c1436b477264c0c82eb195df52bc0919 (patch) | |
| tree | 10a09724c0bcffa8f58f262e50c3260cde484446 /contrib/amcheck/verify_heapam.c | |
| parent | c94ae9d827a360d74da6a304692d34a4dc8b6445 (diff) | |
Replace many MemSet calls with struct initialization
This replaces all MemSet() calls with struct initialization where that
is easily and obviously possible. (For example, some cases have to
worry about padding bits, so I left those.)
(The same could be done with appropriate memset() calls, but this
patch is part of an effort to phase out MemSet(), so it doesn't touch
memset() calls.)
Reviewed-by: Ranier Vilela <ranier.vf@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://www.postgresql.org/message-id/9847b13c-b785-f4e2-75c3-12ec77a3b05c@enterprisedb.com
Diffstat (limited to 'contrib/amcheck/verify_heapam.c')
| -rw-r--r-- | contrib/amcheck/verify_heapam.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/contrib/amcheck/verify_heapam.c b/contrib/amcheck/verify_heapam.c index e488f5e234b..d33f33f1703 100644 --- a/contrib/amcheck/verify_heapam.c +++ b/contrib/amcheck/verify_heapam.c @@ -554,12 +554,10 @@ report_corruption_internal(Tuplestorestate *tupstore, TupleDesc tupdesc, BlockNumber blkno, OffsetNumber offnum, AttrNumber attnum, char *msg) { - Datum values[HEAPCHECK_RELATION_COLS]; - bool nulls[HEAPCHECK_RELATION_COLS]; + Datum values[HEAPCHECK_RELATION_COLS] = {0}; + bool nulls[HEAPCHECK_RELATION_COLS] = {0}; HeapTuple tuple; - MemSet(values, 0, sizeof(values)); - MemSet(nulls, 0, sizeof(nulls)); values[0] = Int64GetDatum(blkno); values[1] = Int32GetDatum(offnum); values[2] = Int32GetDatum(attnum); |
