diff --git a/src/event/event.c b/src/event/event.c index 6ace80ecb..33df9f171 100644 --- a/src/event/event.c +++ b/src/event/event.c @@ -792,7 +792,7 @@ static void _dispatch_timer_unote_disarm(dispatch_timer_source_refs_t dt, dispatch_timer_heap_t dth) { - uint32_t tidx = dt->du_ident; + uint32_t tidx = (uint32_t)dt->du_ident; dispatch_assert(_dispatch_unote_armed(dt)); _dispatch_timer_heap_remove(&dth[tidx], dt); diff --git a/src/event/event_internal.h b/src/event/event_internal.h index 14c485ee3..5b2c7fc80 100644 --- a/src/event/event_internal.h +++ b/src/event/event_internal.h @@ -125,6 +125,8 @@ _dispatch_timer_flags_from_clock(dispatch_clock_t clock) #if defined(_WIN32) typedef uintptr_t dispatch_unote_ident_t; +#elif defined(__OpenBSD__) +typedef uintptr_t dispatch_unote_ident_t; #else typedef uint32_t dispatch_unote_ident_t; #endif diff --git a/src/event/event_kevent.c b/src/event/event_kevent.c index 819649dbe..c91490fa8 100644 --- a/src/event/event_kevent.c +++ b/src/event/event_kevent.c @@ -240,9 +240,9 @@ dispatch_kevent_debug(const char *verb, const dispatch_kevent_s *kev, #define _dispatch_du_debug(what, du) \ _dispatch_debug("kevent-source[%p]: %s kevent[%p] " \ - "{ filter = %s, ident = 0x%x }", \ + "{ filter = %s, ident = 0x%llx }", \ _dispatch_wref2ptr((du)->du_owner_wref), what, \ - (du), _evfiltstr((du)->du_filter), (du)->du_ident) + (du), _evfiltstr((du)->du_filter), (unsigned long long)(du)->du_ident) #if DISPATCH_MACHPORT_DEBUG #ifndef MACH_PORT_TYPE_SPREQUEST diff --git a/src/init.c b/src/init.c index 0fe0e4385..af5c91b58 100644 --- a/src/init.c +++ b/src/init.c @@ -1049,7 +1049,7 @@ _dispatch_bug_kevent_vanished(dispatch_unote_t du) "{ %p[%s], ident: %" PRIdPTR " / 0x%" PRIxPTR ", handler: %p }", dux_type(du._du)->dst_kind, dou._dq, dou._dq->dq_label ? dou._dq->dq_label : "", - du._du->du_ident, du._du->du_ident, func); + (intptr_t)du._du->du_ident, (uintptr_t)du._du->du_ident, func); } #endif // RDAR_49023449 @@ -1154,8 +1154,8 @@ _dispatch_logv_init(void *context DISPATCH_UNUSED) } #else dprintf(dispatch_logfile, "=== log file opened for %s[%u] at " - "%ld.%06u ===\n", getprogname() ?: "", getpid(), - tv.tv_sec, (int)tv.tv_usec); + "%lld.%06u ===\n", getprogname() ?: "", getpid(), + (time_t)tv.tv_sec, (int)tv.tv_usec); #endif } } diff --git a/src/source.c b/src/source.c index d1581351d..69b731d92 100644 --- a/src/source.c +++ b/src/source.c @@ -1401,8 +1401,8 @@ _dispatch_source_debug_attr(dispatch_source_t ds, char* buf, size_t bufsiz) return dsnprintf(buf, bufsiz, "target = %s[%p], ident = 0x%llx, " "mask = 0x%x, pending_data = 0x%llx, registered = %d, " "armed = %d, %s%s%s", - target && target->dq_label ? target->dq_label : "", target, - (unsigned long long)dr->du_ident, dr->du_fflags, + target && target->dq_label ? target->dq_label : "", + target, (unsigned long long)dr->du_ident, dr->du_fflags, (unsigned long long)dr->ds_pending_data, _du_state_registered(du_state), _du_state_armed(du_state), (dqf & DSF_CANCELED) ? "cancelled, " : "",