diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2012-06-25 01:51:46 +0300 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2012-06-25 01:51:46 +0300 |
commit | b8b2e3b2deeaab19715af063fc009b7c230b2336 (patch) | |
tree | c6ee1310487d59e37e3e143835b5609e78524f65 /contrib/hstore/hstore_gist.c | |
parent | 7eb8c7851458eb88def80c290a4b5bc37cc321f3 (diff) |
Replace int2/int4 in C code with int16/int32
The latter was already the dominant use, and it's preferable because
in C the convention is that intXX means XX bits. Therefore, allowing
mixed use of int2, int4, int8, int16, int32 is obviously confusing.
Remove the typedefs for int2 and int4 for now. They don't seem to be
widely used outside of the PostgreSQL source tree, and the few uses
can probably be cleaned up by the time this ships.
Diffstat (limited to 'contrib/hstore/hstore_gist.c')
-rw-r--r-- | contrib/hstore/hstore_gist.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/contrib/hstore/hstore_gist.c b/contrib/hstore/hstore_gist.c index f5c4b71eaff..90011801424 100644 --- a/contrib/hstore/hstore_gist.c +++ b/contrib/hstore/hstore_gist.c @@ -40,7 +40,7 @@ typedef char *BITVECP; typedef struct { int32 vl_len_; /* varlena header (do not touch directly!) */ - int4 flag; + int32 flag; char data[1]; } GISTTYPE; @@ -48,7 +48,7 @@ typedef struct #define ISALLTRUE(x) ( ((GISTTYPE*)x)->flag & ALLISTRUE ) -#define GTHDRSIZE (VARHDRSZ + sizeof(int4)) +#define GTHDRSIZE (VARHDRSZ + sizeof(int32)) #define CALCGTSIZE(flag) ( GTHDRSIZE+(((flag) & ALLISTRUE) ? 0 : SIGLEN) ) #define GETSIGN(x) ( (BITVECP)( (char*)x+GTHDRSIZE ) ) @@ -143,7 +143,7 @@ ghstore_compress(PG_FUNCTION_ARGS) } else if (!ISALLTRUE(DatumGetPointer(entry->key))) { - int4 i; + int32 i; GISTTYPE *res; BITVECP sign = GETSIGN(DatumGetPointer(entry->key)); @@ -192,7 +192,7 @@ ghstore_same(PG_FUNCTION_ARGS) *result = false; else { - int4 i; + int32 i; BITVECP sa = GETSIGN(a), sb = GETSIGN(b); @@ -209,10 +209,10 @@ ghstore_same(PG_FUNCTION_ARGS) PG_RETURN_POINTER(result); } -static int4 +static int32 sizebitvec(BITVECP sign) { - int4 size = 0, + int32 size = 0, i; LOOPBYTE @@ -253,10 +253,10 @@ hemdist(GISTTYPE *a, GISTTYPE *b) return hemdistsign(GETSIGN(a), GETSIGN(b)); } -static int4 +static int32 unionkey(BITVECP sbase, GISTTYPE *add) { - int4 i; + int32 i; BITVECP sadd = GETSIGN(add); if (ISALLTRUE(add)) @@ -270,12 +270,12 @@ Datum ghstore_union(PG_FUNCTION_ARGS) { GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0); - int4 len = entryvec->n; + int32 len = entryvec->n; int *size = (int *) PG_GETARG_POINTER(1); BITVEC base; - int4 i; - int4 flag = 0; + int32 i; + int32 flag = 0; GISTTYPE *result; MemSet((void *) base, 0, sizeof(BITVEC)); @@ -316,7 +316,7 @@ ghstore_penalty(PG_FUNCTION_ARGS) typedef struct { OffsetNumber pos; - int4 cost; + int32 cost; } SPLITCOST; static int @@ -339,11 +339,11 @@ ghstore_picksplit(PG_FUNCTION_ARGS) *datum_r; BITVECP union_l, union_r; - int4 size_alpha, + int32 size_alpha, size_beta; - int4 size_waste, + int32 size_waste, waste = -1; - int4 nbytes; + int32 nbytes; OffsetNumber seed_1 = 0, seed_2 = 0; OffsetNumber *left, |