Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change naming style for private functions #597

Merged
merged 2 commits into from
Apr 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions rcl/src/rcl/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ typedef struct rcl_ros_clock_storage_t
} rcl_ros_clock_storage_t;

// Implementation only
rcl_ret_t
static rcl_ret_t
rcl_get_steady_time(void * data, rcl_time_point_value_t * current_time)
{
(void)data; // unused
return rcutils_steady_time_now(current_time);
}

// Implementation only
rcl_ret_t
static rcl_ret_t
rcl_get_system_time(void * data, rcl_time_point_value_t * current_time)
{
(void)data; // unused
return rcutils_system_time_now(current_time);
}

// Internal method for zeroing values on init, assumes clock is valid
void
static void
rcl_init_generic_clock(rcl_clock_t * clock)
{
clock->type = RCL_CLOCK_UNINITIALIZED;
Expand All @@ -59,7 +59,7 @@ rcl_init_generic_clock(rcl_clock_t * clock)

// The function used to get the current ros time.
// This is in the implementation only
rcl_ret_t
static rcl_ret_t
rcl_get_ros_time(void * data, rcl_time_point_value_t * current_time)
{
rcl_ros_clock_storage_t * t = (rcl_ros_clock_storage_t *)data;
Expand Down Expand Up @@ -104,8 +104,8 @@ rcl_clock_init(
}
}

void
_rcl_clock_generic_fini(
static void
rcl_clock_generic_fini(
rcl_clock_t * clock)
{
// Internal function; assume caller has already checked that clock is valid.
Expand Down Expand Up @@ -165,7 +165,7 @@ rcl_ros_clock_fini(
RCL_SET_ERROR_MSG("clock not of type RCL_ROS_TIME");
return RCL_RET_ERROR;
}
_rcl_clock_generic_fini(clock);
rcl_clock_generic_fini(clock);
if (!clock->data) {
RCL_SET_ERROR_MSG("clock data invalid");
return RCL_RET_ERROR;
Expand Down Expand Up @@ -197,7 +197,7 @@ rcl_steady_clock_fini(
RCL_SET_ERROR_MSG("clock not of type RCL_STEADY_TIME");
return RCL_RET_ERROR;
}
_rcl_clock_generic_fini(clock);
rcl_clock_generic_fini(clock);
return RCL_RET_OK;
}

Expand All @@ -224,7 +224,7 @@ rcl_system_clock_fini(
RCL_SET_ERROR_MSG("clock not of type RCL_SYSTEM_TIME");
return RCL_RET_ERROR;
}
_rcl_clock_generic_fini(clock);
rcl_clock_generic_fini(clock);
return RCL_RET_OK;
}

Expand Down Expand Up @@ -257,8 +257,8 @@ rcl_clock_get_now(rcl_clock_t * clock, rcl_time_point_value_t * time_point_value
return RCL_RET_ERROR;
}

void
_rcl_clock_call_callbacks(
static void
rcl_clock_call_callbacks(
rcl_clock_t * clock, const rcl_time_jump_t * time_jump, bool before_jump)
{
// Internal function; assume parameters are valid.
Expand Down Expand Up @@ -295,9 +295,9 @@ rcl_enable_ros_time_override(rcl_clock_t * clock)
rcl_time_jump_t time_jump;
time_jump.delta.nanoseconds = 0;
time_jump.clock_change = RCL_ROS_TIME_ACTIVATED;
_rcl_clock_call_callbacks(clock, &time_jump, true);
rcl_clock_call_callbacks(clock, &time_jump, true);
storage->active = true;
_rcl_clock_call_callbacks(clock, &time_jump, false);
rcl_clock_call_callbacks(clock, &time_jump, false);
}
return RCL_RET_OK;
}
Expand All @@ -320,9 +320,9 @@ rcl_disable_ros_time_override(rcl_clock_t * clock)
rcl_time_jump_t time_jump;
time_jump.delta.nanoseconds = 0;
time_jump.clock_change = RCL_ROS_TIME_DEACTIVATED;
_rcl_clock_call_callbacks(clock, &time_jump, true);
rcl_clock_call_callbacks(clock, &time_jump, true);
storage->active = false;
_rcl_clock_call_callbacks(clock, &time_jump, false);
rcl_clock_call_callbacks(clock, &time_jump, false);
}
return RCL_RET_OK;
}
Expand Down Expand Up @@ -368,11 +368,11 @@ rcl_set_ros_time_override(
return ret;
}
time_jump.delta.nanoseconds = time_value - current_time;
_rcl_clock_call_callbacks(clock, &time_jump, true);
rcl_clock_call_callbacks(clock, &time_jump, true);
}
rcutils_atomic_store(&(storage->current_time), time_value);
if (storage->active) {
_rcl_clock_call_callbacks(clock, &time_jump, false);
rcl_clock_call_callbacks(clock, &time_jump, false);
}
return RCL_RET_OK;
}
Expand Down