mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling 1. Add semaphore uninterruptible wait function 2 .Replace semaphore wait loop with a single uninterruptible wait 3. Replace all sem_xxx to nxsem_xxx * Unify the void cast usage 1. Remove void cast for function because many place ignore the returned value witout cast 2. Replace void cast for variable with UNUSED macro
This commit is contained in:
@@ -185,7 +185,7 @@ static void clock_inittime(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
(void)clock_ticks2time((sclock_t)g_system_timer, &ts);
|
||||
clock_ticks2time((sclock_t)g_system_timer, &ts);
|
||||
|
||||
/* Adjust base time to hide initial timer ticks. */
|
||||
|
||||
@@ -336,7 +336,7 @@ void clock_resynchronize(FAR struct timespec *rtc_diff)
|
||||
* bias value that we need to use to correct the base time.
|
||||
*/
|
||||
|
||||
(void)clock_systimespec(&bias);
|
||||
clock_systimespec(&bias);
|
||||
|
||||
/* Add the base time to this. The base time is the time-of-day
|
||||
* setting. When added to the elapsed time since the time-of-day
|
||||
|
||||
@@ -91,7 +91,7 @@ int clock_settime(clockid_t clock_id, FAR const struct timespec *tp)
|
||||
* bias value that we need to use to correct the base time.
|
||||
*/
|
||||
|
||||
(void)clock_systimespec(&bias);
|
||||
clock_systimespec(&bias);
|
||||
|
||||
/* Save the new base time. */
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ clock_t clock_systimer(void)
|
||||
|
||||
/* Get the time from the platform specific hardware */
|
||||
|
||||
(void)clock_systimespec(&ts);
|
||||
clock_systimespec(&ts);
|
||||
|
||||
/* Convert to a 64-bit value in microseconds, then in clock tick units */
|
||||
|
||||
@@ -110,7 +110,7 @@ clock_t clock_systimer(void)
|
||||
|
||||
/* Get the time from the platform specific hardware */
|
||||
|
||||
(void)clock_systimespec(&ts);
|
||||
clock_systimespec(&ts);
|
||||
|
||||
/* Convert to a 64- then a 32-bit value */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user