aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/common
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2017-10-11 21:00:46 -0700
committerAndres Freund <andres@anarazel.de>2017-10-11 21:00:46 -0700
commit31079a4a8e66e56e48bad94d380fa6224e9ffa0d (patch)
tree47f68a2def80fca4dd2a5d076bac89dfb2c33102 /src/backend/access/common
parent52328727bea4d9f95af9622e4624b9d1492df88e (diff)
downloadpostgresql-31079a4a8e66e56e48bad94d380fa6224e9ffa0d.tar.gz
postgresql-31079a4a8e66e56e48bad94d380fa6224e9ffa0d.zip
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
Diffstat (limited to 'src/backend/access/common')
-rw-r--r--src/backend/access/common/printsimple.c18
-rw-r--r--src/backend/access/common/printtup.c16
2 files changed, 17 insertions, 17 deletions
diff --git a/src/backend/access/common/printsimple.c b/src/backend/access/common/printsimple.c
index b3e9a26b032..872de7c3f44 100644
--- a/src/backend/access/common/printsimple.c
+++ b/src/backend/access/common/printsimple.c
@@ -34,19 +34,19 @@ printsimple_startup(DestReceiver *self, int operation, TupleDesc tupdesc)
int i;
pq_beginmessage(&buf, 'T'); /* RowDescription */
- pq_sendint(&buf, tupdesc->natts, 2);
+ pq_sendint16(&buf, tupdesc->natts);
for (i = 0; i < tupdesc->natts; ++i)
{
Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
pq_sendstring(&buf, NameStr(attr->attname));
- pq_sendint(&buf, 0, 4); /* table oid */
- pq_sendint(&buf, 0, 2); /* attnum */
- pq_sendint(&buf, (int) attr->atttypid, 4);
- pq_sendint(&buf, attr->attlen, 2);
- pq_sendint(&buf, attr->atttypmod, 4);
- pq_sendint(&buf, 0, 2); /* format code */
+ pq_sendint32(&buf, 0); /* table oid */
+ pq_sendint16(&buf, 0); /* attnum */
+ pq_sendint32(&buf, (int) attr->atttypid);
+ pq_sendint16(&buf, attr->attlen);
+ pq_sendint32(&buf, attr->atttypmod);
+ pq_sendint16(&buf, 0); /* format code */
}
pq_endmessage(&buf);
@@ -67,7 +67,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
/* Prepare and send message */
pq_beginmessage(&buf, 'D');
- pq_sendint(&buf, tupdesc->natts, 2);
+ pq_sendint16(&buf, tupdesc->natts);
for (i = 0; i < tupdesc->natts; ++i)
{
@@ -76,7 +76,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
if (slot->tts_isnull[i])
{
- pq_sendint(&buf, -1, 4);
+ pq_sendint32(&buf, -1);
continue;
}
diff --git a/src/backend/access/common/printtup.c b/src/backend/access/common/printtup.c
index 02cd1beef79..fc94e711b27 100644
--- a/src/backend/access/common/printtup.c
+++ b/src/backend/access/common/printtup.c
@@ -395,7 +395,7 @@ printtup(TupleTableSlot *slot, DestReceiver *self)
*/
pq_beginmessage_reuse(buf, 'D');
- pq_sendint(buf, natts, 2);
+ pq_sendint16(buf, natts);
/*
* send the attributes of this tuple
@@ -407,7 +407,7 @@ printtup(TupleTableSlot *slot, DestReceiver *self)
if (slot->tts_isnull[i])
{
- pq_sendint(buf, -1, 4);
+ pq_sendint32(buf, -1);
continue;
}
@@ -436,7 +436,7 @@ printtup(TupleTableSlot *slot, DestReceiver *self)
bytea *outputbytes;
outputbytes = SendFunctionCall(&thisState->finfo, attr);
- pq_sendint(buf, VARSIZE(outputbytes) - VARHDRSZ, 4);
+ pq_sendint32(buf, VARSIZE(outputbytes) - VARHDRSZ);
pq_sendbytes(buf, VARDATA(outputbytes),
VARSIZE(outputbytes) - VARHDRSZ);
}
@@ -494,13 +494,13 @@ printtup_20(TupleTableSlot *slot, DestReceiver *self)
k >>= 1;
if (k == 0) /* end of byte? */
{
- pq_sendint(buf, j, 1);
+ pq_sendint8(buf, j);
j = 0;
k = 1 << 7;
}
}
if (k != (1 << 7)) /* flush last partial byte */
- pq_sendint(buf, j, 1);
+ pq_sendint8(buf, j);
/*
* send the attributes of this tuple
@@ -679,13 +679,13 @@ printtup_internal_20(TupleTableSlot *slot, DestReceiver *self)
k >>= 1;
if (k == 0) /* end of byte? */
{
- pq_sendint(buf, j, 1);
+ pq_sendint8(buf, j);
j = 0;
k = 1 << 7;
}
}
if (k != (1 << 7)) /* flush last partial byte */
- pq_sendint(buf, j, 1);
+ pq_sendint8(buf, j);
/*
* send the attributes of this tuple
@@ -702,7 +702,7 @@ printtup_internal_20(TupleTableSlot *slot, DestReceiver *self)
Assert(thisState->format == 1);
outputbytes = SendFunctionCall(&thisState->finfo, attr);
- pq_sendint(buf, VARSIZE(outputbytes) - VARHDRSZ, 4);
+ pq_sendint32(buf, VARSIZE(outputbytes) - VARHDRSZ);
pq_sendbytes(buf, VARDATA(outputbytes),
VARSIZE(outputbytes) - VARHDRSZ);
}