Skip to content

Commit

Permalink
Explicitly convert the socket type to an integer
Browse files Browse the repository at this point in the history
The incoming type is an enum, so explicitly convert it to
before comparing against integers.
  • Loading branch information
kcgen committed Jul 28, 2022
1 parent f29dab0 commit 42df534
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/enet.h
Original file line number Diff line number Diff line change
Expand Up @@ -5447,7 +5447,7 @@ extern "C" {
}

ENetSocket enet_socket_create(ENetSocketType type) {
return socket(PF_INET6, type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0);
return socket(PF_INET6, (int)type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0);
}

int enet_socket_set_option(ENetSocket socket, ENetSocketOption option, int value) {
Expand Down

0 comments on commit 42df534

Please sign in to comment.