@@ -274,7 +274,7 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir)
274
274
/* Send CopyOutResponse message */
275
275
pq_beginmessage (& buf , 'H' );
276
276
pq_sendbyte (& buf , 0 ); /* overall format */
277
- pq_sendint (& buf , 0 , 2 ); /* natts */
277
+ pq_sendint16 (& buf , 0 ); /* natts */
278
278
pq_endmessage (& buf );
279
279
280
280
if (ti -> path == NULL )
@@ -722,7 +722,7 @@ send_int8_string(StringInfoData *buf, int64 intval)
722
722
char is [32 ];
723
723
724
724
sprintf (is , INT64_FORMAT , intval );
725
- pq_sendint (buf , strlen (is ), 4 );
725
+ pq_sendint32 (buf , strlen (is ));
726
726
pq_sendbytes (buf , is , strlen (is ));
727
727
}
728
728
@@ -734,34 +734,34 @@ SendBackupHeader(List *tablespaces)
734
734
735
735
/* Construct and send the directory information */
736
736
pq_beginmessage (& buf , 'T' ); /* RowDescription */
737
- pq_sendint (& buf , 3 , 2 ); /* 3 fields */
737
+ pq_sendint16 (& buf , 3 ); /* 3 fields */
738
738
739
739
/* First field - spcoid */
740
740
pq_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 */
747
747
748
748
/* Second field - spcpath */
749
749
pq_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 );
756
756
757
757
/* Third field - size */
758
758
pq_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 );
765
765
pq_endmessage (& buf );
766
766
767
767
foreach (lc , tablespaces )
@@ -770,28 +770,28 @@ SendBackupHeader(List *tablespaces)
770
770
771
771
/* Send one datarow message */
772
772
pq_beginmessage (& buf , 'D' );
773
- pq_sendint (& buf , 3 , 2 ); /* number of columns */
773
+ pq_sendint16 (& buf , 3 ); /* number of columns */
774
774
if (ti -> path == NULL )
775
775
{
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 );
778
778
}
779
779
else
780
780
{
781
781
Size len ;
782
782
783
783
len = strlen (ti -> oid );
784
- pq_sendint (& buf , len , 4 );
784
+ pq_sendint32 (& buf , len );
785
785
pq_sendbytes (& buf , ti -> oid , len );
786
786
787
787
len = strlen (ti -> path );
788
- pq_sendint (& buf , len , 4 );
788
+ pq_sendint32 (& buf , len );
789
789
pq_sendbytes (& buf , ti -> path , len );
790
790
}
791
791
if (ti -> size >= 0 )
792
792
send_int8_string (& buf , ti -> size / 1024 );
793
793
else
794
- pq_sendint (& buf , -1 , 4 ); /* NULL */
794
+ pq_sendint32 (& buf , -1 ); /* NULL */
795
795
796
796
pq_endmessage (& buf );
797
797
}
@@ -812,42 +812,42 @@ SendXlogRecPtrResult(XLogRecPtr ptr, TimeLineID tli)
812
812
Size len ;
813
813
814
814
pq_beginmessage (& buf , 'T' ); /* RowDescription */
815
- pq_sendint (& buf , 2 , 2 ); /* 2 fields */
815
+ pq_sendint16 (& buf , 2 ); /* 2 fields */
816
816
817
817
/* Field headers */
818
818
pq_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 );
825
825
826
826
pq_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 */
829
829
830
830
/*
831
831
* int8 may seem like a surprising data type for this, but in theory int4
832
832
* would not be wide enough for this, as TimeLineID is unsigned.
833
833
*/
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 );
838
838
pq_endmessage (& buf );
839
839
840
840
/* Data row */
841
841
pq_beginmessage (& buf , 'D' );
842
- pq_sendint (& buf , 2 , 2 ); /* number of columns */
842
+ pq_sendint16 (& buf , 2 ); /* number of columns */
843
843
844
844
len = snprintf (str , sizeof (str ),
845
845
"%X/%X" , (uint32 ) (ptr >> 32 ), (uint32 ) ptr );
846
- pq_sendint (& buf , len , 4 );
846
+ pq_sendint32 (& buf , len );
847
847
pq_sendbytes (& buf , str , len );
848
848
849
849
len = snprintf (str , sizeof (str ), "%u" , tli );
850
- pq_sendint (& buf , len , 4 );
850
+ pq_sendint32 (& buf , len );
851
851
pq_sendbytes (& buf , str , len );
852
852
853
853
pq_endmessage (& buf );
0 commit comments