Warn unused (#139)
* add unused warning * comply with unused warning * add unused warning * comply with unused warning * remove wrongly modified files * consistent include style
This commit is contained in:
parent
d433ee193c
commit
6fbfb4ee07
8 changed files with 61 additions and 19 deletions
|
@ -22,18 +22,16 @@ extern "C"
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "rcutils/concat.h"
|
||||
#include <rcl/error_handling.h>
|
||||
#include <rcutils/concat.h>
|
||||
#include <rmw/validate_full_topic_name.h>
|
||||
#include <rosidl_generator_c/message_type_support_struct.h>
|
||||
#include <rosidl_generator_c/string_functions.h>
|
||||
|
||||
#include "lifecycle_msgs/msg/transition_event.h"
|
||||
|
||||
#include "rcl/error_handling.h"
|
||||
#include <lifecycle_msgs/msg/transition_event.h>
|
||||
|
||||
#include "rcl_lifecycle/data_types.h"
|
||||
|
||||
#include "rmw/validate_full_topic_name.h"
|
||||
|
||||
#include "rosidl_generator_c/message_type_support_struct.h"
|
||||
#include "rosidl_generator_c/string_functions.h"
|
||||
|
||||
static lifecycle_msgs__msg__TransitionEvent msg;
|
||||
static const char * pub_transition_event_suffix = "transition_event";
|
||||
|
|
|
@ -20,12 +20,15 @@ extern "C"
|
|||
{
|
||||
#endif
|
||||
|
||||
#include <rcl/macros.h>
|
||||
|
||||
#include "rcl_lifecycle/data_types.h"
|
||||
|
||||
rcl_lifecycle_com_interface_t
|
||||
rcl_lifecycle_get_zero_initialized_com_interface();
|
||||
|
||||
rcl_ret_t
|
||||
RCL_WARN_UNUSED
|
||||
rcl_lifecycle_com_interface_init(
|
||||
rcl_lifecycle_com_interface_t * com_interface,
|
||||
rcl_node_t * node_handle,
|
||||
|
@ -36,11 +39,13 @@ rcl_lifecycle_com_interface_init(
|
|||
const rosidl_service_type_support_t * ts_srv_get_available_transitions);
|
||||
|
||||
rcl_ret_t
|
||||
RCL_WARN_UNUSED
|
||||
rcl_lifecycle_com_interface_fini(
|
||||
rcl_lifecycle_com_interface_t * com_interface,
|
||||
rcl_node_t * node_handle);
|
||||
|
||||
rcl_ret_t
|
||||
RCL_WARN_UNUSED
|
||||
rcl_lifecycle_com_interface_publish_notification(
|
||||
rcl_lifecycle_com_interface_t * com_interface,
|
||||
const rcl_lifecycle_state_t * start, const rcl_lifecycle_state_t * goal);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#ifndef DEFAULT_STATE_MACHINE_H_
|
||||
#define DEFAULT_STATE_MACHINE_H_
|
||||
|
||||
#include <rcl/macros.h>
|
||||
#include <rcl/types.h>
|
||||
|
||||
#include "rcl_lifecycle/data_types.h"
|
||||
|
@ -26,6 +27,7 @@ extern "C"
|
|||
#endif
|
||||
|
||||
RCL_LIFECYCLE_PUBLIC
|
||||
RCL_WARN_UNUSED
|
||||
rcl_ret_t
|
||||
rcl_lifecycle_init_default_state_machine(rcl_lifecycle_state_machine_t * state_machine);
|
||||
|
||||
|
|
|
@ -165,8 +165,12 @@ rcl_lifecycle_trigger_transition(
|
|||
}
|
||||
state_machine->current_state = transition->goal;
|
||||
if (publish_notification) {
|
||||
rcl_lifecycle_com_interface_publish_notification(
|
||||
rcl_ret_t ret = rcl_lifecycle_com_interface_publish_notification(
|
||||
&state_machine->com_interface, transition->start, state_machine->current_state);
|
||||
if (ret != RCL_RET_OK) {
|
||||
RCL_SET_ERROR_MSG("Could not publish transition", rcl_get_default_allocator());
|
||||
return RCL_RET_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return RCL_RET_OK;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue