ANSI and 64-bit related cleanup - kqueue socket engine
authorMatthew Mondor <mmondor@pulsar-zone.net>
Sat, 27 Aug 2016 16:31:25 +0000 (16:31 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Sat, 27 Aug 2016 16:31:25 +0000 (16:31 +0000)
The kqueue socket engine broke with strict warnings.

src/socketengine_kqueue.c

index 5019e98..8558565 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <sys/event.h>
 #include <sys/time.h>
+#include <stdint.h>
 
 #define MAX_EVENT_QUEUE 64
 
@@ -146,7 +147,7 @@ engine_del_fd(int fd)
 void 
 engine_change_fd_state(int fd, unsigned int stateplus)
 {
-    unsigned int oldflags = (unsigned int) get_fd_internal(fd);
+    unsigned int oldflags = (unsigned int)(intptr_t)get_fd_internal(fd);
     struct kevent e;
 
     /* Something changed with our read state? */
@@ -173,7 +174,7 @@ engine_change_fd_state(int fd, unsigned int stateplus)
         kevent_add(&e);
     }
 
-    set_fd_internal(fd, (void *) stateplus);
+    set_fd_internal(fd, (void *)(intptr_t)stateplus);
 }
 
 #define ENGINE_MAX_EVENTS 512