From fbd2d7a194538bfbb15edd36ecc922d2f9ac2e70 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Tue, 7 Jun 2011 18:09:25 +0200 Subject: [PATCH] Misc. cleanups --- test/benchmark-pump.c | 2 -- uv-win.c | 9 ++++----- uv-win.h | 6 +++--- uv.h | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/test/benchmark-pump.c b/test/benchmark-pump.c index 40aa2863..6aa7776a 100644 --- a/test/benchmark-pump.c +++ b/test/benchmark-pump.c @@ -363,8 +363,6 @@ HELPER_IMPL(pump_server) { void pump(int n) { - int r; - ASSERT(n <= MAX_WRITE_HANDLES); TARGET_CONNECTIONS = n; diff --git a/uv-win.c b/uv-win.c index 4e44483b..a8f1463b 100644 --- a/uv-win.c +++ b/uv-win.c @@ -770,7 +770,7 @@ static void uv_queue_accept(uv_tcp_t* handle) { static void uv_queue_read(uv_tcp_t* handle) { - uv_req_t *req; + uv_req_t* req; uv_buf_t buf; int result; DWORD bytes, flags; @@ -844,7 +844,6 @@ int uv_accept(uv_tcp_t* server, uv_tcp_t* client, } if (uv_tcp_init_socket(client, close_cb, data, server->accept_socket) == -1) { - uv_fatal_error(uv_last_error_.sys_errno_, "init"); closesocket(server->accept_socket); rv = -1; } @@ -984,17 +983,17 @@ int uv_write(uv_req_t* req, uv_buf_t bufs[], int bufcnt) { if (result != 0) { err = WSAGetLastError(); if (err != WSA_IO_PENDING) { - /* Send faild due to an error */ + /* Send failed due to an error. */ uv_set_sys_error(WSAGetLastError()); return -1; } } if (result == 0) { - /* Request completed immediately */ + /* Request completed immediately. */ req->queued_bytes = 0; } else { - /* Request queued by the kernel */ + /* Request queued by the kernel. */ req->queued_bytes = uv_count_bufs(bufs, bufcnt); handle->write_queue_size += req->queued_bytes; } diff --git a/uv-win.h b/uv-win.h index 4f766f3f..4418698a 100644 --- a/uv-win.h +++ b/uv-win.h @@ -59,12 +59,12 @@ typedef struct uv_buf_t { uv_req_t* shutdown_req; #define uv_tcp_server_fields \ - void *connection_cb; \ + void *connection_cb; \ SOCKET accept_socket; \ struct uv_req_s accept_req; \ char accept_buffer[sizeof(struct sockaddr_storage) * 2 + 32]; -#define UV_TCP_PRIVATE_FIELDS \ +#define UV_TCP_PRIVATE_FIELDS \ unsigned int reqs_pending; \ union { \ SOCKET socket; \ @@ -104,7 +104,7 @@ typedef struct uv_buf_t { uv_handle_t* endgame_next; \ unsigned int flags; \ uv_err_t error; \ - UV_LOOP_PRIVATE_FIELDS + UV_LOOP_PRIVATE_FIELDS int uv_utf16_to_utf8(wchar_t* utf16Buffer, size_t utf16Size, char* utf8Buffer, size_t utf8Size); diff --git a/uv.h b/uv.h index e5aeb525..cc9cebfe 100644 --- a/uv.h +++ b/uv.h @@ -311,7 +311,7 @@ int uv_timer_start(uv_timer_t* timer, uv_loop_cb cb, int64_t timeout, int64_t re int uv_timer_stop(uv_timer_t* timer); /* - * Stop the timer, and if it is repeating restart it using the repeat value + * Stop the timer, and if it is repeating restart it using the repeat value * as the timeout. If the timer has never been started before it returns -1 and * sets the error to UV_EINVAL. */