@@ -274,7 +274,7 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir)
274274/* Send CopyOutResponse message */
275275pq_beginmessage (& buf ,'H' );
276276pq_sendbyte (& buf ,0 );/* overall format */
277- pq_sendint (& buf ,0 , 2 );/* natts */
277+ pq_sendint16 (& buf ,0 );/* natts */
278278pq_endmessage (& buf );
279279
280280if (ti -> path == NULL )
@@ -722,7 +722,7 @@ send_int8_string(StringInfoData *buf, int64 intval)
722722char is [32 ];
723723
724724sprintf (is ,INT64_FORMAT ,intval );
725- pq_sendint (buf ,strlen (is ), 4 );
725+ pq_sendint32 (buf ,strlen (is ));
726726pq_sendbytes (buf ,is ,strlen (is ));
727727}
728728
@@ -734,34 +734,34 @@ SendBackupHeader(List *tablespaces)
734734
735735/* Construct and send the directory information */
736736pq_beginmessage (& buf ,'T' );/* RowDescription */
737- pq_sendint (& buf ,3 , 2 );/* 3 fields */
737+ pq_sendint16 (& buf ,3 );/* 3 fields */
738738
739739/* First field - spcoid */
740740pq_sendstring (& buf ,"spcoid" );
741- pq_sendint (& buf ,0 , 4 );/* table oid */
742- pq_sendint (& buf ,0 , 2 );/* attnum */
743- pq_sendint (& buf ,OIDOID , 4 );/* type oid */
744- pq_sendint (& buf ,4 , 2 );/* typlen */
745- pq_sendint (& buf ,0 , 4 );/* typmod */
746- pq_sendint (& buf ,0 , 2 );/* format code */
741+ pq_sendint32 (& buf ,0 );/* table oid */
742+ pq_sendint16 (& buf ,0 );/* attnum */
743+ pq_sendint32 (& buf ,OIDOID );/* type oid */
744+ pq_sendint16 (& buf ,4 );/* typlen */
745+ pq_sendint32 (& buf ,0 );/* typmod */
746+ pq_sendint16 (& buf ,0 );/* format code */
747747
748748/* Second field - spcpath */
749749pq_sendstring (& buf ,"spclocation" );
750- pq_sendint (& buf ,0 , 4 );
751- pq_sendint (& buf ,0 , 2 );
752- pq_sendint (& buf ,TEXTOID , 4 );
753- pq_sendint (& buf ,-1 , 2 );
754- pq_sendint (& buf ,0 , 4 );
755- pq_sendint (& buf ,0 , 2 );
750+ pq_sendint32 (& buf ,0 );
751+ pq_sendint16 (& buf ,0 );
752+ pq_sendint32 (& buf ,TEXTOID );
753+ pq_sendint16 (& buf ,-1 );
754+ pq_sendint32 (& buf ,0 );
755+ pq_sendint16 (& buf ,0 );
756756
757757/* Third field - size */
758758pq_sendstring (& buf ,"size" );
759- pq_sendint (& buf ,0 , 4 );
760- pq_sendint (& buf ,0 , 2 );
761- pq_sendint (& buf ,INT8OID , 4 );
762- pq_sendint (& buf ,8 , 2 );
763- pq_sendint (& buf ,0 , 4 );
764- pq_sendint (& buf ,0 , 2 );
759+ pq_sendint32 (& buf ,0 );
760+ pq_sendint16 (& buf ,0 );
761+ pq_sendint32 (& buf ,INT8OID );
762+ pq_sendint16 (& buf ,8 );
763+ pq_sendint32 (& buf ,0 );
764+ pq_sendint16 (& buf ,0 );
765765pq_endmessage (& buf );
766766
767767foreach (lc ,tablespaces )
@@ -770,28 +770,28 @@ SendBackupHeader(List *tablespaces)
770770
771771/* Send one datarow message */
772772pq_beginmessage (& buf ,'D' );
773- pq_sendint (& buf ,3 , 2 );/* number of columns */
773+ pq_sendint16 (& buf ,3 );/* number of columns */
774774if (ti -> path == NULL )
775775{
776- pq_sendint (& buf ,-1 , 4 );/* Length = -1 ==> NULL */
777- pq_sendint (& buf ,-1 , 4 );
776+ pq_sendint32 (& buf ,-1 );/* Length = -1 ==> NULL */
777+ pq_sendint32 (& buf ,-1 );
778778}
779779else
780780{
781781Size len ;
782782
783783len = strlen (ti -> oid );
784- pq_sendint (& buf ,len , 4 );
784+ pq_sendint32 (& buf ,len );
785785pq_sendbytes (& buf ,ti -> oid ,len );
786786
787787len = strlen (ti -> path );
788- pq_sendint (& buf ,len , 4 );
788+ pq_sendint32 (& buf ,len );
789789pq_sendbytes (& buf ,ti -> path ,len );
790790}
791791if (ti -> size >=0 )
792792send_int8_string (& buf ,ti -> size /1024 );
793793else
794- pq_sendint (& buf ,-1 , 4 );/* NULL */
794+ pq_sendint32 (& buf ,-1 );/* NULL */
795795
796796pq_endmessage (& buf );
797797}
@@ -812,42 +812,42 @@ SendXlogRecPtrResult(XLogRecPtr ptr, TimeLineID tli)
812812Size len ;
813813
814814pq_beginmessage (& buf ,'T' );/* RowDescription */
815- pq_sendint (& buf , 2 ,2 );/* 2 fields */
815+ pq_sendint16 (& buf ,2 );/* 2 fields */
816816
817817/* Field headers */
818818pq_sendstring (& buf ,"recptr" );
819- pq_sendint (& buf ,0 , 4 );/* table oid */
820- pq_sendint (& buf ,0 , 2 );/* attnum */
821- pq_sendint (& buf ,TEXTOID , 4 );/* type oid */
822- pq_sendint (& buf ,-1 , 2 );
823- pq_sendint (& buf ,0 , 4 );
824- pq_sendint (& buf ,0 , 2 );
819+ pq_sendint32 (& buf ,0 );/* table oid */
820+ pq_sendint16 (& buf ,0 );/* attnum */
821+ pq_sendint32 (& buf ,TEXTOID );/* type oid */
822+ pq_sendint16 (& buf ,-1 );
823+ pq_sendint32 (& buf ,0 );
824+ pq_sendint16 (& buf ,0 );
825825
826826pq_sendstring (& buf ,"tli" );
827- pq_sendint (& buf ,0 , 4 );/* table oid */
828- pq_sendint (& buf ,0 , 2 );/* attnum */
827+ pq_sendint32 (& buf ,0 );/* table oid */
828+ pq_sendint16 (& buf ,0 );/* attnum */
829829
830830/*
831831 * int8 may seem like a surprising data type for this, but in theory int4
832832 * would not be wide enough for this, as TimeLineID is unsigned.
833833 */
834- pq_sendint (& buf ,INT8OID , 4 );/* type oid */
835- pq_sendint (& buf ,-1 , 2 );
836- pq_sendint (& buf ,0 , 4 );
837- pq_sendint (& buf ,0 , 2 );
834+ pq_sendint32 (& buf ,INT8OID );/* type oid */
835+ pq_sendint16 (& buf ,-1 );
836+ pq_sendint32 (& buf ,0 );
837+ pq_sendint16 (& buf ,0 );
838838pq_endmessage (& buf );
839839
840840/* Data row */
841841pq_beginmessage (& buf ,'D' );
842- pq_sendint (& buf , 2 ,2 );/* number of columns */
842+ pq_sendint16 (& buf ,2 );/* number of columns */
843843
844844len = snprintf (str ,sizeof (str ),
845845"%X/%X" , (uint32 ) (ptr >>32 ), (uint32 )ptr );
846- pq_sendint (& buf ,len , 4 );
846+ pq_sendint32 (& buf ,len );
847847pq_sendbytes (& buf ,str ,len );
848848
849849len = snprintf (str ,sizeof (str ),"%u" ,tli );
850- pq_sendint (& buf ,len , 4 );
850+ pq_sendint32 (& buf ,len );
851851pq_sendbytes (& buf ,str ,len );
852852
853853pq_endmessage (& buf );