summaryrefslogtreecommitdiff
path: root/contrib/btree_gist
diff options
context:
space:
mode:
authorPeter Eisentraut2012-06-24 22:51:46 +0000
committerPeter Eisentraut2012-06-24 22:51:46 +0000
commitb8b2e3b2deeaab19715af063fc009b7c230b2336 (patch)
treec6ee1310487d59e37e3e143835b5609e78524f65 /contrib/btree_gist
parent7eb8c7851458eb88def80c290a4b5bc37cc321f3 (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/btree_gist')
-rw-r--r--contrib/btree_gist/btree_int2.c10
-rw-r--r--contrib/btree_gist/btree_int4.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/contrib/btree_gist/btree_int2.c b/contrib/btree_gist/btree_int2.c
index a40912b13d6..6a438bf1f22 100644
--- a/contrib/btree_gist/btree_int2.c
+++ b/contrib/btree_gist/btree_int2.c
@@ -77,7 +77,7 @@ gbt_int2key_cmp(const void *a, const void *b)
static float8
gbt_int2_dist(const void *a, const void *b)
{
- return GET_FLOAT_DISTANCE(int2, a, b);
+ return GET_FLOAT_DISTANCE(int16, a, b);
}
@@ -100,10 +100,10 @@ Datum int2_dist(PG_FUNCTION_ARGS);
Datum
int2_dist(PG_FUNCTION_ARGS)
{
- int2 a = PG_GETARG_INT16(0);
- int2 b = PG_GETARG_INT16(1);
- int2 r;
- int2 ra;
+ int16 a = PG_GETARG_INT16(0);
+ int16 b = PG_GETARG_INT16(1);
+ int16 r;
+ int16 ra;
r = a - b;
ra = Abs(r);
diff --git a/contrib/btree_gist/btree_int4.c b/contrib/btree_gist/btree_int4.c
index 426f23f3fe0..df2164fc5eb 100644
--- a/contrib/btree_gist/btree_int4.c
+++ b/contrib/btree_gist/btree_int4.c
@@ -78,7 +78,7 @@ gbt_int4key_cmp(const void *a, const void *b)
static float8
gbt_int4_dist(const void *a, const void *b)
{
- return GET_FLOAT_DISTANCE(int4, a, b);
+ return GET_FLOAT_DISTANCE(int32, a, b);
}
@@ -101,10 +101,10 @@ Datum int4_dist(PG_FUNCTION_ARGS);
Datum
int4_dist(PG_FUNCTION_ARGS)
{
- int4 a = PG_GETARG_INT32(0);
- int4 b = PG_GETARG_INT32(1);
- int4 r;
- int4 ra;
+ int32 a = PG_GETARG_INT32(0);
+ int32 b = PG_GETARG_INT32(1);
+ int32 r;
+ int32 ra;
r = a - b;
ra = Abs(r);