From d6bfedb8629d18a84c1e67d7073de56dabd540b8 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 20 Feb 2013 16:42:15 +0100 Subject: [PATCH] unix, windows: make uv_now() return uint64_t Using int64_t doesn't make sense here because the return value is never negative. --- include/uv-private/uv-win.h | 2 +- include/uv.h | 2 +- src/unix/core.c | 2 +- src/win/timer.c | 2 +- test/test-timer-again.c | 2 +- test/test-timer.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/uv-private/uv-win.h b/include/uv-private/uv-win.h index 876b13120..82c0cff1d 100644 --- a/include/uv-private/uv-win.h +++ b/include/uv-private/uv-win.h @@ -277,7 +277,7 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s); /* The loop's I/O completion port */ \ HANDLE iocp; \ /* The current time according to the event loop. in msecs. */ \ - int64_t time; \ + uint64_t time; \ /* Tail of a single-linked circular queue of pending reqs. If the queue */ \ /* is empty, tail_ is NULL. If there is only one item, */ \ /* tail_->next_req == tail_ */ \ diff --git a/include/uv.h b/include/uv.h index 3c81d55f4..e1eaf81e5 100644 --- a/include/uv.h +++ b/include/uv.h @@ -266,7 +266,7 @@ UV_EXTERN void uv_ref(uv_handle_t*); UV_EXTERN void uv_unref(uv_handle_t*); UV_EXTERN void uv_update_time(uv_loop_t*); -UV_EXTERN int64_t uv_now(uv_loop_t*); +UV_EXTERN uint64_t uv_now(uv_loop_t*); /* * Get backend file descriptor. Only kqueue, epoll and event ports are diff --git a/src/unix/core.c b/src/unix/core.c index 77b8e519b..d59927729 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -306,7 +306,7 @@ void uv_update_time(uv_loop_t* loop) { } -int64_t uv_now(uv_loop_t* loop) { +uint64_t uv_now(uv_loop_t* loop) { return loop->time; } diff --git a/src/win/timer.c b/src/win/timer.c index 3ad656f9b..3364f6c0d 100644 --- a/src/win/timer.c +++ b/src/win/timer.c @@ -45,7 +45,7 @@ void uv_update_time(uv_loop_t* loop) { } -int64_t uv_now(uv_loop_t* loop) { +uint64_t uv_now(uv_loop_t* loop) { return loop->time; } diff --git a/test/test-timer-again.c b/test/test-timer-again.c index 6de290469..536ac448e 100644 --- a/test/test-timer-again.c +++ b/test/test-timer-again.c @@ -31,7 +31,7 @@ static int repeat_2_cb_allowed = 0; static uv_timer_t dummy, repeat_1, repeat_2; -static int64_t start_time; +static uint64_t start_time; static void close_cb(uv_handle_t* handle) { diff --git a/test/test-timer.c b/test/test-timer.c index 6682ecaa2..60b080d28 100644 --- a/test/test-timer.c +++ b/test/test-timer.c @@ -29,7 +29,7 @@ static int repeat_cb_called = 0; static int repeat_close_cb_called = 0; static int order_cb_called = 0; -static int64_t start_time; +static uint64_t start_time; static void once_close_cb(uv_handle_t* handle) {