From 31079a4a8e66e56e48bad94d380fa6224e9ffa0d Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Wed, 11 Oct 2017 21:00:46 -0700 Subject: Replace remaining uses of pq_sendint with pq_sendint{8,16,32}. pq_sendint() remains, so extension code doesn't unnecessarily break. Author: Andres Freund Discussion: https://postgr.es/m/20170914063418.sckdzgjfrsbekae4@alap3.anarazel.de --- src/backend/utils/adt/tsquery.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/backend/utils/adt/tsquery.c') diff --git a/src/backend/utils/adt/tsquery.c b/src/backend/utils/adt/tsquery.c index fdb041971e5..5cdfe4d7322 100644 --- a/src/backend/utils/adt/tsquery.c +++ b/src/backend/utils/adt/tsquery.c @@ -952,23 +952,22 @@ tsquerysend(PG_FUNCTION_ARGS) pq_begintypsend(&buf); - pq_sendint(&buf, query->size, sizeof(uint32)); + pq_sendint32(&buf, query->size); for (i = 0; i < query->size; i++) { - pq_sendint(&buf, item->type, sizeof(item->type)); + pq_sendint8(&buf, item->type); switch (item->type) { case QI_VAL: - pq_sendint(&buf, item->qoperand.weight, sizeof(uint8)); - pq_sendint(&buf, item->qoperand.prefix, sizeof(uint8)); + pq_sendint8(&buf, item->qoperand.weight); + pq_sendint8(&buf, item->qoperand.prefix); pq_sendstring(&buf, GETOPERAND(query) + item->qoperand.distance); break; case QI_OPR: - pq_sendint(&buf, item->qoperator.oper, sizeof(item->qoperator.oper)); + pq_sendint8(&buf, item->qoperator.oper); if (item->qoperator.oper == OP_PHRASE) - pq_sendint(&buf, item->qoperator.distance, - sizeof(item->qoperator.distance)); + pq_sendint16(&buf, item->qoperator.distance); break; default: elog(ERROR, "unrecognized tsquery node type: %d", item->type); -- cgit v1.2.3