diff --git a/src/unix/core.c b/src/unix/core.c index 002041e9..6c5e8e61 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -276,7 +276,7 @@ void uv__handle_init(uv_loop_t* loop, uv_handle_t* handle, handle->loop = loop; handle->type = type; - handle->flags = UV__REF; /* ref the loop when active */ + handle->flags = UV__HANDLE_REF; /* ref the loop when active */ handle->next_closing = NULL; } diff --git a/src/uv-common.h b/src/uv-common.h index 6e484ef5..df2a647b 100644 --- a/src/uv-common.h +++ b/src/uv-common.h @@ -49,12 +49,12 @@ #ifndef _WIN32 enum { - UV__ACTIVE = 0x4000, - UV__REF = 0x8000 + UV__HANDLE_ACTIVE = 0x4000, + UV__HANDLE_REF = 0x8000 }; #else -# define UV__REF 0x00000020 -# define UV__ACTIVE 0x00000040 +# define UV__HANDLE_ACTIVE 0x40 +# define UV__HANDLE_REF 0x20 #endif extern const uv_err_t uv_ok_; @@ -117,35 +117,35 @@ UNUSED static void uv__active_handle_rm(uv_handle_t* h) { #define uv__req_unregister(loop, req) uv__req_unregister((loop), (uv_req_t*)(req)) UNUSED static int uv__is_active(const uv_handle_t* h) { - return !!(h->flags & UV__ACTIVE); + return !!(h->flags & UV__HANDLE_ACTIVE); } #define uv__is_active(h) uv__is_active((const uv_handle_t*)(h)) UNUSED static void uv__handle_start(uv_handle_t* h) { - if (h->flags & UV__ACTIVE) return; - if (h->flags & UV__REF) uv__active_handle_add(h); - h->flags |= UV__ACTIVE; + if (h->flags & UV__HANDLE_ACTIVE) return; + if (h->flags & UV__HANDLE_REF) uv__active_handle_add(h); + h->flags |= UV__HANDLE_ACTIVE; } #define uv__handle_start(h) uv__handle_start((uv_handle_t*)(h)) UNUSED static void uv__handle_stop(uv_handle_t* h) { - if (!(h->flags & UV__ACTIVE)) return; - if (h->flags & UV__REF) uv__active_handle_rm(h); - h->flags &= ~UV__ACTIVE; + if (!(h->flags & UV__HANDLE_ACTIVE)) return; + if (h->flags & UV__HANDLE_REF) uv__active_handle_rm(h); + h->flags &= ~UV__HANDLE_ACTIVE; } #define uv__handle_stop(h) uv__handle_stop((uv_handle_t*)(h)) UNUSED static void uv__handle_ref(uv_handle_t* h) { - if (h->flags & UV__REF) return; - if (h->flags & UV__ACTIVE) uv__active_handle_add(h); - h->flags |= UV__REF; + if (h->flags & UV__HANDLE_REF) return; + if (h->flags & UV__HANDLE_ACTIVE) uv__active_handle_add(h); + h->flags |= UV__HANDLE_REF; } #define uv__handle_ref(h) uv__handle_ref((uv_handle_t*)(h)) UNUSED static void uv__handle_unref(uv_handle_t* h) { - if (!(h->flags & UV__REF)) return; - if (h->flags & UV__ACTIVE) uv__active_handle_rm(h); - h->flags &= ~UV__REF; + if (!(h->flags & UV__HANDLE_REF)) return; + if (h->flags & UV__HANDLE_ACTIVE) uv__active_handle_rm(h); + h->flags &= ~UV__HANDLE_REF; } #define uv__handle_unref(h) uv__handle_unref((uv_handle_t*)(h)) diff --git a/src/win/handle.c b/src/win/handle.c index b5011438..5f8b2408 100644 --- a/src/win/handle.c +++ b/src/win/handle.c @@ -57,13 +57,14 @@ uv_handle_type uv_guess_handle(uv_file file) { int uv_is_active(const uv_handle_t* handle) { - return (handle->flags & UV__ACTIVE) && !(handle->flags & UV_HANDLE_CLOSING); + return (handle->flags & UV__HANDLE_ACTIVE) && + !(handle->flags & UV_HANDLE_CLOSING); } void uv_handle_init(uv_loop_t* loop, uv_handle_t* handle) { handle->loop = loop; - handle->flags = UV__REF; + handle->flags = UV__HANDLE_REF; loop->counters.handle_init++; } diff --git a/src/win/internal.h b/src/win/internal.h index f594ddd3..e505292c 100644 --- a/src/win/internal.h +++ b/src/win/internal.h @@ -40,9 +40,8 @@ #define UV_HANDLE_ENDGAME_QUEUED 0x00000004 #define UV_HANDLE_ACTIVE 0x00000010 -/* Keep in sync with uv-common.h: */ -#define UV__REF 0x00000020 -#define UV__ACTIVE 0x00000040 +/* uv-common.h: #define UV__HANDLE_ACTIVE 0x00000040 */ +/* uv-common.h: #define UV__HANDLE_REF 0x00000020 */ /* reserved: #define UV_HANDLE_INTERNAL 0x00000080 */ /* Used by streams and UDP handles. */