Skip to content

Commit a4101d1

Browse files
committed
Change naming style for private functions (#597)
* Add prefix "_" underscore missing in private functions Signed-off-by: Jorge Perez <[email protected]> * Change style for functions internal to module Removed underscores Added static keyword Signed-off-by: Jorge Perez <[email protected]>
1 parent bbbeb8f commit a4101d1

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

rcl/src/rcl/time.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,23 @@ typedef struct rcl_ros_clock_storage_t
3131
} rcl_ros_clock_storage_t;
3232

3333
// Implementation only
34-
rcl_ret_t
34+
static rcl_ret_t
3535
rcl_get_steady_time(void * data, rcl_time_point_value_t * current_time)
3636
{
3737
(void)data; // unused
3838
return rcutils_steady_time_now(current_time);
3939
}
4040

4141
// Implementation only
42-
rcl_ret_t
42+
static rcl_ret_t
4343
rcl_get_system_time(void * data, rcl_time_point_value_t * current_time)
4444
{
4545
(void)data; // unused
4646
return rcutils_system_time_now(current_time);
4747
}
4848

4949
// Internal method for zeroing values on init, assumes clock is valid
50-
void
50+
static void
5151
rcl_init_generic_clock(rcl_clock_t * clock)
5252
{
5353
clock->type = RCL_CLOCK_UNINITIALIZED;
@@ -59,7 +59,7 @@ rcl_init_generic_clock(rcl_clock_t * clock)
5959

6060
// The function used to get the current ros time.
6161
// This is in the implementation only
62-
rcl_ret_t
62+
static rcl_ret_t
6363
rcl_get_ros_time(void * data, rcl_time_point_value_t * current_time)
6464
{
6565
rcl_ros_clock_storage_t * t = (rcl_ros_clock_storage_t *)data;
@@ -104,8 +104,8 @@ rcl_clock_init(
104104
}
105105
}
106106

107-
void
108-
_rcl_clock_generic_fini(
107+
static void
108+
rcl_clock_generic_fini(
109109
rcl_clock_t * clock)
110110
{
111111
// Internal function; assume caller has already checked that clock is valid.
@@ -165,7 +165,7 @@ rcl_ros_clock_fini(
165165
RCL_SET_ERROR_MSG("clock not of type RCL_ROS_TIME");
166166
return RCL_RET_ERROR;
167167
}
168-
_rcl_clock_generic_fini(clock);
168+
rcl_clock_generic_fini(clock);
169169
if (!clock->data) {
170170
RCL_SET_ERROR_MSG("clock data invalid");
171171
return RCL_RET_ERROR;
@@ -197,7 +197,7 @@ rcl_steady_clock_fini(
197197
RCL_SET_ERROR_MSG("clock not of type RCL_STEADY_TIME");
198198
return RCL_RET_ERROR;
199199
}
200-
_rcl_clock_generic_fini(clock);
200+
rcl_clock_generic_fini(clock);
201201
return RCL_RET_OK;
202202
}
203203

@@ -224,7 +224,7 @@ rcl_system_clock_fini(
224224
RCL_SET_ERROR_MSG("clock not of type RCL_SYSTEM_TIME");
225225
return RCL_RET_ERROR;
226226
}
227-
_rcl_clock_generic_fini(clock);
227+
rcl_clock_generic_fini(clock);
228228
return RCL_RET_OK;
229229
}
230230

@@ -260,8 +260,8 @@ rcl_clock_get_now(rcl_clock_t * clock, rcl_time_point_value_t * time_point_value
260260
return RCL_RET_ERROR;
261261
}
262262

263-
void
264-
_rcl_clock_call_callbacks(
263+
static void
264+
rcl_clock_call_callbacks(
265265
rcl_clock_t * clock, const rcl_time_jump_t * time_jump, bool before_jump)
266266
{
267267
// Internal function; assume parameters are valid.
@@ -298,9 +298,9 @@ rcl_enable_ros_time_override(rcl_clock_t * clock)
298298
rcl_time_jump_t time_jump;
299299
time_jump.delta.nanoseconds = 0;
300300
time_jump.clock_change = RCL_ROS_TIME_ACTIVATED;
301-
_rcl_clock_call_callbacks(clock, &time_jump, true);
301+
rcl_clock_call_callbacks(clock, &time_jump, true);
302302
storage->active = true;
303-
_rcl_clock_call_callbacks(clock, &time_jump, false);
303+
rcl_clock_call_callbacks(clock, &time_jump, false);
304304
}
305305
return RCL_RET_OK;
306306
}
@@ -323,9 +323,9 @@ rcl_disable_ros_time_override(rcl_clock_t * clock)
323323
rcl_time_jump_t time_jump;
324324
time_jump.delta.nanoseconds = 0;
325325
time_jump.clock_change = RCL_ROS_TIME_DEACTIVATED;
326-
_rcl_clock_call_callbacks(clock, &time_jump, true);
326+
rcl_clock_call_callbacks(clock, &time_jump, true);
327327
storage->active = false;
328-
_rcl_clock_call_callbacks(clock, &time_jump, false);
328+
rcl_clock_call_callbacks(clock, &time_jump, false);
329329
}
330330
return RCL_RET_OK;
331331
}
@@ -371,11 +371,11 @@ rcl_set_ros_time_override(
371371
return ret;
372372
}
373373
time_jump.delta.nanoseconds = time_value - current_time;
374-
_rcl_clock_call_callbacks(clock, &time_jump, true);
374+
rcl_clock_call_callbacks(clock, &time_jump, true);
375375
}
376376
rcutils_atomic_store(&(storage->current_time), time_value);
377377
if (storage->active) {
378-
_rcl_clock_call_callbacks(clock, &time_jump, false);
378+
rcl_clock_call_callbacks(clock, &time_jump, false);
379379
}
380380
return RCL_RET_OK;
381381
}

0 commit comments

Comments
 (0)