Skip to content

Commit

Permalink
Merge pull request #1422 from fspindle/fix_quality_12
Browse files Browse the repository at this point in the history
Fix quality 12 misra
  • Loading branch information
fspindle authored Jun 26, 2024
2 parents 737fbb3 + f1b79a1 commit 833f8b5
Show file tree
Hide file tree
Showing 378 changed files with 21,488 additions and 17,834 deletions.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@
"primitiveset": "cpp",
"stateattribute": "cpp",
"uniform": "cpp",
"polytope": "cpp"
"polytope": "cpp",
"core": "cpp",
"dense": "cpp",
"stdvector": "cpp",
"numericaldiff": "cpp"
},
"C_Cpp.vcFormat.indent.namespaceContents": false,
"editor.formatOnSave": true,
Expand Down
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,8 @@ VP_OPTION(ENABLE_FULL_DOC "" "" "Build doc with internal classes that are b

# Allow introduction of "visp" namespace. By default disabled to keep compat with previous versions
VP_OPTION(ENABLE_VISP_NAMESPACE "" "" "Enable visp namespace" "" OFF)
# Allow introduction of "explicit" keyword. By default disabled to keep compat with previous versions
VP_OPTION(ENABLE_EXPLICIT_KEYWORD "" "" "Enable c++ explicit keyword" "" OFF)

if(ENABLE_SOLUTION_FOLDERS)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
Expand Down Expand Up @@ -1610,11 +1612,12 @@ foreach(m ${VISP_MODULES_DISABLED_AUTO})
endforeach()
string(REPLACE "visp_" "" VISP_MODULES_DISABLED_AUTO_ST "${VISP_MODULES_DISABLED_AUTO_ST}")

status(" To be built:" VISP_MODULES_BUILD THEN ${VISP_MODULES_BUILD_ST} ELSE "-")
status(" Disabled:" VISP_MODULES_DISABLED_USER THEN ${VISP_MODULES_DISABLED_USER_ST} ELSE "-")
status(" Disabled by dependency:" VISP_MODULES_DISABLED_AUTO THEN ${VISP_MODULES_DISABLED_AUTO_ST} ELSE "-")
status(" Unavailable:" VISP_MODULES_DISABLED_FORCE THEN ${VISP_MODULES_DISABLED_FORCE_ST} ELSE "-")
status(" Enable visp namespace:" ENABLE_VISP_NAMESPACE THEN "yes" ELSE "no")
status(" To be built:" VISP_MODULES_BUILD THEN ${VISP_MODULES_BUILD_ST} ELSE "-")
status(" Disabled:" VISP_MODULES_DISABLED_USER THEN ${VISP_MODULES_DISABLED_USER_ST} ELSE "-")
status(" Disabled by dependency:" VISP_MODULES_DISABLED_AUTO THEN ${VISP_MODULES_DISABLED_AUTO_ST} ELSE "-")
status(" Unavailable:" VISP_MODULES_DISABLED_FORCE THEN ${VISP_MODULES_DISABLED_FORCE_ST} ELSE "-")
status(" Enable visp namespace:" ENABLE_VISP_NAMESPACE THEN "yes" ELSE "no")
status(" Enable explicit keyword:" ENABLE_EXPLICIT_KEYWORD THEN "yes" ELSE "no")

# ========================== Android details ==========================
if(ANDROID)
Expand Down
1 change: 1 addition & 0 deletions cmake/templates/VISPConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ set(VISP_BIN_INSTALL_PATH "@VISP_BIN_INSTALL_PATH@")
# Remember VISP third party libs configuration
#----------------------------------------------------------------------
set(ENABLE_VISP_NAMESPACE "@ENABLE_VISP_NAMESPACE@")
set(ENABLE_EXPLICIT_KEYWORD "@ENABLE_EXPLICIT_KEYWORD@")
set(VISP_HAVE_AFMA4 "@VISP_HAVE_AFMA4@")
set(VISP_HAVE_AFMA6 "@VISP_HAVE_AFMA6@")
set(VISP_HAVE_APRILTAG "@VISP_HAVE_APRILTAG@")
Expand Down
59 changes: 45 additions & 14 deletions cmake/templates/vpConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
*
*****************************************************************************/

#ifndef _vpConfig_h_
#define _vpConfig_h_
#ifndef VP_CONFIG_H
#define VP_CONFIG_H

// To get access to EXIT_SUCCESS and EXIT_FAILURE
#include <cstdlib>
Expand Down Expand Up @@ -610,15 +610,6 @@ namespace vp = VISP_NAMESPACE_NAME;
#include <visp3/core/vpNullptrEmulated.h>
#endif

// Macro to be able to add override keyword
#ifndef vp_override
#if (__cplusplus >= 201103L) || (defined(_MSC_VER) && _MSC_VER >= 1600)
#define vp_override override
#else
#define vp_override
#endif
#endif

// Handle portable symbol export.
// Defining manually which symbol should be exported is required
// under Windows whether MinGW or MSVC is used.
Expand Down Expand Up @@ -668,12 +659,52 @@ namespace vp = VISP_NAMESPACE_NAME;
# define VISP_LOCAL
#endif

#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
// Add the material to produce a warning when deprecated functions are used
# ifndef vp_deprecated
# if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX
# define vp_deprecated __attribute__((deprecated))
# else
# define vp_deprecated __declspec(deprecated)
# endif
# endif
// Macro to be able to add override keyword
# ifndef vp_override
# if (__cplusplus >= 201103L) || (defined(_MSC_VER) && _MSC_VER >= 1600)
# define vp_override override
# else
# define vp_override
# endif
# endif
#endif

// Add the material to produce a warning when deprecated functions are used
#ifndef vp_deprecated
#ifndef VP_DEPRECATED
# if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX
# define vp_deprecated __attribute__((deprecated))
# define VP_DEPRECATED __attribute__((deprecated))
# else
# define VP_DEPRECATED __declspec(deprecated)
# endif
#endif

// Macro to be able to add override keyword
#ifndef VP_OVERRIDE
# if (__cplusplus >= 201103L) || (defined(_MSC_VER) && _MSC_VER >= 1600)
# define VP_OVERRIDE override
# else
# define VP_OVERRIDE
# endif
#endif

// Defined if the user wants to enable explicit keyword
#cmakedefine ENABLE_EXPLICIT_KEYWORD

// Add the macro for explicit keyword
#ifndef VP_EXPLICIT
# if defined(ENABLE_EXPLICIT_KEYWORD)
# define VP_EXPLICIT explicit
# else
# define vp_deprecated __declspec(deprecated)
# define VP_EXPLICIT
# endif
#endif

Expand Down
6 changes: 3 additions & 3 deletions demo/wireframe-simulator/servoSimu4Points.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ int main(int argc, const char **argv)
return EXIT_FAILURE;
}

vpImage<vpRGBa> Iint(480, 640, 255);
vpImage<vpRGBa> Iext1(480, 640, 255);
vpImage<vpRGBa> Iext2(480, 640, 255);
vpImage<vpRGBa> Iint(480, 640, vpRGBa(255));
vpImage<vpRGBa> Iext1(480, 640, vpRGBa(255));
vpImage<vpRGBa> Iext2(480, 640, vpRGBa(255));

#if defined(VISP_HAVE_X11)
vpDisplayX display[3];
Expand Down
4 changes: 2 additions & 2 deletions demo/wireframe-simulator/servoSimuCylinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ int main(int argc, const char **argv)
return EXIT_FAILURE;
}

vpImage<vpRGBa> Iint(480, 640, 255);
vpImage<vpRGBa> Iext(480, 640, 255);
vpImage<vpRGBa> Iint(480, 640, vpRGBa(255));
vpImage<vpRGBa> Iext(480, 640, vpRGBa(255));

#if defined(VISP_HAVE_X11)
vpDisplayX display[2];
Expand Down
6 changes: 3 additions & 3 deletions demo/wireframe-simulator/servoSimuSphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ int main(int argc, const char **argv)
return EXIT_FAILURE;
}

vpImage<vpRGBa> Iint(480, 640, 255);
vpImage<vpRGBa> Iext1(480, 640, 255);
vpImage<vpRGBa> Iext2(480, 640, 255);
vpImage<vpRGBa> Iint(480, 640, vpRGBa(255));
vpImage<vpRGBa> Iext1(480, 640, vpRGBa(255));
vpImage<vpRGBa> Iext2(480, 640, vpRGBa(255));

#if defined(VISP_HAVE_X11)
vpDisplayX display[3];
Expand Down
2 changes: 1 addition & 1 deletion example/calibration/calibration-helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ struct CalibInfo
void drawCalibrationOccupancy(VISP_NAMESPACE_ADDRESSING vpImage<unsigned char> &I, const std::vector<CalibInfo> &calib_info,
unsigned int patternW)
{
I = 0;
I = 0u;
unsigned char pixel_value = static_cast<unsigned char>(255.0 / calib_info.size());
for (size_t idx = 0; idx < calib_info.size(); idx++) {
const CalibInfo &calib = calib_info[idx];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ int main(int argc, const char **argv)

// set the robot at the desired position
sim.setCameraPosition(cMo);
I = 0;
I = 0u;
sim.getImage(I, cam); // and aquire the image Id

#if defined(VISP_HAVE_GUI) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_GTK))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ int main(int argc, const char **argv)

// set the robot at the desired position
sim.setCameraPosition(cMo);
I = 0;
I = 0u;
sim.getImage(I, cam); // and aquire the image Id

#if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_GTK)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ int main(int argc, const char **argv)

// set the robot at the desired position
sim.setCameraPosition(cMo);
I = 0;
I = 0u;
sim.getImage(I, cam); // and aquire the image Id

#if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_GTK)
Expand Down
2 changes: 1 addition & 1 deletion example/manual/geometric-features/manGeometricFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int main()
unsigned int height = 288;
unsigned int width = 384;
vpImage<unsigned char> I(height, width);
I = 255; // I is a white image
I = 255u; // I is a white image

// create a display window
#if defined(VISP_HAVE_X11)
Expand Down
4 changes: 2 additions & 2 deletions example/moments/image/servoMomentImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ class servoMoment
{
public:
servoMoment()
: m_width(640), m_height(480), m_cMo(), m_cdMo(), m_robot(), m_Iint(m_height, m_width, 0), m_task(), m_cam(),
: m_width(640), m_height(480), m_cMo(), m_cdMo(), m_robot(), m_Iint(m_height, m_width, vpRGBa(0)), m_task(), m_cam(),
m_error(0), m_imsim(), m_cur_img(m_height, m_width, 0), m_src_img(m_height, m_width, 0),
m_dst_img(m_height, m_width, 0), m_start_img(m_height, m_width, 0), m_interaction_type(), m_src(6), m_dst(6),
m_dst_img(m_height, m_width, 0), m_start_img(m_height, m_width, vpRGBa(0)), m_interaction_type(), m_src(6), m_dst(6),
m_moments(nullptr), m_momentsDes(nullptr), m_featureMoments(nullptr), m_featureMomentsDes(nullptr), m_displayInt(nullptr)
{ }
~servoMoment()
Expand Down
2 changes: 1 addition & 1 deletion example/moments/points/servoMomentPoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class servoMoment
{
public:
servoMoment()
: m_width(640), m_height(480), m_cMo(), m_cdMo(), m_robot(false), m_Iint(m_height, m_width, 255), m_task(), m_cam(),
: m_width(640), m_height(480), m_cMo(), m_cdMo(), m_robot(false), m_Iint(m_height, m_width, vpRGBa(255)), m_task(), m_cam(),
m_error(0), m_imsim(), m_interaction_type(), m_src(6), m_dst(6), m_moments(nullptr), m_momentsDes(nullptr),
m_featureMoments(nullptr), m_featureMomentsDes(nullptr), m_displayInt(nullptr)
{ }
Expand Down
2 changes: 1 addition & 1 deletion example/moments/polygon/servoMomentPolygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class servoMoment
{
public:
servoMoment()
: m_width(640), m_height(480), m_cMo(), m_cdMo(), m_robot(false), m_Iint(m_height, m_width, 255), m_task(), m_cam(),
: m_width(640), m_height(480), m_cMo(), m_cdMo(), m_robot(false), m_Iint(m_height, m_width, vpRGBa(255)), m_task(), m_cam(),
m_error(0), m_imsim(), m_interaction_type(), m_src(6), m_dst(6), m_moments(nullptr), m_momentsDes(nullptr),
m_featureMoments(nullptr), m_featureMomentsDes(nullptr), m_displayInt(nullptr)
{ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ int main(int argc, const char **argv)
// Log file creation in /tmp/$USERNAME/log.dat
// This file contains by line:
// - the 6 computed camera velocities (m/s, rad/s) to achieve the task
// - the 6 mesured camera velocities (m/s, rad/s)
// - the 6 mesured joint positions (m, rad)
// - the 6 measured camera velocities (m/s, rad/s)
// - the 6 measured joint positions (m, rad)
// - the 8 values of s - s*
std::string username;
// Get the user login name
Expand Down Expand Up @@ -489,5 +489,5 @@ int main()
std::cout << "Tip if you are on a windows-like system:" << std::endl;
std::cout << "- Install GDI, configure again ViSP using cmake and build again this example" << std::endl;
return EXIT_SUCCESS;
}
}
#endif
4 changes: 2 additions & 2 deletions example/servo-afma4/servoAfma4Point2DArtVelocity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ int main()
// Log file creation in /tmp/$USERNAME/log.dat
// This file contains by line:
// - the 6 computed joint velocities (m/s, rad/s) to achieve the task
// - the 6 mesured joint velocities (m/s, rad/s)
// - the 6 mesured joint positions (m, rad)
// - the 6 measured joint velocities (m/s, rad/s)
// - the 6 measured joint positions (m, rad)
// - the 2 values of s - s*
std::string username;
// Get the user login name
Expand Down
4 changes: 2 additions & 2 deletions example/servo-afma4/servoAfma4Point2DCamVelocity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ int main()
// Log file creation in /tmp/$USERNAME/log.dat
// This file contains by line:
// - the 6 computed cam velocities (m/s, rad/s) to achieve the task
// - the 6 mesured joint velocities (m/s, rad/s)
// - the 6 mesured joint positions (m, rad)
// - the 6 measured joint velocities (m/s, rad/s)
// - the 6 measured joint positions (m, rad)
// - the 2 values of s - s*
std::string username;
// Get the user login name
Expand Down
4 changes: 2 additions & 2 deletions example/servo-afma4/servoAfma4Point2DCamVelocityKalman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ int main(int argc, const char **argv)
// Log file creation in /tmp/$USERNAME/log.dat
// This file contains by line:
// - the 6 computed cam velocities (m/s, rad/s) to achieve the task
// - the 6 mesured joint velocities (m/s, rad/s)
// - the 6 mesured joint positions (m, rad)
// - the 6 measured joint velocities (m/s, rad/s)
// - the 6 measured joint positions (m, rad)
// - the 2 values of s - s*
std::string username;
// Get the user login name
Expand Down
4 changes: 2 additions & 2 deletions example/servo-afma6/servoAfma6FourPoints2DArtVelocity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ int main()
// Log file creation in /tmp/$USERNAME/log.dat
// This file contains by line:
// - the 6 computed joint velocities (m/s, rad/s) to achieve the task
// - the 6 mesured joint velocities (m/s, rad/s)
// - the 6 mesured joint positions (m, rad)
// - the 6 measured joint velocities (m/s, rad/s)
// - the 6 measured joint positions (m, rad)
// - the 8 values of s - s*
std::string username;
// Get the user login name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ int main()
// Log file creation in /tmp/$USERNAME/log.dat
// This file contains by line:
// - the 6 computed camera velocities (m/s, rad/s) to achieve the task
// - the 6 mesured joint velocities (m/s, rad/s)
// - the 6 mesured joint positions (m, rad)
// - the 6 measured joint velocities (m/s, rad/s)
// - the 6 measured joint positions (m, rad)
// - the 8 values of s - s*
// - the 6 values of the pose cMo (tx,ty,tz, rx,ry,rz) with translation
// in meters and rotations in radians
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ int main()
// Log file creation in /tmp/$USERNAME/log.dat
// This file contains by line:
// - the 6 computed camera velocities (m/s, rad/s) to achieve the task
// - the 6 mesured camera velocities (m/s, rad/s)
// - the 6 mesured joint positions (m, rad)
// - the 6 measured camera velocities (m/s, rad/s)
// - the 6 measured joint positions (m, rad)
// - the 8 values of s - s*
std::string username;
// Get the user login name
Expand Down
4 changes: 2 additions & 2 deletions example/servo-afma6/servoAfma6Point2DArtVelocity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ int main()
// Log file creation in /tmp/$USERNAME/log.dat
// This file contains by line:
// - the 6 computed joint velocities (m/s, rad/s) to achieve the task
// - the 6 mesured joint velocities (m/s, rad/s)
// - the 6 mesured joint positions (m, rad)
// - the 6 measured joint velocities (m/s, rad/s)
// - the 6 measured joint positions (m, rad)
// - the 2 values of s - s*
std::string username;
// Get the user login name
Expand Down
4 changes: 2 additions & 2 deletions example/servo-afma6/servoAfma6Point2DCamVelocity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ int main()
// Log file creation in /tmp/$USERNAME/log.dat
// This file contains by line:
// - the 6 computed cam velocities (m/s, rad/s) to achieve the task
// - the 6 mesured joint velocities (m/s, rad/s)
// - the 6 mesured joint positions (m, rad)
// - the 6 measured joint velocities (m/s, rad/s)
// - the 6 measured joint positions (m, rad)
// - the 2 values of s - s*
std::string username;
// Get the user login name
Expand Down
4 changes: 2 additions & 2 deletions example/servo-afma6/servoAfma6Segment2DCamVelocity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ int main()
// Log file creation in /tmp/$USERNAME/log.dat
// This file contains by line:
// - the 6 computed cam velocities (m/s, rad/s) to achieve the task
// - the 6 mesured joint velocities (m/s, rad/s)
// - the 6 mesured joint positions (m, rad)
// - the 6 measured joint velocities (m/s, rad/s)
// - the 6 measured joint positions (m, rad)
// - the 2 values of s - s*
std::string username;
// Get the user login name
Expand Down
2 changes: 1 addition & 1 deletion example/servo-pioneer/sonarPioneerReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ int main(int argc, char **argv)
// Create a display to show sensor data
if (isInitialized == false) {
I.resize((unsigned int)half_size * 2, (unsigned int)half_size * 2);
I = 255;
I = 255u;

#if defined(VISP_HAVE_X11)
d = new vpDisplayX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ int main()
// Log file creation in /tmp/$USERNAME/log.dat
// This file contains by line:
// - the 6 computed joint velocities (m/s, rad/s) to achieve the task
// - the 6 mesured joint velocities (m/s, rad/s)
// - the 6 mesured joint positions (m, rad)
// - the 6 measured joint velocities (m/s, rad/s)
// - the 6 measured joint positions (m, rad)
// - the 8 values of s - s*
std::string username;
// Get the user login name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ int main()
// Log file creation in /tmp/$USERNAME/log.dat
// This file contains by line:
// - the 6 computed camera velocities (m/s, rad/s) to achieve the task
// - the 6 mesured joint velocities (m/s, rad/s)
// - the 6 mesured joint positions (m, rad)
// - the 6 measured joint velocities (m/s, rad/s)
// - the 6 measured joint positions (m, rad)
// - the 8 values of s - s*
std::string username;
// Get the user login name
Expand Down
Loading

0 comments on commit 833f8b5

Please sign in to comment.