mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 19:20:46 +00:00
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:
parent
cf5ff0fcdc
commit
ea1f6dc476
6 changed files with 16 additions and 16 deletions
|
@ -495,7 +495,7 @@ ENET_API int enet_socket_get_address (ENetSocket, ENetAddress *);
|
||||||
ENET_API int enet_socket_listen (ENetSocket, int);
|
ENET_API int enet_socket_listen (ENetSocket, int);
|
||||||
ENET_API ENetSocket enet_socket_accept (ENetSocket, ENetAddress *);
|
ENET_API ENetSocket enet_socket_accept (ENetSocket, ENetAddress *);
|
||||||
ENET_API int enet_socket_connect (ENetSocket, const 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_receive (ENetSocket, ENetAddress *, ENetBuffer *, size_t);
|
||||||
ENET_API int enet_socket_wait (ENetSocket, enet_uint32 *, enet_uint32);
|
ENET_API int enet_socket_wait (ENetSocket, enet_uint32 *, enet_uint32);
|
||||||
ENET_API int enet_socket_set_option (ENetSocket, ENetSocketOption, int);
|
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 void enet_packet_destroy (ENetPacket *);
|
||||||
ENET_API int enet_packet_resize (ENetPacket *, size_t);
|
ENET_API int enet_packet_resize (ENetPacket *, size_t);
|
||||||
ENET_API enet_uint32 enet_crc32 (const ENetBuffer *, 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_reset_queues (ENetPeer *);
|
||||||
extern void enet_peer_setup_outgoing_command (ENetPeer *, ENetOutgoingCommand *);
|
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 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 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_unreliable_commands (ENetPeer *, ENetChannel *);
|
||||||
extern void enet_peer_dispatch_incoming_reliable_commands (ENetPeer *, ENetChannel *);
|
extern void enet_peer_dispatch_incoming_reliable_commands (ENetPeer *, ENetChannel *);
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
@returns the packet on success, NULL on failure
|
@returns the packet on success, NULL on failure
|
||||||
*/
|
*/
|
||||||
ENetPacket *
|
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));
|
ENetPacket * packet = (ENetPacket *) enet_malloc (sizeof (ENetPacket));
|
||||||
if (packet == NULL)
|
if (packet == NULL)
|
||||||
|
|
|
@ -823,7 +823,7 @@ enet_peer_dispatch_incoming_reliable_commands (ENetPeer * peer, ENetChannel * ch
|
||||||
}
|
}
|
||||||
|
|
||||||
ENetIncomingCommand *
|
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;
|
static ENetIncomingCommand dummyCommand;
|
||||||
|
|
||||||
|
|
|
@ -426,7 +426,7 @@ enet_protocol_handle_connect (ENetHost * host, ENetProtocolHeader * header, ENet
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
size_t dataLength;
|
||||||
|
|
||||||
|
@ -441,14 +441,14 @@ enet_protocol_handle_send_reliable (ENetHost * host, ENetPeer * peer, const ENet
|
||||||
* currentData > & host -> receivedData [host -> receivedDataLength])
|
* currentData > & host -> receivedData [host -> receivedDataLength])
|
||||||
return -1;
|
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 -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
enet_uint32 unsequencedGroup, index;
|
||||||
size_t dataLength;
|
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)))
|
if (peer -> unsequencedWindow [index / 32] & (1 << (index % 32)))
|
||||||
return 0;
|
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;
|
return -1;
|
||||||
|
|
||||||
peer -> unsequencedWindow [index / 32] |= 1 << (index % 32);
|
peer -> unsequencedWindow [index / 32] |= 1 << (index % 32);
|
||||||
|
@ -494,7 +494,7 @@ enet_protocol_handle_send_unsequenced (ENetHost * host, ENetPeer * peer, const E
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
size_t dataLength;
|
||||||
|
|
||||||
|
@ -509,7 +509,7 @@ enet_protocol_handle_send_unreliable (ENetHost * host, ENetPeer * peer, const EN
|
||||||
* currentData > & host -> receivedData [host -> receivedDataLength])
|
* currentData > & host -> receivedData [host -> receivedDataLength])
|
||||||
return -1;
|
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 -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -614,7 +614,7 @@ enet_protocol_handle_send_fragment (ENetHost * host, ENetPeer * peer, const ENet
|
||||||
fragmentLength = startCommand -> packet -> dataLength - fragmentOffset;
|
fragmentLength = startCommand -> packet -> dataLength - fragmentOffset;
|
||||||
|
|
||||||
memcpy (startCommand -> packet -> data + fragmentOffset,
|
memcpy (startCommand -> packet -> data + fragmentOffset,
|
||||||
(enet_uint8 *) command + sizeof (ENetProtocolSendFragment),
|
(enet_uint8 const *) command + sizeof (ENetProtocolSendFragment),
|
||||||
fragmentLength);
|
fragmentLength);
|
||||||
|
|
||||||
if (startCommand -> fragmentsRemaining <= 0)
|
if (startCommand -> fragmentsRemaining <= 0)
|
||||||
|
@ -732,7 +732,7 @@ enet_protocol_handle_send_unreliable_fragment (ENetHost * host, ENetPeer * peer,
|
||||||
fragmentLength = startCommand -> packet -> dataLength - fragmentOffset;
|
fragmentLength = startCommand -> packet -> dataLength - fragmentOffset;
|
||||||
|
|
||||||
memcpy (startCommand -> packet -> data + fragmentOffset,
|
memcpy (startCommand -> packet -> data + fragmentOffset,
|
||||||
(enet_uint8 *) command + sizeof (ENetProtocolSendFragment),
|
(enet_uint8 const *) command + sizeof (ENetProtocolSendFragment),
|
||||||
fragmentLength);
|
fragmentLength);
|
||||||
|
|
||||||
if (startCommand -> fragmentsRemaining <= 0)
|
if (startCommand -> fragmentsRemaining <= 0)
|
||||||
|
|
|
@ -375,7 +375,7 @@ enet_socket_destroy (ENetSocket socket)
|
||||||
int
|
int
|
||||||
enet_socket_send (ENetSocket socket,
|
enet_socket_send (ENetSocket socket,
|
||||||
const ENetAddress * address,
|
const ENetAddress * address,
|
||||||
const ENetBuffer * buffers,
|
ENetBuffer * buffers,
|
||||||
size_t bufferCount)
|
size_t bufferCount)
|
||||||
{
|
{
|
||||||
struct msghdr msgHdr;
|
struct msghdr msgHdr;
|
||||||
|
|
|
@ -83,7 +83,7 @@ enet_address_set_host (ENetAddress * address, const char * name)
|
||||||
int
|
int
|
||||||
enet_address_get_host_ip (const ENetAddress * address, char * name, size_t nameLength)
|
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)
|
if (addr == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
else
|
else
|
||||||
|
@ -292,7 +292,7 @@ enet_socket_destroy (ENetSocket socket)
|
||||||
int
|
int
|
||||||
enet_socket_send (ENetSocket socket,
|
enet_socket_send (ENetSocket socket,
|
||||||
const ENetAddress * address,
|
const ENetAddress * address,
|
||||||
const ENetBuffer * buffers,
|
ENetBuffer * buffers,
|
||||||
size_t bufferCount)
|
size_t bufferCount)
|
||||||
{
|
{
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
|
|
Loading…
Reference in a new issue