Overview
Comment: | Remove remaining uses of lrint()
It was used to convert a time interval into seconds and microseconds or |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
e702135e17e116c2ee57b6eff96b7ef9 |
User & Date: | js on 2019-09-01 16:53:45 |
Other Links: | manifest | tags |
Context
2019-09-01
| ||
18:22 | Add +[OFThread isMainThread] check-in: 8a2fa8eff4 user: js tags: trunk | |
16:53 | Remove remaining uses of lrint() check-in: e702135e17 user: js tags: trunk | |
15:29 | OFThread: Allow specifying a name before starting check-in: 77780c7596 user: js tags: trunk | |
Changes
Modified src/OFKqueueKernelEventObserver.m from [436780f050] to [9e8a185a40].
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - | * file. */ #include "config.h" #include <assert.h> #include <errno.h> |
︙ | |||
161 162 163 164 165 166 167 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | - + | [self of_processQueue]; if ([self of_processReadBuffers]) return; timeout.tv_sec = (time_t)timeInterval; |
︙ |
Modified src/OFSelectKernelEventObserver.m from [fa45b767a1] to [6eb8060c59].
︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | - | #ifdef OF_WINDOWS /* Win32 has a ridiculous default of 64, even though it supports much more. */ # define FD_SETSIZE 1024 #endif #include <errno.h> |
︙ | |||
176 177 178 179 180 181 182 | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | - + | * satisfy the required range, we just cast to int. */ #ifndef OF_WINDOWS timeout.tv_sec = (time_t)timeInterval; #else timeout.tv_sec = (long)timeInterval; #endif |
︙ |
Modified src/OFThread.m from [67276b0c18] to [590ace3cab].
︙ | |||
82 83 84 85 86 87 88 | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | - - - - | # import "OFThreadStillRunningException.h" #endif #ifdef OF_HAVE_ATOMIC_OPS # import "atomic.h" #endif |
︙ | |||
246 247 248 249 250 251 252 | 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | - + | @throw [OFOutOfRangeException exception]; svcSleepThread((int64_t)(timeInterval * 1000000000)); #elif defined(HAVE_NANOSLEEP) struct timespec rqtp; rqtp.tv_sec = (time_t)timeInterval; |
︙ | |||
271 272 273 274 275 276 277 | 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | - - + + | while (counter--) swiWaitForVBlank(); #else if (timeInterval > UINT_MAX) @throw [OFOutOfRangeException exception]; sleep((unsigned int)timeInterval); |
︙ |
Modified src/condition_pthread.m from [953df43013] to [1c18f916fb].
︙ | |||
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - | * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ |
︙ | |||
44 45 46 47 48 49 50 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | - + | bool of_condition_timed_wait(of_condition_t *condition, of_mutex_t *mutex, of_time_interval_t timeout) { struct timespec ts; ts.tv_sec = (time_t)timeout; |