Skip to content

Commit 16c5901

Browse files
committed
fix warning, adjust function name style
Signed-off-by: Daniel A. Steffen <[email protected]>
1 parent f2d0df9 commit 16c5901

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ void _dispatch_vtable_init(void);
528528
char *_dispatch_get_build(void);
529529

530530
uint64_t _dispatch_timeout(dispatch_time_t when);
531-
uint64_t _dispatch_time_to_nanoseconds(dispatch_time_t when);
531+
uint64_t _dispatch_time_nanoseconds_since_epoch(dispatch_time_t when);
532532

533533
extern bool _dispatch_safe_fork, _dispatch_child_of_unsafe_fork;
534534

src/semaphore.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ _dispatch_semaphore_wait_slow(dispatch_semaphore_t dsema,
342342
}
343343
#elif USE_POSIX_SEM
344344
do {
345-
uint64_t nsec = _dispatch_time_to_nanoseconds(timeout);
345+
uint64_t nsec = _dispatch_time_nanoseconds_since_epoch(timeout);
346346
_timeout.tv_sec = (typeof(_timeout.tv_sec))(nsec / NSEC_PER_SEC);
347347
_timeout.tv_nsec = (typeof(_timeout.tv_nsec))(nsec % NSEC_PER_SEC);
348348
ret = slowpath(sem_timedwait(&dsema->dsema_sem, &_timeout));
@@ -582,7 +582,7 @@ _dispatch_group_wait_slow(dispatch_semaphore_t dsema, dispatch_time_t timeout)
582582
}
583583
#elif USE_POSIX_SEM
584584
do {
585-
uint64_t nsec = _dispatch_time_to_nanoseconds(timeout);
585+
uint64_t nsec = _dispatch_time_nanoseconds_since_epoch(timeout);
586586
_timeout.tv_sec = (typeof(_timeout.tv_sec))(nsec / NSEC_PER_SEC);
587587
_timeout.tv_nsec = (typeof(_timeout.tv_nsec))(nsec % NSEC_PER_SEC);
588588
ret = slowpath(sem_timedwait(&dsema->dsema_sem, &_timeout));

src/time.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ _dispatch_timeout(dispatch_time_t when)
147147
}
148148

149149
uint64_t
150-
_dispatch_time_to_nanoseconds(dispatch_time_t when)
150+
_dispatch_time_nanoseconds_since_epoch(dispatch_time_t when)
151151
{
152152
if (when == DISPATCH_TIME_FOREVER) {
153153
return DISPATCH_TIME_FOREVER;
154154
}
155155
if ((int64_t)when < 0) {
156156
// time in nanoseconds since the POSIX epoch already
157-
return -(int64_t)when;
157+
return (uint64_t)-(int64_t)when;
158158
}
159159
return _dispatch_get_nanoseconds() + _dispatch_timeout(when);
160160
}

0 commit comments

Comments
 (0)