changeset 9432:b7dd813a5a6f

Events: fixed -Wzero-as-null-pointer-constant warnings in kqueue. The kevent udata field is special in that we maintain compatibility with NetBSD versions that predate using the "void *" type. The fix is to cast to intermediate uintptr_t that is casted back to "void *" where appropriate.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 08 Jul 2025 22:45:33 +0400
parents b18e6a6bb729
children 0afc152028f0
files src/event/modules/ngx_kqueue_module.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/event/modules/ngx_kqueue_module.c	Tue Jul 08 18:07:04 2025 +0400
+++ b/src/event/modules/ngx_kqueue_module.c	Tue Jul 08 22:45:33 2025 +0400
@@ -191,7 +191,7 @@
         kev.flags = EV_ADD|EV_ENABLE;
         kev.fflags = 0;
         kev.data = timer;
-        kev.udata = 0;
+        kev.udata = NGX_KQUEUE_UDATA_T (uintptr_t) 0;
 
         ts.tv_sec = 0;
         ts.tv_nsec = 0;
@@ -237,7 +237,7 @@
     notify_kev.data = 0;
     notify_kev.flags = EV_ADD|EV_CLEAR;
     notify_kev.fflags = 0;
-    notify_kev.udata = 0;
+    notify_kev.udata = NGX_KQUEUE_UDATA_T (uintptr_t) 0;
 
     if (kevent(ngx_kqueue, &notify_kev, 1, NULL, 0, NULL) == -1) {
         ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,