summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLee Salzman <[email protected]>2013-01-19 16:39:34 +0200
committerLee Salzman <[email protected]>2013-01-19 16:39:34 +0200
commit8ff344897a5937b45820b42127b70e1938f97ed0 (patch)
treec15a02532d9f50b79ad2fc123f14103d295960f1
parent5ff8ccb74f8581a4b70b8725a95454bc0778344e (diff)
downloadenet-8ff344897a5937b45820b42127b70e1938f97ed0.tar.gz
enet-8ff344897a5937b45820b42127b70e1938f97ed0.zip
added userData field to ENetPacket
-rw-r--r--ChangeLog1
-rw-r--r--include/enet/enet.h1
-rw-r--r--packet.c3
3 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 338c6c9..8fb667a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* added userData field to ENetPacket
* changed how random seed is generated on Windows to avoid import warnings
* fixed case where disconnects could be generated with no preceding connect event
diff --git a/include/enet/enet.h b/include/enet/enet.h
index 55960ed..a691f5e 100644
--- a/include/enet/enet.h
+++ b/include/enet/enet.h
@@ -143,6 +143,7 @@ typedef struct _ENetPacket
enet_uint8 * data; /**< allocated data for packet */
size_t dataLength; /**< length of data */
ENetPacketFreeCallback freeCallback; /**< function to be called when the packet is no longer in use */
+ void * userData; /**< application private data, may be freely modified */
} ENetPacket;
typedef struct _ENetAcknowledgement
diff --git a/packet.c b/packet.c
index 3adb287..9a997be 100644
--- a/packet.c
+++ b/packet.c
@@ -45,6 +45,7 @@ enet_packet_create (const void * data, size_t dataLength, enet_uint32 flags)
packet -> flags = flags;
packet -> dataLength = dataLength;
packet -> freeCallback = NULL;
+ packet -> userData = NULL;
return packet;
}
@@ -115,7 +116,7 @@ reflect_crc (int val, int bits)
}
static void
-initialize_crc32 ()
+initialize_crc32 (void)
{
int byte;