1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-06 13:46:51 +03:00

Use FLEXIBLE_ARRAY_MEMBER in some more places.

Fix a batch of structs that are only visible within individual .c files.

Michael Paquier
This commit is contained in:
Tom Lane
2015-02-20 17:32:01 -05:00
parent c110eff132
commit 33a3b03d63
11 changed files with 32 additions and 37 deletions

View File

@@ -66,7 +66,7 @@ struct PMSignalData
/* per-child-process flags */
int num_child_flags; /* # of entries in PMChildFlags[] */
int next_child_flag; /* next slot to try to assign */
sig_atomic_t PMChildFlags[1]; /* VARIABLE LENGTH ARRAY */
sig_atomic_t PMChildFlags[FLEXIBLE_ARRAY_MEMBER];
};
NON_EXEC_STATIC volatile PMSignalData *PMSignalState = NULL;

View File

@@ -90,11 +90,8 @@ typedef struct ProcArrayStruct
/* oldest catalog xmin of any replication slot */
TransactionId replication_slot_catalog_xmin;
/*
* We declare pgprocnos[] as 1 entry because C wants a fixed-size array,
* but actually it is maxProcs entries long.
*/
int pgprocnos[1]; /* VARIABLE LENGTH ARRAY */
/* indexes into allPgXact[], has PROCARRAY_MAXPROCS entries */
int pgprocnos[FLEXIBLE_ARRAY_MEMBER];
} ProcArrayStruct;
static ProcArrayStruct *procArray;