Skip to content

Commit

Permalink
Fix warnings raised by GCC -Wpedactic
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Nov 3, 2021
1 parent b76e9ef commit a61cbdc
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 32 deletions.
2 changes: 1 addition & 1 deletion gtsam/base/Manifold.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,4 @@ struct FixedDimension {
// * the gtsam namespace to be more easily enforced as testable
// */
#define GTSAM_CONCEPT_MANIFOLD_INST(T) template class gtsam::IsManifold<T>;
#define GTSAM_CONCEPT_MANIFOLD_TYPE(T) typedef gtsam::IsManifold<T> _gtsam_IsManifold_##T;
#define GTSAM_CONCEPT_MANIFOLD_TYPE(T) using _gtsam_IsManifold_##T = gtsam::IsManifold<T>
22 changes: 11 additions & 11 deletions gtsam/base/Matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> M
// Create handy typedefs and constants for square-size matrices
// MatrixMN, MatrixN = MatrixNN, I_NxN, and Z_NxN, for M,N=1..9
#define GTSAM_MAKE_MATRIX_DEFS(N) \
typedef Eigen::Matrix<double, N, N> Matrix##N; \
typedef Eigen::Matrix<double, 1, N> Matrix1##N; \
typedef Eigen::Matrix<double, 2, N> Matrix2##N; \
typedef Eigen::Matrix<double, 3, N> Matrix3##N; \
typedef Eigen::Matrix<double, 4, N> Matrix4##N; \
typedef Eigen::Matrix<double, 5, N> Matrix5##N; \
typedef Eigen::Matrix<double, 6, N> Matrix6##N; \
typedef Eigen::Matrix<double, 7, N> Matrix7##N; \
typedef Eigen::Matrix<double, 8, N> Matrix8##N; \
typedef Eigen::Matrix<double, 9, N> Matrix9##N; \
using Matrix##N = Eigen::Matrix<double, N, N>; \
using Matrix1##N = Eigen::Matrix<double, 1, N>; \
using Matrix2##N = Eigen::Matrix<double, 2, N>; \
using Matrix3##N = Eigen::Matrix<double, 3, N>; \
using Matrix4##N = Eigen::Matrix<double, 4, N>; \
using Matrix5##N = Eigen::Matrix<double, 5, N>; \
using Matrix6##N = Eigen::Matrix<double, 6, N>; \
using Matrix7##N = Eigen::Matrix<double, 7, N>; \
using Matrix8##N = Eigen::Matrix<double, 8, N>; \
using Matrix9##N = Eigen::Matrix<double, 9, N>; \
static const Eigen::MatrixBase<Matrix##N>::IdentityReturnType I_##N##x##N = Matrix##N::Identity(); \
static const Eigen::MatrixBase<Matrix##N>::ConstantReturnType Z_##N##x##N = Matrix##N::Zero();
static const Eigen::MatrixBase<Matrix##N>::ConstantReturnType Z_##N##x##N = Matrix##N::Zero()

GTSAM_MAKE_MATRIX_DEFS(1);
GTSAM_MAKE_MATRIX_DEFS(2);
Expand Down
2 changes: 1 addition & 1 deletion gtsam/base/Testable.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@ namespace gtsam {
* @deprecated please use BOOST_CONCEPT_ASSERT and
*/
#define GTSAM_CONCEPT_TESTABLE_INST(T) template class gtsam::IsTestable<T>;
#define GTSAM_CONCEPT_TESTABLE_TYPE(T) typedef gtsam::IsTestable<T> _gtsam_Testable_##T;
#define GTSAM_CONCEPT_TESTABLE_TYPE(T) using _gtsam_Testable_##T = gtsam::IsTestable<T>
4 changes: 2 additions & 2 deletions gtsam/base/Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ static const Eigen::MatrixBase<Vector3>::ConstantReturnType Z_3x1 = Vector3::Zer
// Create handy typedefs and constants for vectors with N>3
// VectorN and Z_Nx1, for N=1..9
#define GTSAM_MAKE_VECTOR_DEFS(N) \
typedef Eigen::Matrix<double, N, 1> Vector##N; \
static const Eigen::MatrixBase<Vector##N>::ConstantReturnType Z_##N##x1 = Vector##N::Zero();
using Vector##N = Eigen::Matrix<double, N, 1>; \
static const Eigen::MatrixBase<Vector##N>::ConstantReturnType Z_##N##x1 = Vector##N::Zero()

GTSAM_MAKE_VECTOR_DEFS(4);
GTSAM_MAKE_VECTOR_DEFS(5);
Expand Down
4 changes: 2 additions & 2 deletions gtsam/geometry/concepts.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ class PoseConcept {
*/

/** Pose Concept macros */
#define GTSAM_CONCEPT_POSE_INST(T) template class gtsam::PoseConcept<T>;
#define GTSAM_CONCEPT_POSE_TYPE(T) typedef gtsam::PoseConcept<T> _gtsam_PoseConcept##T;
#define GTSAM_CONCEPT_POSE_INST(T) template class gtsam::PoseConcept<T>
#define GTSAM_CONCEPT_POSE_TYPE(T) using _gtsam_PoseConcept##T = gtsam::PoseConcept<T>;

2 changes: 1 addition & 1 deletion gtsam/inference/FactorGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class FactorGraph {

protected:
/** concept check, makes sure FACTOR defines print and equals */
GTSAM_CONCEPT_TESTABLE_TYPE(FACTOR)
GTSAM_CONCEPT_TESTABLE_TYPE(FACTOR);

/** Collection of factors */
FastVector<sharedFactor> factors_;
Expand Down
4 changes: 2 additions & 2 deletions gtsam/navigation/MagPoseFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class MagPoseFactor: public NoiseModelFactor1<POSE> {
using shared_ptr = boost::shared_ptr<MagPoseFactor<POSE>>;

/// Concept check by type.
GTSAM_CONCEPT_TESTABLE_TYPE(POSE)
GTSAM_CONCEPT_POSE_TYPE(POSE)
GTSAM_CONCEPT_TESTABLE_TYPE(POSE);
GTSAM_CONCEPT_POSE_TYPE(POSE);

public:
~MagPoseFactor() override {}
Expand Down
2 changes: 1 addition & 1 deletion gtsam/nonlinear/CustomFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ class CustomFactor: public NoiseModelFactor {
}
};

};
}
6 changes: 3 additions & 3 deletions gtsam/nonlinear/NonlinearEquality.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ class NonlinearEquality1: public NoiseModelFactor1<VALUE> {

X value_; /// fixed value for variable

GTSAM_CONCEPT_MANIFOLD_TYPE(X)
GTSAM_CONCEPT_MANIFOLD_TYPE(X);

GTSAM_CONCEPT_TESTABLE_TYPE(X)
GTSAM_CONCEPT_TESTABLE_TYPE(X);

public:

Expand Down Expand Up @@ -296,7 +296,7 @@ class NonlinearEquality2 : public NoiseModelFactor2<T, T> {
using Base = NoiseModelFactor2<T, T>;
using This = NonlinearEquality2<T>;

GTSAM_CONCEPT_MANIFOLD_TYPE(T)
GTSAM_CONCEPT_MANIFOLD_TYPE(T);

/// Default constructor to allow for serialization
NonlinearEquality2() {}
Expand Down
2 changes: 1 addition & 1 deletion gtsam/nonlinear/PriorFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace gtsam {
VALUE prior_; /** The measurement */

/** concept check by type */
GTSAM_CONCEPT_TESTABLE_TYPE(T)
GTSAM_CONCEPT_TESTABLE_TYPE(T);

public:

Expand Down
3 changes: 2 additions & 1 deletion gtsam_unstable/slam/BetweenFactorEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class BetweenFactorEM: public NonlinearFactor {
bool flag_bump_up_near_zero_probs_;

/** concept check by type */
GTSAM_CONCEPT_LIE_TYPE(T)GTSAM_CONCEPT_TESTABLE_TYPE(T)
GTSAM_CONCEPT_LIE_TYPE(T);
GTSAM_CONCEPT_TESTABLE_TYPE(T);

public:

Expand Down
4 changes: 2 additions & 2 deletions gtsam_unstable/slam/PoseBetweenFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ namespace gtsam {
boost::optional<POSE> body_P_sensor_; ///< The pose of the sensor in the body frame

/** concept check by type */
GTSAM_CONCEPT_TESTABLE_TYPE(POSE)
GTSAM_CONCEPT_POSE_TYPE(POSE)
GTSAM_CONCEPT_TESTABLE_TYPE(POSE);
GTSAM_CONCEPT_POSE_TYPE(POSE);
public:

// shorthand for a smart pointer to a factor
Expand Down
4 changes: 2 additions & 2 deletions gtsam_unstable/slam/PosePriorFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ namespace gtsam {
boost::optional<POSE> body_P_sensor_; ///< The pose of the sensor in the body frame

/** concept check by type */
GTSAM_CONCEPT_TESTABLE_TYPE(POSE)
GTSAM_CONCEPT_POSE_TYPE(POSE)
GTSAM_CONCEPT_TESTABLE_TYPE(POSE);
GTSAM_CONCEPT_POSE_TYPE(POSE);
public:

/// shorthand for a smart pointer to a factor
Expand Down
4 changes: 2 additions & 2 deletions gtsam_unstable/slam/TransformBtwRobotsUnaryFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ namespace gtsam {
SharedGaussian model_;

/** concept check by type */
GTSAM_CONCEPT_LIE_TYPE(T)
GTSAM_CONCEPT_TESTABLE_TYPE(T)
GTSAM_CONCEPT_LIE_TYPE(T);
GTSAM_CONCEPT_TESTABLE_TYPE(T);

public:

Expand Down

0 comments on commit a61cbdc

Please sign in to comment.