@@ -48,7 +48,7 @@ typedef struct dispatch_muxnote_s {
4848 TAILQ_HEAD (, dispatch_unote_linkage_s ) dmn_readers_head ;
4949 TAILQ_HEAD (, dispatch_unote_linkage_s ) dmn_writers_head ;
5050 int dmn_fd ;
51- int dmn_ident ;
51+ uint32_t dmn_ident ;
5252 uint32_t dmn_events ;
5353 int16_t dmn_filter ;
5454 bool dmn_skip_outq_ioctl ;
@@ -85,17 +85,17 @@ static struct dispatch_epoll_timeout_s _dispatch_epoll_timeout[] = {
8585
8686DISPATCH_ALWAYS_INLINE
8787static inline struct dispatch_muxnote_bucket_s *
88- _dispatch_muxnote_bucket (int ident )
88+ _dispatch_muxnote_bucket (uint32_t ident )
8989{
90- return & _dispatch_sources [DSL_HASH (( uint32_t ) ident )];
90+ return & _dispatch_sources [DSL_HASH (ident )];
9191}
9292#define _dispatch_unote_muxnote_bucket (du ) \
9393 _dispatch_muxnote_bucket(du._du->du_ident)
9494
9595DISPATCH_ALWAYS_INLINE
9696static inline dispatch_muxnote_t
9797_dispatch_muxnote_find (struct dispatch_muxnote_bucket_s * dmb ,
98- uint64_t ident , int16_t filter )
98+ uint32_t ident , int16_t filter )
9999{
100100 dispatch_muxnote_t dmn ;
101101 if (filter == EVFILT_WRITE ) filter = EVFILT_READ ;
@@ -112,7 +112,7 @@ _dispatch_muxnote_find(struct dispatch_muxnote_bucket_s *dmb,
112112static void
113113_dispatch_muxnote_dispose (dispatch_muxnote_t dmn )
114114{
115- if (dmn -> dmn_filter != EVFILT_READ || dmn -> dmn_fd != dmn -> dmn_ident ) {
115+ if (dmn -> dmn_filter != EVFILT_READ || ( uint32_t ) dmn -> dmn_fd != dmn -> dmn_ident ) {
116116 close (dmn -> dmn_fd );
117117 }
118118 free (dmn );
@@ -142,26 +142,27 @@ _dispatch_muxnote_create(dispatch_unote_t du, uint32_t events)
142142
143143 dispatch_muxnote_t dmn ;
144144 struct stat sb ;
145- int fd = du ._du -> du_ident ;
145+ int fd = ( int ) du ._du -> du_ident ;
146146 int16_t filter = du ._du -> du_filter ;
147147 bool skip_outq_ioctl = false, skip_inq_ioctl = false;
148148 sigset_t sigmask ;
149149
150150 switch (filter ) {
151- case EVFILT_SIGNAL :
152- if (!sigismember (& signals_with_unotes , du ._du -> du_ident )) {
151+ case EVFILT_SIGNAL : {
152+ int signo = (int )du ._du -> du_ident ;
153+ if (!sigismember (& signals_with_unotes , signo )) {
153154 manager_thread = pthread_self ();
154- sigaddset (& signals_with_unotes , du . _du -> du_ident );
155- sigaction (du . _du -> du_ident , & sa , NULL );
155+ sigaddset (& signals_with_unotes , signo );
156+ sigaction (signo , & sa , NULL );
156157 }
157158 sigemptyset (& sigmask );
158- sigaddset (& sigmask , du . _du -> du_ident );
159+ sigaddset (& sigmask , signo );
159160 fd = signalfd (-1 , & sigmask , SFD_NONBLOCK | SFD_CLOEXEC );
160161 if (fd < 0 ) {
161162 return NULL ;
162163 }
163164 break ;
164-
165+ }
165166 case EVFILT_WRITE :
166167 filter = EVFILT_READ ;
167168 case EVFILT_READ :
@@ -290,7 +291,7 @@ _dispatch_unote_resume(dispatch_unote_t du)
290291}
291292
292293bool
293- _dispatch_unote_unregister (dispatch_unote_t du , uint32_t flags )
294+ _dispatch_unote_unregister (dispatch_unote_t du , DISPATCH_UNUSED uint32_t flags )
294295{
295296 switch (du ._du -> du_filter ) {
296297 case DISPATCH_EVFILT_CUSTOM_ADD :
@@ -313,10 +314,10 @@ _dispatch_unote_unregister(dispatch_unote_t du, uint32_t flags)
313314 dul -> du_muxnote = NULL ;
314315
315316 if (TAILQ_EMPTY (& dmn -> dmn_readers_head )) {
316- events &= ~EPOLLIN ;
317+ events &= ( uint32_t )( ~EPOLLIN ) ;
317318 }
318319 if (TAILQ_EMPTY (& dmn -> dmn_writers_head )) {
319- events &= ~EPOLLOUT ;
320+ events &= ( uint32_t )( ~EPOLLOUT ) ;
320321 }
321322
322323 if (events == dmn -> dmn_events ) {
@@ -350,32 +351,33 @@ _dispatch_event_merge_timer(dispatch_clock_t clock)
350351}
351352
352353static void
353- _dispatch_timeout_program (uint32_t tidx , uint64_t target , uint64_t leeway )
354+ _dispatch_timeout_program (uint32_t tidx , uint64_t target ,
355+ DISPATCH_UNUSED uint64_t leeway )
354356{
355357 dispatch_clock_t clock = DISPATCH_TIMER_CLOCK (tidx );
356358 dispatch_epoll_timeout_t timer = & _dispatch_epoll_timeout [clock ];
357359 struct epoll_event ev = {
358360 .events = EPOLLONESHOT | EPOLLIN ,
359361 .data = { .u32 = timer -> det_ident },
360362 };
361- unsigned long op ;
363+ int op ;
362364
363365 if (target >= INT64_MAX && !timer -> det_registered ) {
364366 return ;
365367 }
366368
367369 if (unlikely (timer -> det_fd < 0 )) {
368- clockid_t clock ;
370+ clockid_t clockid ;
369371 int fd ;
370372 switch (DISPATCH_TIMER_CLOCK (tidx )) {
371373 case DISPATCH_CLOCK_MACH :
372- clock = CLOCK_MONOTONIC ;
374+ clockid = CLOCK_MONOTONIC ;
373375 break ;
374376 case DISPATCH_CLOCK_WALL :
375- clock = CLOCK_REALTIME ;
377+ clockid = CLOCK_REALTIME ;
376378 break ;
377379 }
378- fd = timerfd_create (clock , TFD_NONBLOCK | TFD_CLOEXEC );
380+ fd = timerfd_create (clockid , TFD_NONBLOCK | TFD_CLOEXEC );
379381 if (!dispatch_assume (fd >= 0 )) {
380382 return ;
381383 }
@@ -451,7 +453,7 @@ _dispatch_epoll_init(void *context DISPATCH_UNUSED)
451453 .events = EPOLLIN | EPOLLFREE ,
452454 .data = { .u32 = DISPATCH_EPOLL_EVENTFD , },
453455 };
454- unsigned long op = EPOLL_CTL_ADD ;
456+ int op = EPOLL_CTL_ADD ;
455457 if (epoll_ctl (_dispatch_epfd , op , _dispatch_eventfd , & ev ) < 0 ) {
456458 DISPATCH_INTERNAL_CRASH (errno , "epoll_ctl() failed" );
457459 }
@@ -504,7 +506,7 @@ _dispatch_get_buffer_size(dispatch_muxnote_t dmn, bool writer)
504506 return 1 ;
505507 }
506508
507- if (ioctl (dmn -> dmn_ident , writer ? SIOCOUTQ : SIOCINQ , & n ) != 0 ) {
509+ if (ioctl (( int ) dmn -> dmn_ident , writer ? SIOCOUTQ : SIOCINQ , & n ) != 0 ) {
508510 switch (errno ) {
509511 case EINVAL :
510512 case ENOTTY :
0 commit comments