diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-02-21 16:12:14 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-02-21 16:12:14 -0500 |
commit | 2e211211a76782b6084194a5ced94c0795460047 (patch) | |
tree | f98c4ff74b421ecb675e5192c0c1759546d22a86 /src/backend/utils/adt | |
parent | e1a11d93111ff3fba7a91f3f2ac0b0aca16909a8 (diff) | |
download | postgresql-2e211211a76782b6084194a5ced94c0795460047.tar.gz postgresql-2e211211a76782b6084194a5ced94c0795460047.zip |
Use FLEXIBLE_ARRAY_MEMBER in a number of other places.
I think we're about done with this...
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r-- | src/backend/utils/adt/numeric.c | 10 | ||||
-rw-r--r-- | src/backend/utils/adt/tsgistidx.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/tsvector_op.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/txid.c | 3 |
4 files changed, 9 insertions, 8 deletions
diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c index 1e7a176c60d..715917bab34 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -123,14 +123,14 @@ typedef int16 NumericDigit; struct NumericShort { uint16 n_header; /* Sign + display scale + weight */ - NumericDigit n_data[1]; /* Digits */ + NumericDigit n_data[FLEXIBLE_ARRAY_MEMBER]; /* Digits */ }; struct NumericLong { uint16 n_sign_dscale; /* Sign + display scale */ int16 n_weight; /* Weight of 1st digit */ - NumericDigit n_data[1]; /* Digits */ + NumericDigit n_data[FLEXIBLE_ARRAY_MEMBER]; /* Digits */ }; union NumericChoice @@ -1262,7 +1262,7 @@ numeric_floor(PG_FUNCTION_ARGS) /* * generate_series_numeric() - * - * Generate series of numeric. + * Generate series of numeric. */ Datum generate_series_numeric(PG_FUNCTION_ARGS) @@ -1297,7 +1297,7 @@ generate_series_step_numeric(PG_FUNCTION_ARGS) /* see if we were given an explicit step size */ if (PG_NARGS() == 3) { - Numeric step_num = PG_GETARG_NUMERIC(2); + Numeric step_num = PG_GETARG_NUMERIC(2); if (NUMERIC_IS_NAN(step_num)) ereport(ERROR, @@ -1356,7 +1356,7 @@ generate_series_step_numeric(PG_FUNCTION_ARGS) (fctx->step.sign == NUMERIC_NEG && cmp_var(&fctx->current, &fctx->stop) >= 0)) { - Numeric result = make_result(&fctx->current); + Numeric result = make_result(&fctx->current); /* switch to memory context appropriate for iteration calculation */ oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c index b56aa91bcb4..25132be441a 100644 --- a/src/backend/utils/adt/tsgistidx.c +++ b/src/backend/utils/adt/tsgistidx.c @@ -50,7 +50,7 @@ typedef struct { int32 vl_len_; /* varlena header (do not touch directly!) */ int32 flag; - char data[1]; + char data[FLEXIBLE_ARRAY_MEMBER]; } SignTSVector; #define ARRKEY 0x01 diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c index 3ac15f4d1f0..266a728ef6a 100644 --- a/src/backend/utils/adt/tsvector_op.c +++ b/src/backend/utils/adt/tsvector_op.c @@ -44,7 +44,7 @@ typedef struct StatEntry struct StatEntry *left; struct StatEntry *right; uint32 lenlexeme; - char lexeme[1]; + char lexeme[FLEXIBLE_ARRAY_MEMBER]; } StatEntry; #define STATENTRYHDRSZ (offsetof(StatEntry, lexeme)) diff --git a/src/backend/utils/adt/txid.c b/src/backend/utils/adt/txid.c index 8c7fe7018ab..f973ef936c5 100644 --- a/src/backend/utils/adt/txid.c +++ b/src/backend/utils/adt/txid.c @@ -64,7 +64,8 @@ typedef struct uint32 nxip; /* number of txids in xip array */ txid xmin; txid xmax; - txid xip[1]; /* in-progress txids, xmin <= xip[i] < xmax */ + /* in-progress txids, xmin <= xip[i] < xmax: */ + txid xip[FLEXIBLE_ARRAY_MEMBER]; } TxidSnapshot; #define TXID_SNAPSHOT_SIZE(nxip) \ |