@@ -230,7 +230,7 @@ static int _modbus_tcp_set_ipv4_options(int s)
230
230
/* Set the TCP no delay flag */
231
231
/* SOL_TCP = IPPROTO_TCP */
232
232
option = 1 ;
233
- rc = setsockopt (s , IPPROTO_TCP , TCP_NODELAY , ( const void * ) & option , sizeof (int ));
233
+ rc = setsockopt (s , IPPROTO_TCP , TCP_NODELAY , & option , sizeof (int ));
234
234
if (rc == -1 ) {
235
235
return -1 ;
236
236
}
@@ -258,7 +258,7 @@ static int _modbus_tcp_set_ipv4_options(int s)
258
258
**/
259
259
/* Set the IP low delay option */
260
260
option = IPTOS_LOWDELAY ;
261
- rc = setsockopt (s , IPPROTO_IP , IP_TOS , ( const void * ) & option , sizeof (int ));
261
+ rc = setsockopt (s , IPPROTO_IP , IP_TOS , & option , sizeof (int ));
262
262
if (rc == -1 ) {
263
263
return -1 ;
264
264
}
@@ -547,8 +547,7 @@ int modbus_tcp_listen(modbus_t *ctx, int nb_connection)
547
547
}
548
548
549
549
enable = 1 ;
550
- if (setsockopt (new_s , SOL_SOCKET , SO_REUSEADDR , (char * ) & enable , sizeof (enable )) ==
551
- -1 ) {
550
+ if (setsockopt (new_s , SOL_SOCKET , SO_REUSEADDR , & enable , sizeof (enable )) == -1 ) {
552
551
close (new_s );
553
552
return -1 ;
554
553
}
@@ -665,8 +664,7 @@ int modbus_tcp_pi_listen(modbus_t *ctx, int nb_connection)
665
664
continue ;
666
665
} else {
667
666
int enable = 1 ;
668
- rc =
669
- setsockopt (s , SOL_SOCKET , SO_REUSEADDR , (void * ) & enable , sizeof (enable ));
667
+ rc = setsockopt (s , SOL_SOCKET , SO_REUSEADDR , & enable , sizeof (enable ));
670
668
if (rc != 0 ) {
671
669
close (s );
672
670
if (ctx -> debug ) {
0 commit comments