diff --git a/libpgcommon/gserialized_gist.c b/libpgcommon/gserialized_gist.c
index 6ff3a81..d28643a 100644
|
a
|
b
|
|
| 22 | 22 | #include "gserialized_gist.h" |
| 23 | 23 | |
| 24 | 24 | |
| | 25 | /* Generate human readable form for GIDX. */ |
| | 26 | #if POSTGIS_DEBUG_LEVEL > 0 |
| | 27 | char* gidx_to_string(GIDX *a) |
| | 28 | { |
| | 29 | char *str, *rv; |
| | 30 | int i, ndims; |
| | 31 | |
| | 32 | if ( a == NULL ) |
| | 33 | return pstrdup("<NULLPTR>"); |
| | 34 | |
| | 35 | str = (char*)palloc(128); |
| | 36 | rv = str; |
| | 37 | ndims = GIDX_NDIMS(a); |
| | 38 | |
| | 39 | str += sprintf(str, "GIDX("); |
| | 40 | for ( i = 0; i < ndims; i++ ) |
| | 41 | str += sprintf(str, " %.12g", GIDX_GET_MIN(a,i)); |
| | 42 | str += sprintf(str, ","); |
| | 43 | for ( i = 0; i < ndims; i++ ) |
| | 44 | str += sprintf(str, " %.12g", GIDX_GET_MAX(a,i)); |
| | 45 | str += sprintf(str, " )"); |
| | 46 | |
| | 47 | return rv; |
| | 48 | } |
| | 49 | #endif |
| | 50 | |
| 25 | 51 | |
| 26 | 52 | /** |
| 27 | 53 | * Given a #GSERIALIZED datum, as quickly as possible (peaking into the top |
diff --git a/libpgcommon/gserialized_gist.h b/libpgcommon/gserialized_gist.h
index 2c12bd6..72b73d3 100644
|
a
|
b
|
GIDX* gidx_from_gbox(GBOX box);
|
| 58 | 58 | /* Increase the size of a GIDX */ |
| 59 | 59 | void gidx_expand(GIDX *a, float d); |
| 60 | 60 | |
| | 61 | |
| | 62 | /* Generate human readable form for GIDX. */ |
| | 63 | #if POSTGIS_DEBUG_LEVEL > 0 |
| | 64 | char* gidx_to_string(GIDX *a) ; |
| | 65 | #endif |
| | 66 | |
| | 67 | |
| 61 | 68 | /* Returns number of dimensions for this GIDX */ |
| 62 | 69 | #define GIDX_NDIMS(gidx) ((VARSIZE((gidx)) - VARHDRSZ) / (2 * sizeof(float))) |
| 63 | 70 | /* Minimum accessor. */ |
diff --git a/postgis/gserialized_gist_nd.c b/postgis/gserialized_gist_nd.c
index 6e5929b..55cebb2 100644
|
a
|
b
|
Datum gserialized_within(PG_FUNCTION_ARGS);
|
| 78 | 78 | typedef bool (*gidx_predicate)(GIDX *a, GIDX *b); |
| 79 | 79 | |
| 80 | 80 | |
| 81 | | /* Generate human readable form for GIDX. */ |
| 82 | | #if POSTGIS_DEBUG_LEVEL > 0 |
| 83 | | static char* gidx_to_string(GIDX *a) |
| 84 | | { |
| 85 | | char *str, *rv; |
| 86 | | int i, ndims; |
| 87 | | |
| 88 | | if ( a == NULL ) |
| 89 | | return pstrdup("<NULLPTR>"); |
| 90 | | |
| 91 | | str = (char*)palloc(128); |
| 92 | | rv = str; |
| 93 | | ndims = GIDX_NDIMS(a); |
| 94 | | |
| 95 | | str += sprintf(str, "GIDX("); |
| 96 | | for ( i = 0; i < ndims; i++ ) |
| 97 | | str += sprintf(str, " %.12g", GIDX_GET_MIN(a,i)); |
| 98 | | str += sprintf(str, ","); |
| 99 | | for ( i = 0; i < ndims; i++ ) |
| 100 | | str += sprintf(str, " %.12g", GIDX_GET_MAX(a,i)); |
| 101 | | str += sprintf(str, " )"); |
| 102 | | |
| 103 | | return rv; |
| 104 | | } |
| 105 | | #endif |
| 106 | | |
| 107 | 81 | /* Allocate a new copy of GIDX */ |
| 108 | 82 | static GIDX* gidx_copy(GIDX *b) |
| 109 | 83 | { |