diff options
Diffstat (limited to 'src/backend/utils/adt/int.c')
-rw-r--r-- | src/backend/utils/adt/int.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/utils/adt/int.c b/src/backend/utils/adt/int.c index a339abf17b6..4be39014495 100644 --- a/src/backend/utils/adt/int.c +++ b/src/backend/utils/adt/int.c @@ -40,7 +40,7 @@ #define SAMESIGN(a,b) (((a) < 0) == ((b) < 0)) -#define Int2VectorSize(n) (offsetof(int2vector, values) + (n) * sizeof(int2)) +#define Int2VectorSize(n) (offsetof(int2vector, values) + (n) * sizeof(int16)) typedef struct { @@ -109,14 +109,14 @@ int2send(PG_FUNCTION_ARGS) * If int2s is NULL then caller must fill values[] afterward */ int2vector * -buildint2vector(const int2 *int2s, int n) +buildint2vector(const int16 *int2s, int n) { int2vector *result; result = (int2vector *) palloc0(Int2VectorSize(n)); if (n > 0 && int2s) - memcpy(result->values, int2s, n * sizeof(int2)); + memcpy(result->values, int2s, n * sizeof(int16)); /* * Attach standard array header. For historical reasons, we set the index @@ -266,7 +266,7 @@ int2vectoreq(PG_FUNCTION_ARGS) if (a->dim1 != b->dim1) PG_RETURN_BOOL(false); - PG_RETURN_BOOL(memcmp(a->values, b->values, a->dim1 * sizeof(int2)) == 0); + PG_RETURN_BOOL(memcmp(a->values, b->values, a->dim1 * sizeof(int16)) == 0); } |