[rtems commit] rtems: Adjust parameter names

Sebastian Huber sebh at rtems.org
Thu Sep 30 05:27:40 UTC 2021


Module:    rtems
Branch:    master
Commit:    dde74af944553de87c18fe1f4973e4899193dd3b
Changeset: http://git.rtems.org/rtems/commit/?id=dde74af944553de87c18fe1f4973e4899193dd3b

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Sep 29 16:10:03 2021 +0200

rtems: Adjust parameter names

Adjust parameter names to match with the declaration.  This avoid using
a name reserved by the C standard: "time".

Close #4035.

---

 cpukit/rtems/src/clockgettod.c        | 20 ++++++++++----------
 cpukit/rtems/src/clockgettodtimeval.c |  6 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/cpukit/rtems/src/clockgettod.c b/cpukit/rtems/src/clockgettod.c
index 01daa3d..fed9057 100644
--- a/cpukit/rtems/src/clockgettod.c
+++ b/cpukit/rtems/src/clockgettod.c
@@ -81,7 +81,7 @@ static uint32_t _Year_day_as_month(
 }
 
 rtems_status_code rtems_clock_get_tod(
-  rtems_time_of_day  *time_buffer
+  rtems_time_of_day  *time_of_day
 )
 {
   struct timeval now;
@@ -91,7 +91,7 @@ rtems_status_code rtems_clock_get_tod(
   uint32_t       year_days;
   uint32_t       leap_years;
 
-  if ( !time_buffer )
+  if ( !time_of_day )
     return RTEMS_INVALID_ADDRESS;
 
   if ( !_TOD_Is_set() )
@@ -126,14 +126,14 @@ rtems_status_code rtems_clock_get_tod(
     }
   }
 
-  time_buffer->year   = year;
-  time_buffer->month  = _Year_day_as_month( year, &year_days ) + 1;
-  time_buffer->day    = year_days + 1;
-  time_buffer->hour   = day_secs / RTEMS_SECS_PER_HOUR;
-  time_buffer->minute = day_secs % RTEMS_SECS_PER_HOUR;
-  time_buffer->second = time_buffer->minute % RTEMS_SECS_PER_MINUTE;
-  time_buffer->minute = time_buffer->minute / RTEMS_SECS_PER_MINUTE;
-  time_buffer->ticks  = now.tv_usec /
+  time_of_day->year   = year;
+  time_of_day->month  = _Year_day_as_month( year, &year_days ) + 1;
+  time_of_day->day    = year_days + 1;
+  time_of_day->hour   = day_secs / RTEMS_SECS_PER_HOUR;
+  time_of_day->minute = day_secs % RTEMS_SECS_PER_HOUR;
+  time_of_day->second = time_of_day->minute % RTEMS_SECS_PER_MINUTE;
+  time_of_day->minute = time_of_day->minute / RTEMS_SECS_PER_MINUTE;
+  time_of_day->ticks  = now.tv_usec /
     rtems_configuration_get_microseconds_per_tick( );
 
   return RTEMS_SUCCESSFUL;
diff --git a/cpukit/rtems/src/clockgettodtimeval.c b/cpukit/rtems/src/clockgettodtimeval.c
index bf3847a..a8d89c6 100644
--- a/cpukit/rtems/src/clockgettodtimeval.c
+++ b/cpukit/rtems/src/clockgettodtimeval.c
@@ -24,16 +24,16 @@
 #include <rtems/score/todimpl.h>
 
 rtems_status_code rtems_clock_get_tod_timeval(
-  struct timeval  *time
+  struct timeval  *time_of_day
 )
 {
-  if ( !time )
+  if ( !time_of_day )
     return RTEMS_INVALID_ADDRESS;
 
   if ( !_TOD_Is_set() )
     return RTEMS_NOT_DEFINED;
 
-  _TOD_Get_timeval( time );
+  _TOD_Get_timeval( time_of_day );
 
   return RTEMS_SUCCESSFUL;
 }



More information about the vc mailing list