Skip to content

Commit

Permalink
socket: fix warns
Browse files Browse the repository at this point in the history
  • Loading branch information
zpl-zak committed Jul 14, 2023
1 parent 5b9ff1f commit 7246976
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/header/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ZPL_BEGIN_C_DECLS

typedef zpl_i32 zpl_socket;
typedef int zpl_socket;

typedef struct zpl_socket_addr {
char data[128];
Expand Down
4 changes: 2 additions & 2 deletions code/source/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ZPL_DEF zpl_socket zpl_socket_create(zpl_i32 protocol, zpl_i32 mode, char flags,
return -1;
}
# if defined(ZPL_SYSTEM_WINDOWS)
zpl_socket sock = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
zpl_socket sock = (zpl_socket)socket(result->ai_family, result->ai_socktype, result->ai_protocol);
if (sock == INVALID_SOCKET) {
freeaddrinfo(result);
return -1;
Expand Down Expand Up @@ -119,7 +119,7 @@ ZPL_DEF zpl_i32 zpl_socket_listen(zpl_socket socket, zpl_i32 backlog) {
ZPL_DEF zpl_socket zpl_socket_accept(zpl_socket socket, zpl_socket_addr *addr) {
# if defined(ZPL_SYSTEM_WINDOWS)
int len = sizeof(*addr);
zpl_socket sock = accept(socket, (struct sockaddr *)addr, &len);
zpl_socket sock = (zpl_socket)accept(socket, (struct sockaddr *)addr, &len);
if (sock == INVALID_SOCKET) {
return -1;
}
Expand Down

0 comments on commit 7246976

Please sign in to comment.