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:
Xiang Xiao
2020-01-02 10:49:34 -06:00
committed by Gregory Nutt
parent 316675f4db
commit 6a3c2aded6
1602 changed files with 6311 additions and 10874 deletions
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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. */
+2 -2
View File
@@ -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 */