From 4d4f1496d9b600dfd3e4c4f0040d7b4a0d41043c Mon Sep 17 00:00:00 2001 From: Brian White Date: Wed, 10 Apr 2013 14:29:29 +0200 Subject: [PATCH] windows, unix: remove dead code --- src/unix/aix.c | 2 -- src/unix/cygwin.c | 3 --- src/win/core.c | 11 +++++------ src/win/poll.c | 10 +--------- src/win/udp.c | 3 +-- src/win/winsock.c | 6 ------ 6 files changed, 7 insertions(+), 28 deletions(-) diff --git a/src/unix/aix.c b/src/unix/aix.c index 5ea33bbc..8ac6eca0 100644 --- a/src/unix/aix.c +++ b/src/unix/aix.c @@ -62,7 +62,6 @@ uint64_t uv__hrtime(void) { int uv_exepath(char* buffer, size_t* size) { ssize_t res; char pp[64], cwdl[PATH_MAX]; - size_t cwdl_len; struct psinfo ps; int fd; @@ -79,7 +78,6 @@ int uv_exepath(char* buffer, size_t* size) { return res; cwdl[res] = '\0'; - cwdl_len = res; (void) snprintf(pp, sizeof(pp), "/proc/%lu/psinfo", (unsigned long) getpid()); fd = open(pp, O_RDONLY); diff --git a/src/unix/cygwin.c b/src/unix/cygwin.c index 97464541..9ee520d7 100644 --- a/src/unix/cygwin.c +++ b/src/unix/cygwin.c @@ -56,9 +56,6 @@ void uv_loadavg(double avg[3]) { int uv_exepath(char* buffer, size_t* size) { uint32_t usize; - int result; - char* path; - char* fullpath; if (!buffer || !size) { return -1; diff --git a/src/win/core.c b/src/win/core.c index 0d85c07b..9680c7e5 100644 --- a/src/win/core.c +++ b/src/win/core.c @@ -185,7 +185,6 @@ int uv_backend_timeout(const uv_loop_t* loop) { static void uv_poll(uv_loop_t* loop, int block) { - BOOL success; DWORD bytes, timeout; ULONG_PTR key; OVERLAPPED* overlapped; @@ -197,11 +196,11 @@ static void uv_poll(uv_loop_t* loop, int block) { timeout = 0; } - success = GetQueuedCompletionStatus(loop->iocp, - &bytes, - &key, - &overlapped, - timeout); + GetQueuedCompletionStatus(loop->iocp, + &bytes, + &key, + &overlapped, + timeout); if (overlapped) { /* Package was dequeued */ diff --git a/src/win/poll.c b/src/win/poll.c index 82197241..f6972f96 100644 --- a/src/win/poll.c +++ b/src/win/poll.c @@ -311,7 +311,7 @@ static SOCKET uv__fast_poll_get_peer_socket(uv_loop_t* loop, static DWORD WINAPI uv__slow_poll_thread_proc(void* arg) { uv_req_t* req = (uv_req_t*) arg; uv_poll_t* handle = (uv_poll_t*) req->data; - unsigned char events, reported_events; + unsigned char reported_events; int r; uv_single_fd_set_t rfds, wfds, efds; struct timeval timeout; @@ -319,14 +319,6 @@ static DWORD WINAPI uv__slow_poll_thread_proc(void* arg) { assert(handle->type == UV_POLL); assert(req->type == UV_POLL_REQ); - if (req == &handle->poll_req_1) { - events = handle->submitted_events_1; - } else if (req == &handle->poll_req_2) { - events = handle->submitted_events_2; - } else { - assert(0); - } - if (handle->events & UV_READABLE) { rfds.fd_count = 1; rfds.fd_array[0] = handle->socket; diff --git a/src/win/udp.c b/src/win/udp.c index b6b6e0f7..4dcb19d8 100644 --- a/src/win/udp.c +++ b/src/win/udp.c @@ -182,7 +182,7 @@ static int uv__bind(uv_udp_t* handle, int addrsize, unsigned int flags) { int r; - DWORD no = 0, yes = 1; + DWORD no = 0; if ((flags & UV_UDP_IPV6ONLY) && family != AF_INET6) { /* UV_UDP_IPV6ONLY is supported only for IPV6 sockets */ @@ -658,7 +658,6 @@ int uv_udp_set_broadcast(uv_udp_t* handle, int value) { int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock) { WSAPROTOCOL_INFOW protocol_info; int opt_len; - DWORD yes = 1; /* Detect the address family of the socket. */ opt_len = (int) sizeof protocol_info; diff --git a/src/win/winsock.c b/src/win/winsock.c index 47395bb8..cf6d0318 100644 --- a/src/win/winsock.c +++ b/src/win/winsock.c @@ -79,12 +79,6 @@ static int error_means_no_support(DWORD error) { void uv_winsock_init() { - const GUID wsaid_connectex = WSAID_CONNECTEX; - const GUID wsaid_acceptex = WSAID_ACCEPTEX; - const GUID wsaid_getacceptexsockaddrs = WSAID_GETACCEPTEXSOCKADDRS; - const GUID wsaid_disconnectex = WSAID_DISCONNECTEX; - const GUID wsaid_transmitfile = WSAID_TRANSMITFILE; - WSADATA wsa_data; int errorno; SOCKET dummy;