Skip to content

Commit

Permalink
inline sizeof(int)
Browse files Browse the repository at this point in the history
  • Loading branch information
esquerbatua committed Oct 1, 2024
1 parent 72ebdaf commit af006f0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions vlib/net/tcp.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) ! {
Expand Down

0 comments on commit af006f0

Please sign in to comment.