Skip to content

Commit

Permalink
Added -Wconversion flag and fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gwalck committed Jun 12, 2023
1 parent d299208 commit cf6ab33
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion controller_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16)
project(controller_interface LANGUAGES CXX)

if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wall -Wextra)
add_compile_options(-Wall -Wextra -Wconversion)
endif()

set(THIS_PACKAGE_INCLUDE_DEPENDS
Expand Down
2 changes: 1 addition & 1 deletion controller_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16)
project(controller_manager LANGUAGES CXX)

if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wall -Wextra)
add_compile_options(-Wall -Wextra -Wconversion)
endif()

set(THIS_PACKAGE_INCLUDE_DEPENDS
Expand Down
2 changes: 1 addition & 1 deletion hardware_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16)
project(hardware_interface LANGUAGES CXX)

if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wall -Wextra)
add_compile_options(-Wall -Wextra -Wconversion)
endif()

set(THIS_PACKAGE_INCLUDE_DEPENDS
Expand Down
4 changes: 2 additions & 2 deletions hardware_interface/src/component_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ ComponentInfo parse_complex_component_from_xml(const tinyxml2::XMLElement * comp
component.command_interfaces.push_back(parse_interfaces_from_xml(command_interfaces_it));
component.command_interfaces.back().data_type =
parse_data_type_attribute(command_interfaces_it);
component.command_interfaces.back().size = parse_size_attribute(command_interfaces_it);
component.command_interfaces.back().size = static_cast<int>(parse_size_attribute(command_interfaces_it));
command_interfaces_it = command_interfaces_it->NextSiblingElement(kCommandInterfaceTag);
}

Expand All @@ -377,7 +377,7 @@ ComponentInfo parse_complex_component_from_xml(const tinyxml2::XMLElement * comp
{
component.state_interfaces.push_back(parse_interfaces_from_xml(state_interfaces_it));
component.state_interfaces.back().data_type = parse_data_type_attribute(state_interfaces_it);
component.state_interfaces.back().size = parse_size_attribute(state_interfaces_it);
component.state_interfaces.back().size = static_cast<int>(parse_size_attribute(state_interfaces_it));
state_interfaces_it = state_interfaces_it->NextSiblingElement(kStateInterfaceTag);
}

Expand Down
2 changes: 1 addition & 1 deletion joint_limits/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16)
project(joint_limits LANGUAGES CXX)

if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wall -Wextra)
add_compile_options(-Wall -Wextra -Wconversion)
endif()

set(THIS_PACKAGE_INCLUDE_DEPENDS
Expand Down
2 changes: 1 addition & 1 deletion transmission_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16)
project(transmission_interface LANGUAGES CXX)

if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wall -Wextra -Wpedantic)
add_compile_options(-Wall -Wextra -Wpedantic -Wconversion)
endif()

set(THIS_PACKAGE_INCLUDE_DEPENDS
Expand Down
2 changes: 1 addition & 1 deletion transmission_interface/test/random_generator_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct RandomDoubleGenerator
public:
RandomDoubleGenerator(double min_val, double max_val) : min_val_(min_val), max_val_(max_val)
{
srand(time(nullptr));
srand(static_cast<unsigned int>(time(nullptr)));
}
double operator()()
{
Expand Down

0 comments on commit cf6ab33

Please sign in to comment.