Use -Wpedantic (#306)
* add /W4 flag for windows * use uint8 like defined in messages: fix warning C4244 * fix sign size_t comparison * add only pedantic, not W4, deal with windows another day * another sign compare warning
This commit is contained in:
parent
ce146cfdba
commit
71f5b7fe5b
10 changed files with 45 additions and 43 deletions
|
@ -289,7 +289,7 @@ LifecycleNode::trigger_transition(const Transition & transition)
|
|||
}
|
||||
|
||||
const State &
|
||||
LifecycleNode::trigger_transition(unsigned int transition_id)
|
||||
LifecycleNode::trigger_transition(uint8_t transition_id)
|
||||
{
|
||||
return impl_->trigger_transition(transition_id);
|
||||
}
|
||||
|
|
|
@ -202,7 +202,7 @@ public:
|
|||
throw std::runtime_error(
|
||||
"Can't get available states. State machine is not initialized.");
|
||||
}
|
||||
for (unsigned int i = 0; i < state_machine_.transition_map.states_size; ++i) {
|
||||
for (uint8_t i = 0; i < state_machine_.transition_map.states_size; ++i) {
|
||||
lifecycle_msgs::msg::State state;
|
||||
state.id = static_cast<uint8_t>(state_machine_.transition_map.states[i].id);
|
||||
state.label = static_cast<std::string>(state_machine_.transition_map.states[i].label);
|
||||
|
@ -223,7 +223,7 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < state_machine_.transition_map.transitions_size; ++i) {
|
||||
for (uint8_t i = 0; i < state_machine_.transition_map.transitions_size; ++i) {
|
||||
rcl_lifecycle_transition_t & rcl_transition = state_machine_.transition_map.transitions[i];
|
||||
lifecycle_msgs::msg::TransitionDescription trans_desc;
|
||||
trans_desc.transition.id = rcl_transition.id;
|
||||
|
@ -247,7 +247,7 @@ public:
|
|||
get_available_states()
|
||||
{
|
||||
std::vector<State> states;
|
||||
for (unsigned int i = 0; i < state_machine_.transition_map.states_size; ++i) {
|
||||
for (uint8_t i = 0; i < state_machine_.transition_map.states_size; ++i) {
|
||||
State state(&state_machine_.transition_map.states[i]);
|
||||
states.push_back(state);
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ public:
|
|||
{
|
||||
std::vector<Transition> transitions;
|
||||
|
||||
for (unsigned int i = 0; i < state_machine_.transition_map.transitions_size; ++i) {
|
||||
for (uint8_t i = 0; i < state_machine_.transition_map.transitions_size; ++i) {
|
||||
Transition transition(
|
||||
&state_machine_.transition_map.transitions[i]);
|
||||
transitions.push_back(transition);
|
||||
|
@ -279,7 +279,7 @@ public:
|
|||
// keep the initial state to pass to a transition callback
|
||||
State initial_state(state_machine_.current_state);
|
||||
|
||||
unsigned int transition_id = static_cast<unsigned int>(lifecycle_transition);
|
||||
uint8_t transition_id = lifecycle_transition;
|
||||
if (rcl_lifecycle_trigger_transition(&state_machine_, transition_id, true) != RCL_RET_OK) {
|
||||
fprintf(stderr, "%s:%d, Unable to start transition %u from current state %s: %s\n",
|
||||
__FILE__, __LINE__, transition_id,
|
||||
|
@ -348,7 +348,7 @@ public:
|
|||
}
|
||||
|
||||
const State &
|
||||
trigger_transition(unsigned int transition_id)
|
||||
trigger_transition(uint8_t transition_id)
|
||||
{
|
||||
change_state(transition_id);
|
||||
return get_current_state();
|
||||
|
|
|
@ -26,7 +26,7 @@ State::State()
|
|||
: State(lifecycle_msgs::msg::State::PRIMARY_STATE_UNKNOWN, "unknown")
|
||||
{}
|
||||
|
||||
State::State(unsigned int id, const std::string & label)
|
||||
State::State(uint8_t id, const std::string & label)
|
||||
: owns_rcl_state_handle_(true)
|
||||
{
|
||||
if (label.empty()) {
|
||||
|
@ -53,7 +53,7 @@ State::~State()
|
|||
}
|
||||
}
|
||||
|
||||
unsigned int
|
||||
uint8_t
|
||||
State::id() const
|
||||
{
|
||||
return state_handle_->id;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
namespace rclcpp_lifecycle
|
||||
{
|
||||
|
||||
Transition::Transition(unsigned int id, const std::string & label)
|
||||
Transition::Transition(uint8_t id, const std::string & label)
|
||||
: owns_rcl_transition_handle_(true)
|
||||
{
|
||||
auto transition_handle = new rcl_lifecycle_transition_t;
|
||||
|
@ -35,7 +35,7 @@ Transition::Transition(unsigned int id, const std::string & label)
|
|||
}
|
||||
|
||||
Transition::Transition(
|
||||
unsigned int id, const std::string & label,
|
||||
uint8_t id, const std::string & label,
|
||||
State && start, State && goal)
|
||||
: owns_rcl_transition_handle_(true)
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ Transition::~Transition()
|
|||
}
|
||||
}
|
||||
|
||||
unsigned int
|
||||
uint8_t
|
||||
Transition::id() const
|
||||
{
|
||||
return transition_handle_->id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue