Skip to content

Commit

Permalink
make ENET_SOCKET_BIO const to avoid concurrency warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mman committed May 13, 2024
1 parent d619c48 commit 9739cbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions host.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@{
*/

ENetHostBIO ENET_SOCKET_BIO = {
const ENetHostBIO ENET_SOCKET_BIO = {
.enet_socket_create = &enet_socket_create,
.enet_socket_bind = &enet_socket_bind,
.enet_socket_send = &enet_socket_send,
Expand All @@ -23,7 +23,7 @@ ENetHostBIO ENET_SOCKET_BIO = {
};

void
enet_host_set_bio (ENetHost * host, ENetHostBIO bio)
enet_host_set_bio (ENetHost * host, const ENetHostBIO bio)
{
host -> bio = bio;
}
Expand Down
4 changes: 2 additions & 2 deletions include/enet/enet.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ typedef struct _ENetHistBIO

/** Default BSD socket based implementation of input/output routines for socket setup and sending/receiving data.
*/
extern ENetHostBIO ENET_SOCKET_BIO;
extern const ENetHostBIO ENET_SOCKET_BIO;

/** An ENet host for communicating with peers.
*
Expand Down Expand Up @@ -612,7 +612,7 @@ ENET_API void enet_host_bandwidth_limit (ENetHost *, enet_uint32, enet_uin
extern void enet_host_bandwidth_throttle (ENetHost *);
extern enet_uint32 enet_host_random_seed (void);
extern enet_uint32 enet_host_random (ENetHost *);
ENET_API void enet_host_set_bio (ENetHost *, ENetHostBIO);
ENET_API void enet_host_set_bio (ENetHost *, const ENetHostBIO);

ENET_API int enet_peer_send (ENetPeer *, enet_uint8, ENetPacket *);
ENET_API ENetPacket * enet_peer_receive (ENetPeer *, enet_uint8 * channelID);
Expand Down

0 comments on commit 9739cbe

Please sign in to comment.