Explorar el Código

Timestamp size patch

Dominik Madarász hace 6 años
padre
commit
96b71575bc
Se han modificado 5 ficheros con 18 adiciones y 17 borrados
  1. 5 5
      include/enet/enet.h
  2. 1 0
      include/enet/types.h
  3. 1 1
      package.json
  4. 5 5
      unix.c
  5. 6 6
      win32.c

+ 5 - 5
include/enet/enet.h

@@ -480,11 +480,11 @@ ENET_API ENetVersion enet_linked_version (void);
   Returns the wall-time in milliseconds.  Its initial value is unspecified
   unless otherwise set.
   */
-ENET_API enet_uint32 enet_time_get (void);
+ENET_API enet_uint64 enet_time_get (void);
 /**
   Sets the current wall-time in milliseconds.
   */
-ENET_API void enet_time_set (enet_uint32);
+ENET_API void enet_time_set (enet_uint64);
 
 /** @defgroup socket ENet socket functions
     @{
@@ -497,7 +497,7 @@ 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_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_uint64);
 ENET_API int        enet_socket_set_option (ENetSocket, ENetSocketOption, int);
 ENET_API int        enet_socket_get_option (ENetSocket, ENetSocketOption, int *);
 ENET_API int        enet_socket_shutdown (ENetSocket, ENetSocketShutdown);
@@ -556,7 +556,7 @@ ENET_API ENetPacket * enet_packet_create (const 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);
-                
+
 ENET_API ENetHost * enet_host_create (const ENetAddress *, size_t, size_t, enet_uint32, enet_uint32);
 ENET_API void       enet_host_destroy (ENetHost *);
 ENET_API ENetPeer * enet_host_connect (ENetHost *, const ENetAddress *, size_t, enet_uint32);
@@ -569,7 +569,7 @@ ENET_API int        enet_host_compress_with_range_coder (ENetHost * host);
 ENET_API void       enet_host_channel_limit (ENetHost *, size_t);
 ENET_API void       enet_host_bandwidth_limit (ENetHost *, enet_uint32, enet_uint32);
 extern   void       enet_host_bandwidth_throttle (ENetHost *);
-extern  enet_uint32 enet_host_random_seed (void);
+extern  enet_uint64 enet_host_random_seed (void);
 
 ENET_API int                 enet_peer_send (ENetPeer *, enet_uint8, ENetPacket *);
 ENET_API ENetPacket *        enet_peer_receive (ENetPeer *, enet_uint8 * channelID);

+ 1 - 0
include/enet/types.h

@@ -8,6 +8,7 @@
 typedef unsigned char enet_uint8;       /**< unsigned 8-bit type  */
 typedef unsigned short enet_uint16;     /**< unsigned 16-bit type */
 typedef unsigned int enet_uint32;      /**< unsigned 32-bit type */
+typedef uint64_t enet_uint64;
 
 #endif /* __ENET_TYPES_H__ */
 

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "enet.c",
-  "version": "1.3.13",
+  "version": "1.3.14",
   "description": "ENet reliable UDP networking library Edit",
   "main": "include/enet/enet.h",
   "directories": {

+ 5 - 5
unix.c

@@ -62,7 +62,7 @@ typedef int socklen_t;
 #define MSG_NOSIGNAL 0
 #endif
 
-static enet_uint32 timeBase = 0;
+static enet_uint64 timeBase = 0;
 
 int
 enet_initialize (void)
@@ -75,13 +75,13 @@ enet_deinitialize (void)
 {
 }
 
-enet_uint32
+enet_uint64
 enet_host_random_seed (void)
 {
     return (enet_uint32) time (NULL);
 }
 
-enet_uint32
+enet_uint64
 enet_time_get (void)
 {
     struct timeval timeVal;
@@ -92,7 +92,7 @@ enet_time_get (void)
 }
 
 void
-enet_time_set (enet_uint32 newTimeBase)
+enet_time_set (enet_uint64 newTimeBase)
 {
     struct timeval timeVal;
 
@@ -525,7 +525,7 @@ enet_socketset_select (ENetSocket maxSocket, ENetSocketSet * readSet, ENetSocket
 }
 
 int
-enet_socket_wait (ENetSocket socket, enet_uint32 * condition, enet_uint32 timeout)
+enet_socket_wait (ENetSocket socket, enet_uint32 * condition, enet_uint64 timeout)
 {
 #ifdef HAS_POLL
     struct pollfd pollSocket;

+ 6 - 6
win32.c

@@ -9,7 +9,7 @@
 #include <windows.h>
 #include <mmsystem.h>
 
-static enet_uint32 timeBase = 0;
+static enet_uint64 timeBase = 0;
 
 int
 enet_initialize (void)
@@ -47,16 +47,16 @@ enet_host_random_seed (void)
     return (enet_uint32) timeGetTime ();
 }
 
-enet_uint32
+enet_uint64
 enet_time_get (void)
 {
-    return (enet_uint32) timeGetTime () - timeBase;
+    return (enet_uint64) timeGetTime () - timeBase;
 }
 
 void
-enet_time_set (enet_uint32 newTimeBase)
+enet_time_set (enet_uint64 newTimeBase)
 {
-    timeBase = (enet_uint32) timeGetTime () - newTimeBase;
+    timeBase = (enet_uint64) timeGetTime () - newTimeBase;
 }
 
 int
@@ -401,7 +401,7 @@ enet_socketset_select (ENetSocket maxSocket, ENetSocketSet * readSet, ENetSocket
 }
 
 int
-enet_socket_wait (ENetSocket socket, enet_uint32 * condition, enet_uint32 timeout)
+enet_socket_wait (ENetSocket socket, enet_uint32 * condition, enet_uint64 timeout)
 {
     fd_set readSet, writeSet;
     struct timeval timeVal;