diff options
author | Jefty Negapatan <jefty.dev@gmail.com> | 2020-04-11 17:44:46 +0200 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2020-04-11 18:26:59 -0700 |
commit | 3766d834a644236c4df5297d05de5a3babd379f8 (patch) | |
tree | 5149c6ff4099651b5152ab59ec97f8ab73693075 /thread.c | |
parent | bbc544e52b3044831387ec70bb63f7c6abba9b3b (diff) | |
download | memcached-3766d834a644236c4df5297d05de5a3babd379f8.tar.gz |
Fix build warnings in Windows.
1. warning: passing argument 4 of 'event_set' from incompatible pointer type [-Wincompatible-pointer-types]
--> libevent expects callbacks to use evutil_socket_t for fd instead of int. Current code works fine in *nix because it's just int but not in Windows because it's defined as intptr_t.
2. warning: passing argument 4 of 'getsockopt' from incompatible pointer type [-Wincompatible-pointer-types]
--> Apply casting for Windows' getsockopt call
3. warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
--> Replace %lx with more portable %p. long is just 32-bit in 64-bit Windows.
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -89,7 +89,7 @@ static pthread_mutex_t init_lock; static pthread_cond_t init_cond; -static void thread_libevent_process(int fd, short which, void *arg); +static void thread_libevent_process(evutil_socket_t fd, short which, void *arg); /* item_lock() must be held for an item before any modifications to either its * associated hash bucket, or the structure itself. @@ -505,7 +505,7 @@ static void *worker_libevent(void *arg) { * Processes an incoming "handle a new connection" item. This is called when * input arrives on the libevent wakeup pipe. */ -static void thread_libevent_process(int fd, short which, void *arg) { +static void thread_libevent_process(evutil_socket_t fd, short which, void *arg) { LIBEVENT_THREAD *me = arg; CQ_ITEM *item; char buf[1]; |