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 /src/backend/access/transam/xlogfuncs.c | |
parent | c94ae9d827a360d74da6a304692d34a4dc8b6445 (diff) | |
download | postgresql-9fd45870c1436b477264c0c82eb195df52bc0919.tar.gz postgresql-9fd45870c1436b477264c0c82eb195df52bc0919.zip |
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 'src/backend/access/transam/xlogfuncs.c')
-rw-r--r-- | src/backend/access/transam/xlogfuncs.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c index 02bd919ff64..61e0f4a29ca 100644 --- a/src/backend/access/transam/xlogfuncs.c +++ b/src/backend/access/transam/xlogfuncs.c @@ -106,8 +106,8 @@ pg_backup_stop(PG_FUNCTION_ARGS) { #define PG_STOP_BACKUP_V2_COLS 3 TupleDesc tupdesc; - Datum values[PG_STOP_BACKUP_V2_COLS]; - bool nulls[PG_STOP_BACKUP_V2_COLS]; + Datum values[PG_STOP_BACKUP_V2_COLS] = {0}; + bool nulls[PG_STOP_BACKUP_V2_COLS] = {0}; bool waitforarchive = PG_GETARG_BOOL(0); XLogRecPtr stoppoint; @@ -117,9 +117,6 @@ pg_backup_stop(PG_FUNCTION_ARGS) if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) elog(ERROR, "return type must be a row type"); - MemSet(values, 0, sizeof(values)); - MemSet(nulls, 0, sizeof(nulls)); - if (status != SESSION_BACKUP_RUNNING) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), |