Browse Source

Merge pull request #17 from OptoCloud/master

Silence [-Wunused-parameter] warnings
Vladyslav Hrytsenko 3 years ago
parent
commit
26f3778477
1 changed files with 13 additions and 0 deletions
  1. 13 0
      include/enet.h

+ 13 - 0
include/enet.h

@@ -196,6 +196,8 @@
 #define ENET_BUFFER_MAXIMUM (1 + 2 * ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS)
 #endif
 
+#define ENET_UNUSED(x) (void)x;
+
 #define ENET_MAX(x, y) ((x) > (y) ? (x) : (y))
 #define ENET_MIN(x, y) ((x) < (y) ? (x) : (y))
 
@@ -1470,6 +1472,8 @@ extern "C" {
     }
 
     static void enet_protocol_change_state(ENetHost *host, ENetPeer *peer, ENetPeerState state) {
+        ENET_UNUSED(host)
+
         if (state == ENET_PEER_STATE_CONNECTED || state == ENET_PEER_STATE_DISCONNECT_LATER) {
             enet_peer_on_connect(peer);
         } else {
@@ -1703,6 +1707,8 @@ extern "C" {
     } /* enet_protocol_remove_sent_reliable_command */
 
     static ENetPeer * enet_protocol_handle_connect(ENetHost *host, ENetProtocolHeader *header, ENetProtocol *command) {
+        ENET_UNUSED(header)
+
         enet_uint8 incomingSessionID, outgoingSessionID;
         enet_uint32 mtu, windowSize;
         ENetChannel *channel;
@@ -2148,6 +2154,9 @@ extern "C" {
     } /* enet_protocol_handle_send_unreliable_fragment */
 
     static int enet_protocol_handle_ping(ENetHost *host, ENetPeer *peer, const ENetProtocol *command) {
+        ENET_UNUSED(host)
+        ENET_UNUSED(command)
+
         if (peer->state != ENET_PEER_STATE_CONNECTED && peer->state != ENET_PEER_STATE_DISCONNECT_LATER) {
             return -1;
         }
@@ -2191,6 +2200,8 @@ extern "C" {
     } /* enet_protocol_handle_bandwidth_limit */
 
     static int enet_protocol_handle_throttle_configure(ENetHost *host, ENetPeer *peer, const ENetProtocol *command) {
+        ENET_UNUSED(host)
+
         if (peer->state != ENET_PEER_STATE_CONNECTED && peer->state != ENET_PEER_STATE_DISCONNECT_LATER) {
             return -1;
         }
@@ -3619,6 +3630,8 @@ extern "C" {
     }
 
     static void enet_peer_remove_incoming_commands(ENetList *queue, ENetListIterator startCommand, ENetListIterator endCommand) {
+        ENET_UNUSED(queue)
+
         ENetListIterator currentCommand;
 
         for (currentCommand = startCommand; currentCommand != endCommand;) {