From dececc7ac2eb7a1639938e39541560c711aa4de9 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Tue, 3 Oct 2017 00:44:57 -0700
Subject: [PATCH 6/6] Replace remaining printtup uses of pq_sendint with
 pq_sendintXX.

It'd probably be a good idea to convert all remaining uses in the
tree, but these are fairly commonly used and in one file, so ...
---
 src/backend/access/common/printtup.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/backend/access/common/printtup.c b/src/backend/access/common/printtup.c
index 62a3fc3d6d..5197682e70 100644
--- a/src/backend/access/common/printtup.c
+++ b/src/backend/access/common/printtup.c
@@ -407,7 +407,7 @@ printtup(TupleTableSlot *slot, DestReceiver *self)
 	 */
 	pq_beginmessage_pre(buf, 'D');
 
-	pq_sendint(buf, natts, 2);
+	pq_sendint16(buf, natts);
 
 	/*
 	 * send the attributes of this tuple
@@ -419,7 +419,7 @@ printtup(TupleTableSlot *slot, DestReceiver *self)
 
 		if (slot->tts_isnull[i])
 		{
-			pq_sendint(buf, -1, 4);
+			pq_sendint32(buf, -1);
 			continue;
 		}
 
@@ -448,7 +448,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);
 		}
@@ -506,13 +506,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
@@ -691,13 +691,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
@@ -714,7 +714,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);
 	}
-- 
2.14.1.536.g6867272d5b.dirty

