summaryrefslogtreecommitdiff
path: root/contrib/intarray
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/intarray')
-rw-r--r--contrib/intarray/_int_bool.c4
-rw-r--r--contrib/intarray/_int_tool.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/contrib/intarray/_int_bool.c b/contrib/intarray/_int_bool.c
index 23ee8f1dada..b6a5d1b1e89 100644
--- a/contrib/intarray/_int_bool.c
+++ b/contrib/intarray/_int_bool.c
@@ -766,7 +766,7 @@ querytree(PG_FUNCTION_ARGS)
if (len == 0)
{
res = (text *) palloc(1 + VARHDRSZ);
- VARATT_SIZEP(res) = 1 + VARHDRSZ;
+ SET_VARSIZE(res, 1 + VARHDRSZ);
*((char *) VARDATA(res)) = 'T';
}
else
@@ -778,7 +778,7 @@ querytree(PG_FUNCTION_ARGS)
infix(&nrm, true);
res = (text *) palloc(nrm.cur - nrm.buf + VARHDRSZ);
- VARATT_SIZEP(res) = nrm.cur - nrm.buf + VARHDRSZ;
+ SET_VARSIZE(res, nrm.cur - nrm.buf + VARHDRSZ);
memcpy(VARDATA(res), nrm.buf, nrm.cur - nrm.buf);
}
pfree(q);
diff --git a/contrib/intarray/_int_tool.c b/contrib/intarray/_int_tool.c
index 2ad0ef0cc04..fead4ff30dc 100644
--- a/contrib/intarray/_int_tool.c
+++ b/contrib/intarray/_int_tool.c
@@ -226,7 +226,7 @@ new_intArrayType(int num)
r = (ArrayType *) palloc0(nbytes);
- ARR_SIZE(r) = nbytes;
+ SET_VARSIZE(r, nbytes);
ARR_NDIM(r) = NDIM;
r->dataoffset = 0; /* marker for no null bitmap */
ARR_ELEMTYPE(r) = INT4OID;
@@ -246,7 +246,7 @@ resize_intArrayType(ArrayType *a, int num)
a = (ArrayType *) repalloc(a, nbytes);
- a->size = nbytes;
+ SET_VARSIZE(a, nbytes);
*((int *) ARR_DIMS(a)) = num;
return a;
}