Commit fc93cf0e authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Added a return statement in all the functions returning a value.

Removed some unused internal variables.
parent 13d62b4e
...@@ -503,8 +503,6 @@ class CModuleAction ...@@ -503,8 +503,6 @@ class CModuleAction
template<class action_ros> template<class action_ros>
CModuleAction<action_ros>::CModuleAction(const std::string &name,const std::string &name_space):nh(ros::this_node::getName()+"/"+name_space) CModuleAction<action_ros>::CModuleAction(const std::string &name,const std::string &name_space):nh(ros::this_node::getName()+"/"+name_space)
{ {
std::size_t position;
this->name=this->nh.getNamespace()+"/"+name; this->name=this->nh.getNamespace()+"/"+name;
this->status=ACTION_IDLE; this->status=ACTION_IDLE;
// retry control // retry control
......
...@@ -231,6 +231,7 @@ bool CModuleDynReconf::set_parameter(const std::string &name,bool value) ...@@ -231,6 +231,7 @@ bool CModuleDynReconf::set_parameter(const std::string &name,bool value)
case ACT_SRV_FAIL: ROS_ERROR_STREAM("CModuleDynReconf::set_parameters: Request failed on server: " << this->get_name()); case ACT_SRV_FAIL: ROS_ERROR_STREAM("CModuleDynReconf::set_parameters: Request failed on server: " << this->get_name());
return false; return false;
break; break;
default: return false;
} }
} }
...@@ -255,6 +256,7 @@ bool CModuleDynReconf::set_parameter(const std::string &name,int value) ...@@ -255,6 +256,7 @@ bool CModuleDynReconf::set_parameter(const std::string &name,int value)
case ACT_SRV_FAIL: ROS_ERROR_STREAM("CModuleDynReconf::set_parameters: Request failed on server: " << this->get_name()); case ACT_SRV_FAIL: ROS_ERROR_STREAM("CModuleDynReconf::set_parameters: Request failed on server: " << this->get_name());
return false; return false;
break; break;
default: return false;
} }
} }
...@@ -279,6 +281,7 @@ bool CModuleDynReconf::set_parameter(const std::string &name,std::string &value) ...@@ -279,6 +281,7 @@ bool CModuleDynReconf::set_parameter(const std::string &name,std::string &value)
case ACT_SRV_FAIL: ROS_ERROR_STREAM("CModuleDynReconf::set_parameters: Request failed on server: " << this->get_name()); case ACT_SRV_FAIL: ROS_ERROR_STREAM("CModuleDynReconf::set_parameters: Request failed on server: " << this->get_name());
return false; return false;
break; break;
default: return false;
} }
} }
...@@ -303,6 +306,7 @@ bool CModuleDynReconf::set_parameter(const std::string &name,double value) ...@@ -303,6 +306,7 @@ bool CModuleDynReconf::set_parameter(const std::string &name,double value)
case ACT_SRV_FAIL: ROS_ERROR_STREAM("CModuleDynReconf::set_parameters: Request failed on server: " << this->get_name()); case ACT_SRV_FAIL: ROS_ERROR_STREAM("CModuleDynReconf::set_parameters: Request failed on server: " << this->get_name());
return false; return false;
break; break;
default: return false;
} }
} }
......
...@@ -171,8 +171,6 @@ class CModuleService ...@@ -171,8 +171,6 @@ class CModuleService
template<class service_msg> template<class service_msg>
CModuleService<service_msg>::CModuleService(const std::string &name,const std::string &name_space):nh(ros::this_node::getName()+"/"+name_space) CModuleService<service_msg>::CModuleService(const std::string &name,const std::string &name_space):nh(ros::this_node::getName()+"/"+name_space)
{ {
std::size_t position;
this->current_num_retries=0; this->current_num_retries=0;
this->max_num_retries=DEFAULT_SERVICE_MAX_RETRIES; this->max_num_retries=DEFAULT_SERVICE_MAX_RETRIES;
this->service_client=this->nh.template serviceClient<service_msg>(name); this->service_client=this->nh.template serviceClient<service_msg>(name);
......
...@@ -44,6 +44,8 @@ bool CROSTimeout::timed_out(void) ...@@ -44,6 +44,8 @@ bool CROSTimeout::timed_out(void)
return false; return false;
} }
} }
else
return false;
} }
CROSTimeout::~CROSTimeout() CROSTimeout::~CROSTimeout()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment