Skip to content

Commit 8ec297b

Browse files
committed
Fixed warnings in semaphore code (following similar commit in readerwriterqueue)
1 parent 1263986 commit 8ec297b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lightweightsemaphore.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class Semaphore
139139
{
140140
mach_timespec_t ts;
141141
ts.tv_sec = static_cast<unsigned int>(timeout_usecs / 1000000);
142-
ts.tv_nsec = (timeout_usecs % 1000000) * 1000;
142+
ts.tv_nsec = static_cast<int>((timeout_usecs % 1000000) * 1000);
143143

144144
// added in OSX 10.10: https://developer.apple.com/library/prerelease/mac/documentation/General/Reference/APIDiffsMacOSX10_10SeedDiff/modules/Darwin.html
145145
kern_return_t rc = semaphore_timedwait(m_sema, ts);
@@ -175,7 +175,7 @@ class Semaphore
175175
Semaphore(int initialCount = 0)
176176
{
177177
assert(initialCount >= 0);
178-
int rc = sem_init(&m_sema, 0, initialCount);
178+
int rc = sem_init(&m_sema, 0, static_cast<unsigned int>(initialCount));
179179
assert(rc == 0);
180180
(void)rc;
181181
}

0 commit comments

Comments
 (0)