@@ -144,7 +144,7 @@ static int socket_flush_if_writable(void);
144
144
static bool socket_is_send_pending (void );
145
145
static int socket_putmessage (char msgtype , const char * s , size_t len );
146
146
static void socket_putmessage_noblock (char msgtype , const char * s , size_t len );
147
- static inline int internal_putbytes (const char * s , size_t len );
147
+ static inline int internal_putbytes (const void * b , size_t len );
148
148
static inline int internal_flush (void );
149
149
static pg_noinline int internal_flush_buffer (const char * buf , size_t * start ,
150
150
size_t * end );
@@ -1060,8 +1060,9 @@ pq_getbyte_if_available(unsigned char *c)
1060
1060
* --------------------------------
1061
1061
*/
1062
1062
int
1063
- pq_getbytes (char * s , size_t len )
1063
+ pq_getbytes (void * b , size_t len )
1064
1064
{
1065
+ char * s = b ;
1065
1066
size_t amount ;
1066
1067
1067
1068
Assert (PqCommReadingMsg );
@@ -1209,7 +1210,7 @@ pq_getmessage(StringInfo s, int maxlen)
1209
1210
resetStringInfo (s );
1210
1211
1211
1212
/* Read message length word */
1212
- if (pq_getbytes (( char * ) & len , 4 ) == EOF )
1213
+ if (pq_getbytes (& len , 4 ) == EOF )
1213
1214
{
1214
1215
ereport (COMMERROR ,
1215
1216
(errcode (ERRCODE_PROTOCOL_VIOLATION ),
@@ -1274,8 +1275,10 @@ pq_getmessage(StringInfo s, int maxlen)
1274
1275
1275
1276
1276
1277
static inline int
1277
- internal_putbytes (const char * s , size_t len )
1278
+ internal_putbytes (const void * b , size_t len )
1278
1279
{
1280
+ const char * s = b ;
1281
+
1279
1282
while (len > 0 )
1280
1283
{
1281
1284
/* If buffer is full, then flush it out */
@@ -1499,7 +1502,7 @@ socket_putmessage(char msgtype, const char *s, size_t len)
1499
1502
goto fail ;
1500
1503
1501
1504
n32 = pg_hton32 ((uint32 ) (len + 4 ));
1502
- if (internal_putbytes (( char * ) & n32 , 4 ))
1505
+ if (internal_putbytes (& n32 , 4 ))
1503
1506
goto fail ;
1504
1507
1505
1508
if (internal_putbytes (s , len ))
0 commit comments