diff options
Diffstat (limited to 'contrib/cube/cube.c')
-rw-r--r-- | contrib/cube/cube.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c index 7495ea8ce4b..a4472ee20e7 100644 --- a/contrib/cube/cube.c +++ b/contrib/cube/cube.c @@ -1,5 +1,5 @@ /****************************************************************************** - $PostgreSQL: pgsql/contrib/cube/cube.c,v 1.27 2006/07/25 23:23:44 momjian Exp $ + $PostgreSQL: pgsql/contrib/cube/cube.c,v 1.28 2006/07/27 21:55:09 tgl Exp $ This file contains routines that can be bound to a Postgres backend and called by the backend in the process of processing queries. The calling @@ -14,12 +14,19 @@ #include "access/gist.h" #include "access/skey.h" #include "lib/stringinfo.h" +#include "utils/array.h" #include "utils/builtins.h" #include "cubedata.h" PG_MODULE_MAGIC; +/* + * Taken from the intarray contrib header + */ +#define ARRPTR(x) ( (double *) ARR_DATA_PTR(x) ) +#define ARRNELEMS(x) ArrayGetNItems( ARR_NDIM(x), ARR_DIMS(x)) + extern int cube_yyparse(); extern void cube_yyerror(const char *message); extern void cube_scanner_init(const char *str); @@ -179,15 +186,6 @@ cube(PG_FUNCTION_ARGS) } -#include "utils/array.h" - -/* -** Taken from the intarray contrib header -*/ -#define ARRPTR(x) ( (double *) ARR_DATA_PTR(x) ) -#define ARRNELEMS(x) ArrayGetNItems( ARR_NDIM(x), ARR_DIMS(x)) - - /* ** Allows the construction of a cube from 2 float[]'s */ @@ -1000,7 +998,7 @@ cube_cmp(PG_FUNCTION_ARGS) a = (NDBOX *) PG_GETARG_POINTER(0); b = (NDBOX *) PG_GETARG_POINTER(1); - PG_RETURN_INT16(cube_cmp_v0(a, b)); + PG_RETURN_INT32(cube_cmp_v0(a, b)); } @@ -1285,7 +1283,7 @@ cube_dim(PG_FUNCTION_ARGS) c = (NDBOX *) PG_GETARG_POINTER(0); - PG_RETURN_INT16 (c->dim); + PG_RETURN_INT32(c->dim); } /* Return a specific normalized LL coordinate */ |