summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/optimizer/path/costsize.c3
-rw-r--r--src/backend/storage/smgr/bulk_write.c2
-rw-r--r--src/bin/pg_waldump/rmgrdesc.c4
-rw-r--r--src/bin/pgbench/pgbench.c7
-rw-r--r--src/common/blkreftable.c12
-rw-r--r--src/common/file_utils.c2
-rw-r--r--src/interfaces/libpq/fe-auth-oauth-curl.c2
7 files changed, 13 insertions, 19 deletions
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index 256568d05a2..f6f77b8fe19 100644
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -2690,13 +2690,12 @@ cost_agg(Path *path, PlannerInfo *root,
double output_tuples;
Cost startup_cost;
Cost total_cost;
- AggClauseCosts dummy_aggcosts;
+ const AggClauseCosts dummy_aggcosts = {0};
/* Use all-zero per-aggregate costs if NULL is passed */
if (aggcosts == NULL)
{
Assert(aggstrategy == AGG_HASHED);
- MemSet(&dummy_aggcosts, 0, sizeof(AggClauseCosts));
aggcosts = &dummy_aggcosts;
}
diff --git a/src/backend/storage/smgr/bulk_write.c b/src/backend/storage/smgr/bulk_write.c
index ecd441f1be2..b958be15716 100644
--- a/src/backend/storage/smgr/bulk_write.c
+++ b/src/backend/storage/smgr/bulk_write.c
@@ -46,7 +46,7 @@
#define MAX_PENDING_WRITES XLR_MAX_BLOCK_ID
-static const PGIOAlignedBlock zero_buffer = {{0}}; /* worth BLCKSZ */
+static const PGIOAlignedBlock zero_buffer = {0}; /* worth BLCKSZ */
typedef struct PendingWrite
{
diff --git a/src/bin/pg_waldump/rmgrdesc.c b/src/bin/pg_waldump/rmgrdesc.c
index 6b8c17bb4c4..fac509ed134 100644
--- a/src/bin/pg_waldump/rmgrdesc.c
+++ b/src/bin/pg_waldump/rmgrdesc.c
@@ -41,8 +41,8 @@ static const RmgrDescData RmgrDescTable[RM_N_BUILTIN_IDS] = {
#define CUSTOM_NUMERIC_NAME_LEN sizeof("custom###")
-static char CustomNumericNames[RM_N_CUSTOM_IDS][CUSTOM_NUMERIC_NAME_LEN] = {{0}};
-static RmgrDescData CustomRmgrDesc[RM_N_CUSTOM_IDS] = {{0}};
+static char CustomNumericNames[RM_N_CUSTOM_IDS][CUSTOM_NUMERIC_NAME_LEN] = {0};
+static RmgrDescData CustomRmgrDesc[RM_N_CUSTOM_IDS] = {0};
static bool CustomRmgrDescInitialized = false;
/*
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index bf099aab278..c17c728ebb4 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -2279,15 +2279,10 @@ evalStandardFunc(CState *st,
{
/* evaluate all function arguments */
int nargs = 0;
+ PgBenchValue vargs[MAX_FARGS] = {0};
PgBenchExprLink *l = args;
bool has_null = false;
- /*
- * This value is double braced to workaround GCC bug 53119, which seems to
- * exist at least on gcc (Debian 4.7.2-5) 4.7.2, 32-bit.
- */
- PgBenchValue vargs[MAX_FARGS] = {{0}};
-
for (nargs = 0; nargs < MAX_FARGS && l != NULL; nargs++, l = l->next)
{
if (!evaluateExpr(st, l->expr, &vargs[nargs]))
diff --git a/src/common/blkreftable.c b/src/common/blkreftable.c
index 6d9c1dfddbc..b935baf9ad4 100644
--- a/src/common/blkreftable.c
+++ b/src/common/blkreftable.c
@@ -265,7 +265,7 @@ BlockRefTableSetLimitBlock(BlockRefTable *brtab,
BlockNumber limit_block)
{
BlockRefTableEntry *brtentry;
- BlockRefTableKey key = {{0}}; /* make sure any padding is zero */
+ BlockRefTableKey key = {0}; /* make sure any padding is zero */
bool found;
memcpy(&key.rlocator, rlocator, sizeof(RelFileLocator));
@@ -300,7 +300,7 @@ BlockRefTableMarkBlockModified(BlockRefTable *brtab,
BlockNumber blknum)
{
BlockRefTableEntry *brtentry;
- BlockRefTableKey key = {{0}}; /* make sure any padding is zero */
+ BlockRefTableKey key = {0}; /* make sure any padding is zero */
bool found;
#ifndef FRONTEND
MemoryContext oldcontext = MemoryContextSwitchTo(brtab->mcxt);
@@ -340,7 +340,7 @@ BlockRefTableEntry *
BlockRefTableGetEntry(BlockRefTable *brtab, const RelFileLocator *rlocator,
ForkNumber forknum, BlockNumber *limit_block)
{
- BlockRefTableKey key = {{0}}; /* make sure any padding is zero */
+ BlockRefTableKey key = {0}; /* make sure any padding is zero */
BlockRefTableEntry *entry;
Assert(limit_block != NULL);
@@ -521,7 +521,7 @@ WriteBlockRefTable(BlockRefTable *brtab,
for (i = 0; i < brtab->hash->members; ++i)
{
BlockRefTableSerializedEntry *sentry = &sdata[i];
- BlockRefTableKey key = {{0}}; /* make sure any padding is zero */
+ BlockRefTableKey key = {0}; /* make sure any padding is zero */
unsigned j;
/* Write the serialized entry itself. */
@@ -616,7 +616,7 @@ BlockRefTableReaderNextRelation(BlockRefTableReader *reader,
BlockNumber *limit_block)
{
BlockRefTableSerializedEntry sentry;
- BlockRefTableSerializedEntry zentry = {{0}};
+ BlockRefTableSerializedEntry zentry = {0};
/*
* Sanity check: caller must read all blocks from all chunks before moving
@@ -1291,7 +1291,7 @@ BlockRefTableWrite(BlockRefTableBuffer *buffer, void *data, int length)
static void
BlockRefTableFileTerminate(BlockRefTableBuffer *buffer)
{
- BlockRefTableSerializedEntry zentry = {{0}};
+ BlockRefTableSerializedEntry zentry = {0};
pg_crc32c crc;
/* Write a sentinel indicating that there are no more entries. */
diff --git a/src/common/file_utils.c b/src/common/file_utils.c
index 0e3cfede935..eaa2e76f43f 100644
--- a/src/common/file_utils.c
+++ b/src/common/file_utils.c
@@ -687,7 +687,7 @@ pg_pwritev_with_retry(int fd, const struct iovec *iov, int iovcnt, off_t offset)
ssize_t
pg_pwrite_zeros(int fd, size_t size, off_t offset)
{
- static const PGIOAlignedBlock zbuffer = {{0}}; /* worth BLCKSZ */
+ static const PGIOAlignedBlock zbuffer = {0}; /* worth BLCKSZ */
void *zerobuf_addr = unconstify(PGIOAlignedBlock *, &zbuffer)->data;
struct iovec iov[PG_IOV_MAX];
size_t remaining_size = size;
diff --git a/src/interfaces/libpq/fe-auth-oauth-curl.c b/src/interfaces/libpq/fe-auth-oauth-curl.c
index 3612819ae43..9e0e8a9f2be 100644
--- a/src/interfaces/libpq/fe-auth-oauth-curl.c
+++ b/src/interfaces/libpq/fe-auth-oauth-curl.c
@@ -1232,7 +1232,7 @@ register_socket(CURL *curl, curl_socket_t socket, int what, void *ctx,
#endif
#ifdef HAVE_SYS_EVENT_H
struct async_ctx *actx = ctx;
- struct kevent ev[2] = {{0}};
+ struct kevent ev[2] = {0};
struct kevent ev_out[2];
struct timespec timeout = {0};
int nev = 0;