Skip to content

Commit 68d03ae

Browse files
nettlepktopley-apple
authored andcommitted
A few updates to enable building on Raspberry PI/Ubuntu 16.04
Signed-off-by: Daniel A. Steffen <[email protected]>
1 parent e5bfb27 commit 68d03ae

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/event/event_epoll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ _dispatch_timeout_program(uint32_t tidx, uint64_t target,
419419

420420
if (target < INT64_MAX) {
421421
struct itimerspec its = { .it_value = {
422-
.tv_sec = target / NSEC_PER_SEC,
422+
.tv_sec = (time_t)(target / NSEC_PER_SEC),
423423
.tv_nsec = target % NSEC_PER_SEC,
424424
} };
425425
dispatch_assume_zero(timerfd_settime(timer->det_fd, TFD_TIMER_ABSTIME,

src/source.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,15 +2023,15 @@ static inline unsigned long
20232023
_dispatch_source_timer_data(dispatch_source_t ds, dispatch_unote_t du)
20242024
{
20252025
dispatch_timer_source_refs_t dr = du._dt;
2026-
unsigned long data, prev, clear_prev = 0;
2026+
uint64_t data, prev, clear_prev = 0;
20272027

20282028
os_atomic_rmw_loop2o(ds, ds_pending_data, prev, clear_prev, relaxed, {
20292029
data = prev >> 1;
20302030
if (unlikely(prev & DISPATCH_TIMER_MISSED_MARKER)) {
20312031
os_atomic_rmw_loop_give_up(goto handle_missed_intervals);
20322032
}
20332033
});
2034-
return data;
2034+
return (unsigned long)data;
20352035

20362036
handle_missed_intervals:
20372037
// The timer may be in _dispatch_source_invoke2() already for other
@@ -2046,7 +2046,7 @@ _dispatch_source_timer_data(dispatch_source_t ds, dispatch_unote_t du)
20462046
uint64_t now = _dispatch_time_now(DISPATCH_TIMER_CLOCK(dr->du_ident));
20472047
if (now >= dr->dt_timer.target) {
20482048
OS_COMPILER_CAN_ASSUME(dr->dt_timer.interval < INT64_MAX);
2049-
data = _dispatch_source_timer_compute_missed(dr, now, data);
2049+
data = _dispatch_source_timer_compute_missed(dr, now, (unsigned long)data);
20502050
}
20512051

20522052
// When we see the MISSED_MARKER the manager has given up on this timer
@@ -2059,7 +2059,7 @@ _dispatch_source_timer_data(dispatch_source_t ds, dispatch_unote_t du)
20592059
// on the manager and make the changes to `ds_timer` above visible.
20602060
_dispatch_queue_atomic_flags_clear(ds->_as_dq, DSF_ARMED);
20612061
os_atomic_store2o(ds, ds_pending_data, 0, relaxed);
2062-
return data;
2062+
return (unsigned long)data;
20632063
}
20642064

20652065
static inline void

0 commit comments

Comments
 (0)