Fix some ENet const issues. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@5545 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2016-01-11 05:05:59 +00:00
parent cf5ff0fcdc
commit ea1f6dc476
6 changed files with 16 additions and 16 deletions

View file

@ -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 *);

View file

@ -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)

View file

@ -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;

View file

@ -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)

View file

@ -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;

View file

@ -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;