Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

unix, windows: removed unused status parameter

async, timer, prepare, idle and check handles don't need the status
parameter.
  • Loading branch information...
saghul committed Mar 10, 2014
1 parent a2506c9 commit db2a9072bce129630214904be5e2eedeaafc9835
Showing with 105 additions and 139 deletions.
  1. +5 −6 include/uv.h
  2. +2 −2 src/fs-poll.c
  3. +1 −1 src/unix/async.c
  4. +1 −1 src/unix/internal.h
  5. +1 −1 src/unix/loop-watcher.c
  6. +1 −1 src/unix/threadpool.c
  7. +1 −1 src/unix/timer.c
  8. +1 −1 src/win/async.c
  9. +1 −1 src/win/loop-watcher.c
  10. +2 −3 src/win/pipe.c
  11. +1 −1 src/win/timer.c
  12. +1 −1 test/benchmark-async-pummel.c
  13. +2 −2 test/benchmark-async.c
  14. +3 −3 test/benchmark-loop-count.c
  15. +2 −2 test/benchmark-million-async.c
  16. +1 −1 test/benchmark-million-timers.c
  17. +4 −4 test/benchmark-multi-accept.c
  18. +1 −1 test/benchmark-pump.c
  19. +1 −1 test/benchmark-udp-pummel.c
  20. +1 −1 test/test-active.c
  21. +1 −1 test/test-async-null-cb.c
  22. +2 −4 test/test-async.c
  23. +3 −3 test/test-callback-order.c
  24. +1 −2 test/test-callback-stack.c
  25. +2 −2 test/test-close-order.c
  26. +1 −2 test/test-connection-fail.c
  27. +1 −2 test/test-delayed-accept.c
  28. +2 −2 test/test-embed.c
  29. +11 −15 test/test-fs-event.c
  30. +2 −2 test/test-fs-poll.c
  31. +3 −6 test/test-idle.c
  32. +1 −2 test/test-loop-alive.c
  33. +1 −2 test/test-loop-close.c
  34. +6 −13 test/test-loop-handles.c
  35. +2 −4 test/test-loop-stop.c
  36. +2 −2 test/test-poll.c
  37. +1 −2 test/test-ref.c
  38. +1 −2 test/test-run-nowait.c
  39. +1 −2 test/test-run-once.c
  40. +1 −1 test/test-shutdown-eof.c
  41. +1 −1 test/test-signal.c
  42. +2 −2 test/test-spawn.c
  43. +2 −2 test/test-tcp-close-while-connecting.c
  44. +2 −2 test/test-tcp-connect-timeout.c
  45. +1 −1 test/test-tcp-read-stop.c
  46. +1 −1 test/test-tcp-shutdown-after-write.c
  47. +2 −2 test/test-tcp-unexpected-read.c
  48. +1 −1 test/test-threadpool-cancel.c
  49. +2 −5 test/test-timer-again.c
  50. +3 −3 test/test-timer-from-check.c
  51. +8 −10 test/test-timer.c
  52. +1 −1 test/test-udp-ipv6.c
  53. +1 −2 test/test-walk-handles.c
@@ -405,12 +405,11 @@ typedef void (*uv_shutdown_cb)(uv_shutdown_t* req, int status);
typedef void (*uv_connection_cb)(uv_stream_t* server, int status);
typedef void (*uv_close_cb)(uv_handle_t* handle);
typedef void (*uv_poll_cb)(uv_poll_t* handle, int status, int events);
typedef void (*uv_timer_cb)(uv_timer_t* handle, int status);
/* TODO: do these really need a status argument? */
typedef void (*uv_async_cb)(uv_async_t* handle, int status);
typedef void (*uv_prepare_cb)(uv_prepare_t* handle, int status);
typedef void (*uv_check_cb)(uv_check_t* handle, int status);
typedef void (*uv_idle_cb)(uv_idle_t* handle, int status);
typedef void (*uv_timer_cb)(uv_timer_t* handle);
typedef void (*uv_async_cb)(uv_async_t* handle);
typedef void (*uv_prepare_cb)(uv_prepare_t* handle);
typedef void (*uv_check_cb)(uv_check_t* handle);
typedef void (*uv_idle_cb)(uv_idle_t* handle);
typedef void (*uv_exit_cb)(uv_process_t*, int64_t exit_status, int term_signal);
typedef void (*uv_walk_cb)(uv_handle_t* handle, void* arg);
typedef void (*uv_fs_cb)(uv_fs_t* req);
@@ -41,7 +41,7 @@ struct poll_ctx {

static int statbuf_eq(const uv_stat_t* a, const uv_stat_t* b);
static void poll_cb(uv_fs_t* req);
static void timer_cb(uv_timer_t* timer, int status);
static void timer_cb(uv_timer_t* timer);
static void timer_close_cb(uv_handle_t* handle);

static uv_stat_t zero_statbuf;
@@ -148,7 +148,7 @@ void uv__fs_poll_close(uv_fs_poll_t* handle) {
}


static void timer_cb(uv_timer_t* timer, int status) {
static void timer_cb(uv_timer_t* timer) {
struct poll_ctx* ctx;

ctx = container_of(timer, struct poll_ctx, timer_handle);
@@ -85,7 +85,7 @@ static void uv__async_event(uv_loop_t* loop,

if (h->async_cb == NULL)
continue;
h->async_cb(h, 0);
h->async_cb(h);
}
}

@@ -214,7 +214,7 @@ void uv__work_submit(uv_loop_t* loop,
struct uv__work *w,
void (*work)(struct uv__work *w),
void (*done)(struct uv__work *w, int status));
void uv__work_done(uv_async_t* handle, int status);
void uv__work_done(uv_async_t* handle);

/* platform specific */
uint64_t uv__hrtime(uv_clocktype_t type);
@@ -50,7 +50,7 @@
QUEUE* q; \
QUEUE_FOREACH(q, &loop->name##_handles) { \
h = QUEUE_DATA(q, uv_##name##_t, queue); \
h->name##_cb(h, 0); \
h->name##_cb(h); \
} \
} \
\
@@ -191,7 +191,7 @@ static int uv__work_cancel(uv_loop_t* loop, uv_req_t* req, struct uv__work* w) {
}


void uv__work_done(uv_async_t* handle, int status) {
void uv__work_done(uv_async_t* handle) {
struct uv__work* w;
uv_loop_t* loop;
QUEUE* q;
@@ -159,7 +159,7 @@ void uv__run_timers(uv_loop_t* loop) {

uv_timer_stop(handle);
uv_timer_again(handle);
handle->timer_cb(handle, 0);
handle->timer_cb(handle);
}
}

@@ -94,6 +94,6 @@ void uv_process_async_wakeup_req(uv_loop_t* loop, uv_async_t* handle,
if (handle->flags & UV__HANDLE_CLOSING) {
uv_want_endgame(loop, (uv_handle_t*)handle);
} else if (handle->async_cb != NULL) {
handle->async_cb(handle, 0);
handle->async_cb(handle);
}
}
@@ -115,7 +115,7 @@ void uv_loop_watcher_endgame(uv_loop_t* loop, uv_handle_t* handle) {
handle = (loop)->next_##name##_handle; \
(loop)->next_##name##_handle = handle->name##_next; \
\
handle->name##_cb(handle, 0); \
handle->name##_cb(handle); \
} \
}

@@ -79,7 +79,7 @@ typedef struct {
static void eof_timer_init(uv_pipe_t* pipe);
static void eof_timer_start(uv_pipe_t* pipe);
static void eof_timer_stop(uv_pipe_t* pipe);
static void eof_timer_cb(uv_timer_t* timer, int status);
static void eof_timer_cb(uv_timer_t* timer);
static void eof_timer_destroy(uv_pipe_t* pipe);
static void eof_timer_close_cb(uv_handle_t* handle);

@@ -1695,11 +1695,10 @@ static void eof_timer_stop(uv_pipe_t* pipe) {
}


static void eof_timer_cb(uv_timer_t* timer, int status) {
static void eof_timer_cb(uv_timer_t* timer) {
uv_pipe_t* pipe = (uv_pipe_t*) timer->data;
uv_loop_t* loop = timer->loop;

assert(status == 0); /* timers can't fail */
assert(pipe->type == UV_NAMED_PIPE);

/* This should always be true, since we start the timer only */
@@ -249,6 +249,6 @@ void uv_process_timers(uv_loop_t* loop) {
uv__handle_stop(timer);
}

timer->timer_cb((uv_timer_t*) timer, 0);
timer->timer_cb((uv_timer_t*) timer);
}
}
@@ -36,7 +36,7 @@ static const char stop[] = "stop";
static const char stopped[] = "stopped";


static void async_cb(uv_async_t* handle, int status) {
static void async_cb(uv_async_t* handle) {
if (++callbacks == NUM_PINGS) {
/* Tell the pummel thread to stop. */
ACCESS_ONCE(const char*, handle->data) = stop;
@@ -40,7 +40,7 @@ struct ctx {
};


static void worker_async_cb(uv_async_t* handle, int status) {
static void worker_async_cb(uv_async_t* handle) {
struct ctx* ctx = container_of(handle, struct ctx, worker_async);

ASSERT(0 == uv_async_send(&ctx->main_async));
@@ -52,7 +52,7 @@ static void worker_async_cb(uv_async_t* handle, int status) {
}


static void main_async_cb(uv_async_t* handle, int status) {
static void main_async_cb(uv_async_t* handle) {
struct ctx* ctx = container_of(handle, struct ctx, main_async);

ASSERT(0 == uv_async_send(&ctx->worker_async));
@@ -32,18 +32,18 @@ static uv_idle_t idle_handle;
static uv_timer_t timer_handle;


static void idle_cb(uv_idle_t* handle, int status) {
static void idle_cb(uv_idle_t* handle) {
if (++ticks == NUM_TICKS)
uv_idle_stop(handle);
}


static void idle2_cb(uv_idle_t* handle, int status) {
static void idle2_cb(uv_idle_t* handle) {
ticks++;
}


static void timer_cb(uv_timer_t* handle, int status) {
static void timer_cb(uv_timer_t* handle) {
uv_idle_stop(&idle_handle);
uv_timer_stop(&timer_handle);
}
@@ -50,13 +50,13 @@ static void thread_cb(void* arg) {
}


static void async_cb(uv_async_t* handle, int status) {
static void async_cb(uv_async_t* handle) {
container->async_events++;
handle->data = handle;
}


static void timer_cb(uv_timer_t* handle, int status) {
static void timer_cb(uv_timer_t* handle) {
unsigned i;

done = 1;
@@ -28,7 +28,7 @@ static int timer_cb_called;
static int close_cb_called;


static void timer_cb(uv_timer_t* handle, int status) {
static void timer_cb(uv_timer_t* handle) {
timer_cb_called++;
}

@@ -90,15 +90,15 @@ static void ipc_alloc_cb(uv_handle_t* handle,
size_t suggested_size,
uv_buf_t* buf);

static void sv_async_cb(uv_async_t* handle, int status);
static void sv_async_cb(uv_async_t* handle);
static void sv_connection_cb(uv_stream_t* server_handle, int status);
static void sv_read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf);
static void sv_alloc_cb(uv_handle_t* handle,
size_t suggested_size,
uv_buf_t* buf);

static void cl_connect_cb(uv_connect_t* req, int status);
static void cl_idle_cb(uv_idle_t* handle, int status);
static void cl_idle_cb(uv_idle_t* handle);
static void cl_close_cb(uv_handle_t* handle);

static struct sockaddr_in listen_addr;
@@ -275,7 +275,7 @@ static void server_cb(void *arg) {
}


static void sv_async_cb(uv_async_t* handle, int status) {
static void sv_async_cb(uv_async_t* handle) {
struct server_ctx* ctx;
ctx = container_of(handle, struct server_ctx, async_handle);
uv_close((uv_handle_t*) &ctx->server_handle, NULL);
@@ -330,7 +330,7 @@ static void cl_connect_cb(uv_connect_t* req, int status) {
}


static void cl_idle_cb(uv_idle_t* handle, int status) {
static void cl_idle_cb(uv_idle_t* handle) {
struct client_ctx* ctx = container_of(handle, struct client_ctx, idle_handle);
uv_close((uv_handle_t*) &ctx->client_handle, cl_close_cb);
uv_idle_stop(&ctx->idle_handle);
@@ -85,7 +85,7 @@ static double gbit(int64_t bytes, int64_t passed_ms) {
}


static void show_stats(uv_timer_t* handle, int status) {
static void show_stats(uv_timer_t* handle) {
int64_t diff;
int i;

@@ -132,7 +132,7 @@ static void close_cb(uv_handle_t* handle) {
}


static void timeout_cb(uv_timer_t* timer, int status) {
static void timeout_cb(uv_timer_t* timer) {
int i;

exiting = 1;
@@ -35,7 +35,7 @@ static void close_cb(uv_handle_t* handle) {
}


static void timer_cb(uv_timer_t* handle, int status) {
static void timer_cb(uv_timer_t* handle) {
ASSERT(0 && "timer_cb should not have been called");
}

@@ -34,7 +34,7 @@ static void thread_cb(void* dummy) {
}


static void check_cb(uv_check_t* handle, int status) {
static void check_cb(uv_check_t* handle) {
ASSERT(check_cb_called == 0);
uv_close((uv_handle_t*) &async_handle, NULL);
uv_close((uv_handle_t*) &check_handle, NULL);
@@ -75,11 +75,10 @@ static void close_cb(uv_handle_t* handle) {
}


static void async_cb(uv_async_t* handle, int status) {
static void async_cb(uv_async_t* handle) {
int n;

ASSERT(handle == &async);
ASSERT(status == 0);

uv_mutex_lock(&mutex);
n = ++async_cb_called;
@@ -92,11 +91,10 @@ static void async_cb(uv_async_t* handle, int status) {
}


static void prepare_cb(uv_prepare_t* handle, int status) {
static void prepare_cb(uv_prepare_t* handle) {
int r;

ASSERT(handle == &prepare);
ASSERT(status == 0);

if (prepare_cb_called++)
return;
@@ -30,23 +30,23 @@ static uv_timer_t timer_handle;


/* idle_cb should run before timer_cb */
static void idle_cb(uv_idle_t* handle, int status) {
static void idle_cb(uv_idle_t* handle) {
ASSERT(idle_cb_called == 0);
ASSERT(timer_cb_called == 0);
uv_idle_stop(handle);
idle_cb_called++;
}


static void timer_cb(uv_timer_t* handle, int status) {
static void timer_cb(uv_timer_t* handle) {
ASSERT(idle_cb_called == 1);
ASSERT(timer_cb_called == 0);
uv_timer_stop(handle);
timer_cb_called++;
}


static void next_tick(uv_idle_t* handle, int status) {
static void next_tick(uv_idle_t* handle) {
uv_loop_t* loop = handle->loop;
uv_idle_stop(handle);
uv_idle_init(loop, &idle_handle);
@@ -105,9 +105,8 @@ static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) {
}


static void timer_cb(uv_timer_t* handle, int status) {
static void timer_cb(uv_timer_t* handle) {
ASSERT(handle == &timer);
ASSERT(status == 0);
ASSERT(nested == 0 && "timer_cb must be called from a fresh stack");

puts("Timeout complete. Now read data...");
@@ -38,7 +38,7 @@ static void close_cb(uv_handle_t* handle) {


/* check_cb should run before any close_cb */
static void check_cb(uv_check_t* handle, int status) {
static void check_cb(uv_check_t* handle) {
ASSERT(check_cb_called == 0);
ASSERT(timer_cb_called == 1);
ASSERT(close_cb_called == 0);
@@ -48,7 +48,7 @@ static void check_cb(uv_check_t* handle, int status) {
}


static void timer_cb(uv_timer_t* handle, int status) {
static void timer_cb(uv_timer_t* handle) {
uv_close((uv_handle_t*) handle, close_cb);
timer_cb_called++;
}
@@ -46,8 +46,7 @@ static void timer_close_cb(uv_handle_t* handle) {
}


static void timer_cb(uv_timer_t* handle, int status) {
ASSERT(status == 0);
static void timer_cb(uv_timer_t* handle) {
timer_cb_calls++;

/*
@@ -45,13 +45,12 @@ static void close_cb(uv_handle_t* handle) {
}


static void do_accept(uv_timer_t* timer_handle, int status) {
static void do_accept(uv_timer_t* timer_handle) {
uv_tcp_t* server;
uv_tcp_t* accepted_handle = (uv_tcp_t*)malloc(sizeof *accepted_handle);
int r;

ASSERT(timer_handle != NULL);
ASSERT(status == 0);
ASSERT(accepted_handle != NULL);

r = uv_tcp_init(uv_default_loop(), accepted_handle);
@@ -90,14 +90,14 @@ static void embed_thread_runner(void* arg) {
}


static void embed_cb(uv_async_t* async, int status) {
static void embed_cb(uv_async_t* async) {
uv_run(uv_default_loop(), UV_RUN_ONCE);

uv_sem_post(&embed_sem);
}


static void embed_timer_cb(uv_timer_t* timer, int status) {
static void embed_timer_cb(uv_timer_t* timer) {
embed_timer_called++;
embed_closed = 1;

0 comments on commit db2a907

Please sign in to comment.
You can’t perform that action at this time.