We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1263986 commit 8ec297bCopy full SHA for 8ec297b
1 file changed
lightweightsemaphore.h
@@ -139,7 +139,7 @@ class Semaphore
139
{
140
mach_timespec_t ts;
141
ts.tv_sec = static_cast<unsigned int>(timeout_usecs / 1000000);
142
- ts.tv_nsec = (timeout_usecs % 1000000) * 1000;
+ ts.tv_nsec = static_cast<int>((timeout_usecs % 1000000) * 1000);
143
144
// added in OSX 10.10: https://developer.apple.com/library/prerelease/mac/documentation/General/Reference/APIDiffsMacOSX10_10SeedDiff/modules/Darwin.html
145
kern_return_t rc = semaphore_timedwait(m_sema, ts);
@@ -175,7 +175,7 @@ class Semaphore
175
Semaphore(int initialCount = 0)
176
177
assert(initialCount >= 0);
178
- int rc = sem_init(&m_sema, 0, initialCount);
+ int rc = sem_init(&m_sema, 0, static_cast<unsigned int>(initialCount));
179
assert(rc == 0);
180
(void)rc;
181
}
0 commit comments