From ea1f6dc4766a05626b80e466115025aa2a06b693 Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 11 Jan 2016 05:05:59 +0000 Subject: [PATCH] Fix some ENet const issues. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@5545 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/enet/include/enet/enet.h | 6 +++--- polymer/eduke32/source/enet/src/packet.c | 2 +- polymer/eduke32/source/enet/src/peer.c | 2 +- polymer/eduke32/source/enet/src/protocol.c | 16 ++++++++-------- polymer/eduke32/source/enet/src/unix.c | 2 +- polymer/eduke32/source/enet/src/win32.c | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/polymer/eduke32/source/enet/include/enet/enet.h b/polymer/eduke32/source/enet/include/enet/enet.h index b2c57529b..b2c5fc142 100644 --- a/polymer/eduke32/source/enet/include/enet/enet.h +++ b/polymer/eduke32/source/enet/include/enet/enet.h @@ -495,7 +495,7 @@ ENET_API int enet_socket_get_address (ENetSocket, ENetAddress *); ENET_API int enet_socket_listen (ENetSocket, int); ENET_API ENetSocket enet_socket_accept (ENetSocket, ENetAddress *); ENET_API int enet_socket_connect (ENetSocket, const ENetAddress *); -ENET_API int enet_socket_send (ENetSocket, const ENetAddress *, const ENetBuffer *, size_t); +ENET_API int enet_socket_send (ENetSocket, const ENetAddress *, ENetBuffer *, size_t); ENET_API int enet_socket_receive (ENetSocket, ENetAddress *, ENetBuffer *, size_t); ENET_API int enet_socket_wait (ENetSocket, enet_uint32 *, enet_uint32); ENET_API int enet_socket_set_option (ENetSocket, ENetSocketOption, int); @@ -541,7 +541,7 @@ ENET_API int enet_address_get_host (const ENetAddress * address, char * hostName /** @} */ -ENET_API ENetPacket * enet_packet_create (const void *, size_t, enet_uint32); +ENET_API ENetPacket * enet_packet_create (void *, size_t, enet_uint32); ENET_API void enet_packet_destroy (ENetPacket *); ENET_API int enet_packet_resize (ENetPacket *, size_t); ENET_API enet_uint32 enet_crc32 (const ENetBuffer *, size_t); @@ -574,7 +574,7 @@ extern int enet_peer_throttle (ENetPeer *, enet_uint32); extern void enet_peer_reset_queues (ENetPeer *); extern void enet_peer_setup_outgoing_command (ENetPeer *, ENetOutgoingCommand *); extern ENetOutgoingCommand * enet_peer_queue_outgoing_command (ENetPeer *, const ENetProtocol *, ENetPacket *, enet_uint32, enet_uint16); -extern ENetIncomingCommand * enet_peer_queue_incoming_command (ENetPeer *, const ENetProtocol *, const void *, size_t, enet_uint32, enet_uint32); +extern ENetIncomingCommand * enet_peer_queue_incoming_command (ENetPeer *, const ENetProtocol *, void *, size_t, enet_uint32, enet_uint32); extern ENetAcknowledgement * enet_peer_queue_acknowledgement (ENetPeer *, const ENetProtocol *, enet_uint16); extern void enet_peer_dispatch_incoming_unreliable_commands (ENetPeer *, ENetChannel *); extern void enet_peer_dispatch_incoming_reliable_commands (ENetPeer *, ENetChannel *); diff --git a/polymer/eduke32/source/enet/src/packet.c b/polymer/eduke32/source/enet/src/packet.c index 5fa78b28a..6e5eebf31 100644 --- a/polymer/eduke32/source/enet/src/packet.c +++ b/polymer/eduke32/source/enet/src/packet.c @@ -17,7 +17,7 @@ @returns the packet on success, NULL on failure */ ENetPacket * -enet_packet_create (const void * data, size_t dataLength, enet_uint32 flags) +enet_packet_create (void * data, size_t dataLength, enet_uint32 flags) { ENetPacket * packet = (ENetPacket *) enet_malloc (sizeof (ENetPacket)); if (packet == NULL) diff --git a/polymer/eduke32/source/enet/src/peer.c b/polymer/eduke32/source/enet/src/peer.c index cb3b18ad0..752435ff0 100644 --- a/polymer/eduke32/source/enet/src/peer.c +++ b/polymer/eduke32/source/enet/src/peer.c @@ -823,7 +823,7 @@ enet_peer_dispatch_incoming_reliable_commands (ENetPeer * peer, ENetChannel * ch } ENetIncomingCommand * -enet_peer_queue_incoming_command (ENetPeer * peer, const ENetProtocol * command, const void * data, size_t dataLength, enet_uint32 flags, enet_uint32 fragmentCount) +enet_peer_queue_incoming_command (ENetPeer * peer, const ENetProtocol * command, void * data, size_t dataLength, enet_uint32 flags, enet_uint32 fragmentCount) { static ENetIncomingCommand dummyCommand; diff --git a/polymer/eduke32/source/enet/src/protocol.c b/polymer/eduke32/source/enet/src/protocol.c index fbeb4fc74..09f8d3323 100644 --- a/polymer/eduke32/source/enet/src/protocol.c +++ b/polymer/eduke32/source/enet/src/protocol.c @@ -426,7 +426,7 @@ enet_protocol_handle_connect (ENetHost * host, ENetProtocolHeader * header, ENet } static int -enet_protocol_handle_send_reliable (ENetHost * host, ENetPeer * peer, const ENetProtocol * command, enet_uint8 ** currentData) +enet_protocol_handle_send_reliable (ENetHost * host, ENetPeer * peer, ENetProtocol * command, enet_uint8 ** currentData) { size_t dataLength; @@ -441,14 +441,14 @@ enet_protocol_handle_send_reliable (ENetHost * host, ENetPeer * peer, const ENet * currentData > & host -> receivedData [host -> receivedDataLength]) return -1; - if (enet_peer_queue_incoming_command (peer, command, (const enet_uint8 *) command + sizeof (ENetProtocolSendReliable), dataLength, ENET_PACKET_FLAG_RELIABLE, 0) == NULL) + if (enet_peer_queue_incoming_command (peer, command, (enet_uint8 *) command + sizeof (ENetProtocolSendReliable), dataLength, ENET_PACKET_FLAG_RELIABLE, 0) == NULL) return -1; return 0; } static int -enet_protocol_handle_send_unsequenced (ENetHost * host, ENetPeer * peer, const ENetProtocol * command, enet_uint8 ** currentData) +enet_protocol_handle_send_unsequenced (ENetHost * host, ENetPeer * peer, ENetProtocol * command, enet_uint8 ** currentData) { enet_uint32 unsequencedGroup, index; size_t dataLength; @@ -485,7 +485,7 @@ enet_protocol_handle_send_unsequenced (ENetHost * host, ENetPeer * peer, const E if (peer -> unsequencedWindow [index / 32] & (1 << (index % 32))) return 0; - if (enet_peer_queue_incoming_command (peer, command, (const enet_uint8 *) command + sizeof (ENetProtocolSendUnsequenced), dataLength, ENET_PACKET_FLAG_UNSEQUENCED, 0) == NULL) + if (enet_peer_queue_incoming_command (peer, command, (enet_uint8 *) command + sizeof (ENetProtocolSendUnsequenced), dataLength, ENET_PACKET_FLAG_UNSEQUENCED, 0) == NULL) return -1; peer -> unsequencedWindow [index / 32] |= 1 << (index % 32); @@ -494,7 +494,7 @@ enet_protocol_handle_send_unsequenced (ENetHost * host, ENetPeer * peer, const E } static int -enet_protocol_handle_send_unreliable (ENetHost * host, ENetPeer * peer, const ENetProtocol * command, enet_uint8 ** currentData) +enet_protocol_handle_send_unreliable (ENetHost * host, ENetPeer * peer, ENetProtocol * command, enet_uint8 ** currentData) { size_t dataLength; @@ -509,7 +509,7 @@ enet_protocol_handle_send_unreliable (ENetHost * host, ENetPeer * peer, const EN * currentData > & host -> receivedData [host -> receivedDataLength]) return -1; - if (enet_peer_queue_incoming_command (peer, command, (const enet_uint8 *) command + sizeof (ENetProtocolSendUnreliable), dataLength, 0, 0) == NULL) + if (enet_peer_queue_incoming_command (peer, command, (enet_uint8 *) command + sizeof (ENetProtocolSendUnreliable), dataLength, 0, 0) == NULL) return -1; return 0; @@ -614,7 +614,7 @@ enet_protocol_handle_send_fragment (ENetHost * host, ENetPeer * peer, const ENet fragmentLength = startCommand -> packet -> dataLength - fragmentOffset; memcpy (startCommand -> packet -> data + fragmentOffset, - (enet_uint8 *) command + sizeof (ENetProtocolSendFragment), + (enet_uint8 const *) command + sizeof (ENetProtocolSendFragment), fragmentLength); if (startCommand -> fragmentsRemaining <= 0) @@ -732,7 +732,7 @@ enet_protocol_handle_send_unreliable_fragment (ENetHost * host, ENetPeer * peer, fragmentLength = startCommand -> packet -> dataLength - fragmentOffset; memcpy (startCommand -> packet -> data + fragmentOffset, - (enet_uint8 *) command + sizeof (ENetProtocolSendFragment), + (enet_uint8 const *) command + sizeof (ENetProtocolSendFragment), fragmentLength); if (startCommand -> fragmentsRemaining <= 0) diff --git a/polymer/eduke32/source/enet/src/unix.c b/polymer/eduke32/source/enet/src/unix.c index 36943893d..771a4abd6 100644 --- a/polymer/eduke32/source/enet/src/unix.c +++ b/polymer/eduke32/source/enet/src/unix.c @@ -375,7 +375,7 @@ enet_socket_destroy (ENetSocket socket) int enet_socket_send (ENetSocket socket, const ENetAddress * address, - const ENetBuffer * buffers, + ENetBuffer * buffers, size_t bufferCount) { struct msghdr msgHdr; diff --git a/polymer/eduke32/source/enet/src/win32.c b/polymer/eduke32/source/enet/src/win32.c index 5cc167997..8843257dd 100644 --- a/polymer/eduke32/source/enet/src/win32.c +++ b/polymer/eduke32/source/enet/src/win32.c @@ -83,7 +83,7 @@ enet_address_set_host (ENetAddress * address, const char * name) int enet_address_get_host_ip (const ENetAddress * address, char * name, size_t nameLength) { - char * addr = inet_ntoa (* (struct in_addr *) & address -> host); + char * addr = inet_ntoa (* (struct in_addr const *) & address -> host); if (addr == NULL) return -1; else @@ -292,7 +292,7 @@ enet_socket_destroy (ENetSocket socket) int enet_socket_send (ENetSocket socket, const ENetAddress * address, - const ENetBuffer * buffers, + ENetBuffer * buffers, size_t bufferCount) { struct sockaddr_in sin;