Skip to content

Commit eb1925d

Browse files
committed
Fixed warnings in semaphore code as suggested in issue #108
1 parent 02ec690 commit eb1925d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

atomicops.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,11 +460,11 @@ namespace moodycamel
460460
return timed_wait(0);
461461
}
462462

463-
bool timed_wait(std::int64_t timeout_usecs) AE_NO_TSAN
463+
bool timed_wait(std::uint64_t timeout_usecs) AE_NO_TSAN
464464
{
465465
mach_timespec_t ts;
466466
ts.tv_sec = static_cast<unsigned int>(timeout_usecs / 1000000);
467-
ts.tv_nsec = (timeout_usecs % 1000000) * 1000;
467+
ts.tv_nsec = static_cast<int>((timeout_usecs % 1000000) * 1000);
468468

469469
// added in OSX 10.10: https://developer.apple.com/library/prerelease/mac/documentation/General/Reference/APIDiffsMacOSX10_10SeedDiff/modules/Darwin.html
470470
kern_return_t rc = semaphore_timedwait(m_sema, ts);
@@ -500,7 +500,7 @@ namespace moodycamel
500500
AE_NO_TSAN Semaphore(int initialCount = 0)
501501
{
502502
assert(initialCount >= 0);
503-
int rc = sem_init(&m_sema, 0, initialCount);
503+
int rc = sem_init(&m_sema, 0, static_cast<unsigned int>(initialCount));
504504
assert(rc == 0);
505505
AE_UNUSED(rc);
506506
}

0 commit comments

Comments
 (0)