Skip to content

Commit 2bdba5e

Browse files
committed
net: fix declarations of C.htonl/C.htons/C.ntohl/C.ntohs in aasocket.c.v
1 parent 149517c commit 2bdba5e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

vlib/net/aasocket.c.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ fn C.socket(domain AddrFamily, typ SocketType, protocol int) int
3333
// fn C.setsockopt(sockfd int, level int, optname int, optval voidptr, optlen C.socklen_t) int
3434
fn C.setsockopt(sockfd int, level int, optname int, optval voidptr, optlen u32) int
3535

36-
fn C.htonl(hostlong u32) int
36+
fn C.htonl(host u32) u32
37+
fn C.htons(host u16) u16
3738

38-
fn C.htons(netshort u16) int
39+
fn C.ntohl(net u32) u32
40+
fn C.ntohs(net u16) u16
3941

4042
// fn C.bind(sockfd int, addr &C.sockaddr, addrlen C.socklen_t) int
4143
// use voidptr for arg 2 becasue sockaddr is a generic descriptor for any kind of socket operation,
@@ -68,8 +70,6 @@ fn C.recvfrom(sockfd int, buf voidptr, len usize, flags int, src_addr &Addr, add
6870

6971
fn C.shutdown(socket int, how int) int
7072

71-
fn C.ntohs(netshort u16) int
72-
7373
// fn C.getpeername(sockfd int, addr &C.sockaddr, addlen &C.socklen_t) int
7474
fn C.getpeername(sockfd int, addr &Addr, addlen &u32) int
7575

vlib/net/unix/aasocket.c.v

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ struct C.sockaddr_storage {
7474

7575
// fn C.shutdown() int
7676

77-
// fn C.ntohs() int
78-
7977
// fn C.getpeername() int
8078

8179
// fn C.inet_ntop(af int, src voidptr, dst charptr, dst_size int) charptr

0 commit comments

Comments
 (0)