osqp-eigen icon indicating copy to clipboard operation
osqp-eigen copied to clipboard

Fix simple warnings

Open k2shah opened this issue 1 year ago • 1 comments

This MR fixes some warnings thrown by c++17 using -Wall

In file included from /src/Solver.cpp:11:0:
osqp_eigen/OsqpEigen/Solver.hpp: In constructor 'OsqpEigen::Solver::Solver()':
osqp_eigen/OsqpEigen/Solver.hpp:53:14: warning: 'OsqpEigen::Solver::m_isSolverInitialized' will be initialized after [-Wreorder]
         bool m_isSolverInitialized; /**< Boolean true if solver is initialized. */
              ^~~~~~~~~~~~~~~~~~~~~
In file included from /src/Solver.cpp:11:0:
osqp_eigen/OsqpEigen/Solver.hpp:34:78: warning:   'std::unique_ptr<OSQPWorkspace, std::function<void(OSQPWorkspace*)> > OsqpEigen::Solver::m_workspace' [-Wreorder]
         std::unique_ptr<OSQPWorkspace, std::function<void(OSQPWorkspace *)>> m_workspace;  /**< Pointer to OSQPWorkspace struct. */
                                                                              ^~~~~~~~~~~
/src/Solver.cpp:20:1: warning:   when initialized here [-Wreorder]
 OsqpEigen::Solver::Solver()
 ^~~~~~~~~
INFO: From Compiling src/Data.cpp:
/src/Data.cpp: In member function 'bool OsqpEigen::Data::isSet() const':
/src/Data.cpp:92:27: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
         m_isLinearConstraintsMatrixSet &&
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         m_isLowerBoundSet &&
         ~~~~~~~~~~~~~~~~~~^~
         m_isUpperBoundSet;
         ~~~~~~~~~~~~~~~~~  
         ```

k2shah avatar Aug 08 '22 20:08 k2shah

hi @GiulioRomualdi Please let me know if this PR is acceptable and who might be able to review it. It''s a small PR aimed at fixing warnings.

k2shah avatar Aug 11 '22 17:08 k2shah

Thank you @k2shah for the contribution

GiulioRomualdi avatar Aug 23 '22 10:08 GiulioRomualdi