From af006f0b99e8bf768f2a88e529ce6921a890286c Mon Sep 17 00:00:00 2001 From: Carlos Esquerdo Bernat Date: Tue, 1 Oct 2024 08:59:51 +0200 Subject: [PATCH] inline sizeof(int) --- vlib/net/tcp.c.v | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vlib/net/tcp.c.v b/vlib/net/tcp.c.v index 05037edee4a843..18743fdd2eda04 100644 --- a/vlib/net/tcp.c.v +++ b/vlib/net/tcp.c.v @@ -5,7 +5,6 @@ import strings pub const tcp_default_read_timeout = 30 * time.second pub const tcp_default_write_timeout = 30 * time.second -pub const int_size = sizeof(int) // TCPDialer is a concrete instance of the Dialer interface, // for creating tcp connections. @@ -572,7 +571,7 @@ pub fn tcp_socket_from_handle_raw(sockfd int) TcpSocket { } fn (mut s TcpSocket) set_option(level int, opt int, value int) ! { - socket_error(C.setsockopt(s.handle, level, opt, &value, int_size))! + socket_error(C.setsockopt(s.handle, level, opt, &value, sizeof(int)))! } pub fn (mut s TcpSocket) set_option_bool(opt SocketOption, value bool) ! {