Skip to content
Snippets Groups Projects
Commit e452aef3 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Merge branch 'wolf_unused' into 'master'

fix gcc 5+ compilation -Werror=unused-variable

See merge request !124
parents 0d2951b9 37f7f76d
No related branches found
No related tags found
1 merge request!124fix gcc 5+ compilation -Werror=unused-variable
...@@ -355,10 +355,28 @@ inline std::string FrameFactory::getClass() ...@@ -355,10 +355,28 @@ inline std::string FrameFactory::getClass()
{ {
return "FrameFactory"; return "FrameFactory";
} }
//#define UNUSED(x) (void)x;
//#define UNUSED(x) (void)(sizeof((x), 0));
#ifdef __GNUC__
#define WOLF_UNUSED __attribute__((used))
#elif defined _MSC_VER
#pragma warning(disable: Cxxxxx)
#define WOLF_UNUSED
#elif defined(__LCLINT__)
# define WOLF_UNUSED /*@unused@*/
#elif defined(__cplusplus)
# define WOLF_UNUSED
#else
# define UNUSED(x) x
#endif
#define WOLF_REGISTER_FRAME(FrameType, FrameName) \ #define WOLF_REGISTER_FRAME(FrameType, FrameName) \
namespace{ const bool FrameName##Registered = \ namespace{ const bool WOLF_UNUSED FrameName##Registered = \
FrameFactory::get().registerCreator(FrameType, FrameName::create); }\ FrameFactory::get().registerCreator(FrameType, FrameName::create); }\
} /* namespace wolf */ } /* namespace wolf */
#endif /* FACTORY_H_ */ #endif /* FACTORY_H_ */
...@@ -301,7 +301,7 @@ FrameBasePtr FrameBase::create_POV_3D(const FrameType & _tp, ...@@ -301,7 +301,7 @@ FrameBasePtr FrameBase::create_POV_3D(const FrameType & _tp,
#include "factory.h" #include "factory.h"
namespace wolf namespace wolf
{ {
namespace{ const bool Frame_PO_2D_Registered = FrameFactory::get().registerCreator("PO 2D", FrameBase::create_PO_2D ); } namespace{ const bool WOLF_UNUSED Frame_PO_2D_Registered = FrameFactory::get().registerCreator("PO 2D", FrameBase::create_PO_2D ); }
namespace{ const bool Frame_PO_3D_Registered = FrameFactory::get().registerCreator("PO 3D", FrameBase::create_PO_3D ); } namespace{ const bool WOLF_UNUSED Frame_PO_3D_Registered = FrameFactory::get().registerCreator("PO 3D", FrameBase::create_PO_3D ); }
namespace{ const bool Frame_POV_3D_Registered = FrameFactory::get().registerCreator("POV 3D", FrameBase::create_POV_3D); } namespace{ const bool WOLF_UNUSED Frame_POV_3D_Registered = FrameFactory::get().registerCreator("POV 3D", FrameBase::create_POV_3D); }
} // namespace wolf } // namespace wolf
...@@ -43,5 +43,5 @@ FrameBasePtr FrameIMU::create(const FrameType & _tp, ...@@ -43,5 +43,5 @@ FrameBasePtr FrameIMU::create(const FrameType & _tp,
namespace wolf namespace wolf
{ {
WOLF_REGISTER_FRAME("IMU", FrameIMU); WOLF_REGISTER_FRAME("IMU", FrameIMU);
namespace{ const bool Frame_PQVBB_3D_Registered = FrameFactory::get().registerCreator("PQVBB 3D", FrameIMU::create); } // alternate name possible namespace{ const bool WOLF_UNUSED Frame_PQVBB_3D_Registered = FrameFactory::get().registerCreator("PQVBB 3D", FrameIMU::create); } // alternate name possible
} // namespace wolf } // namespace wolf
...@@ -386,7 +386,7 @@ YAML::Node LandmarkPolyline2D::saveToYaml() const ...@@ -386,7 +386,7 @@ YAML::Node LandmarkPolyline2D::saveToYaml() const
// Register landmark creator // Register landmark creator
namespace namespace
{ {
const bool registered_lmk_polyline_2D = LandmarkFactory::get().registerCreator("POLYLINE 2D", LandmarkPolyline2D::create); const bool WOLF_UNUSED registered_lmk_polyline_2D = LandmarkFactory::get().registerCreator("POLYLINE 2D", LandmarkPolyline2D::create);
} }
} /* namespace wolf */ } /* namespace wolf */
...@@ -177,7 +177,7 @@ inline std::string ProcessorFactory::getClass() ...@@ -177,7 +177,7 @@ inline std::string ProcessorFactory::getClass()
#define WOLF_REGISTER_PROCESSOR(ProcessorType, ProcessorName) \ #define WOLF_REGISTER_PROCESSOR(ProcessorType, ProcessorName) \
namespace{ const bool ProcessorName##Registered = \ namespace{ const bool WOLF_UNUSED ProcessorName##Registered = \
ProcessorFactory::get().registerCreator(ProcessorType, ProcessorName::create); }\ ProcessorFactory::get().registerCreator(ProcessorType, ProcessorName::create); }\
} /* namespace wolf */ } /* namespace wolf */
......
...@@ -219,7 +219,7 @@ inline std::string SensorFactory::getClass() ...@@ -219,7 +219,7 @@ inline std::string SensorFactory::getClass()
} }
#define WOLF_REGISTER_SENSOR(SensorType, SensorName) \ #define WOLF_REGISTER_SENSOR(SensorType, SensorName) \
namespace{ const bool SensorName##Registered = \ namespace{ const bool WOLF_UNUSED SensorName##Registered = \
SensorFactory::get().registerCreator(SensorType, SensorName::create); }\ SensorFactory::get().registerCreator(SensorType, SensorName::create); }\
} /* namespace wolf */ } /* namespace wolf */
......
...@@ -84,8 +84,8 @@ static ProcessorParamsBasePtr createProcessorParamsImage(const std::string & _fi ...@@ -84,8 +84,8 @@ static ProcessorParamsBasePtr createProcessorParamsImage(const std::string & _fi
} }
// Register in the SensorFactory // Register in the SensorFactory
const bool registered_prc_image_feature_par = ProcessorParamsFactory::get().registerCreator("IMAGE FEATURE", createProcessorParamsImage); const bool WOLF_UNUSED registered_prc_image_feature_par = ProcessorParamsFactory::get().registerCreator("IMAGE FEATURE", createProcessorParamsImage);
const bool registered_prc_image_landmark_par = ProcessorParamsFactory::get().registerCreator("IMAGE LANDMARK", createProcessorParamsImage); const bool WOLF_UNUSED registered_prc_image_landmark_par = ProcessorParamsFactory::get().registerCreator("IMAGE LANDMARK", createProcessorParamsImage);
} }
......
...@@ -52,7 +52,7 @@ static ProcessorParamsBasePtr createProcessorIMUParams(const std::string & _file ...@@ -52,7 +52,7 @@ static ProcessorParamsBasePtr createProcessorIMUParams(const std::string & _file
} }
// Register in the SensorFactory // Register in the SensorFactory
const bool registered_prc_odom_3D = ProcessorParamsFactory::get().registerCreator("IMU", createProcessorIMUParams); const bool WOLF_UNUSED registered_prc_odom_3D = ProcessorParamsFactory::get().registerCreator("IMU", createProcessorIMUParams);
} // namespace [unnamed] } // namespace [unnamed]
......
...@@ -51,7 +51,7 @@ static ProcessorParamsBasePtr createProcessorOdom3DParams(const std::string & _f ...@@ -51,7 +51,7 @@ static ProcessorParamsBasePtr createProcessorOdom3DParams(const std::string & _f
} }
// Register in the SensorFactory // Register in the SensorFactory
const bool registered_prc_odom_3D = ProcessorParamsFactory::get().registerCreator("ODOM 3D", createProcessorOdom3DParams); const bool WOLF_UNUSED registered_prc_odom_3D = ProcessorParamsFactory::get().registerCreator("ODOM 3D", createProcessorOdom3DParams);
} // namespace [unnamed] } // namespace [unnamed]
......
...@@ -91,7 +91,7 @@ static IntrinsicsBasePtr createIntrinsicsCamera(const std::string & _filename_do ...@@ -91,7 +91,7 @@ static IntrinsicsBasePtr createIntrinsicsCamera(const std::string & _filename_do
} }
// Register in the SensorFactory // Register in the SensorFactory
const bool registered_camera_intr = IntrinsicsFactory::get().registerCreator("CAMERA", createIntrinsicsCamera); const bool WOLF_UNUSED registered_camera_intr = IntrinsicsFactory::get().registerCreator("CAMERA", createIntrinsicsCamera);
} // namespace [unnamed] } // namespace [unnamed]
......
...@@ -53,7 +53,7 @@ static IntrinsicsBasePtr createIntrinsicsIMU(const std::string & _filename_dot_y ...@@ -53,7 +53,7 @@ static IntrinsicsBasePtr createIntrinsicsIMU(const std::string & _filename_dot_y
} }
// Register in the SensorFactory // Register in the SensorFactory
const bool registered_imu_intr = IntrinsicsFactory::get().registerCreator("IMU", createIntrinsicsIMU); const bool WOLF_UNUSED registered_imu_intr = IntrinsicsFactory::get().registerCreator("IMU", createIntrinsicsIMU);
} // namespace [unnamed] } // namespace [unnamed]
......
...@@ -31,7 +31,7 @@ IntrinsicsBasePtr createIntrinsicsLaser2D(const std::string& _filename_dot_yaml) ...@@ -31,7 +31,7 @@ IntrinsicsBasePtr createIntrinsicsLaser2D(const std::string& _filename_dot_yaml)
// register into factory // register into factory
const bool registered_laser_params = IntrinsicsFactory::get().registerCreator("LASER 2D", createIntrinsicsLaser2D); const bool WOLF_UNUSED registered_laser_params = IntrinsicsFactory::get().registerCreator("LASER 2D", createIntrinsicsLaser2D);
} // namespace [void] } // namespace [void]
} // namespace wolf } // namespace wolf
...@@ -51,7 +51,7 @@ static IntrinsicsBasePtr createIntrinsicsOdom3D(const std::string & _filename_do ...@@ -51,7 +51,7 @@ static IntrinsicsBasePtr createIntrinsicsOdom3D(const std::string & _filename_do
} }
// Register in the SensorFactory // Register in the SensorFactory
const bool registered_odom_3D_intr = IntrinsicsFactory::get().registerCreator("ODOM 3D", createIntrinsicsOdom3D); const bool WOLF_UNUSED registered_odom_3D_intr = IntrinsicsFactory::get().registerCreator("ODOM 3D", createIntrinsicsOdom3D);
} // namespace [unnamed] } // namespace [unnamed]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment