diff --git a/orocos_kdl/src/chainiksolvervel_pinv_givens.cpp b/orocos_kdl/src/chainiksolvervel_pinv_givens.cpp index b38ce04b..fbf102b4 100644 --- a/orocos_kdl/src/chainiksolvervel_pinv_givens.cpp +++ b/orocos_kdl/src/chainiksolvervel_pinv_givens.cpp @@ -30,8 +30,8 @@ namespace KDL jnt2jac(chain), jac(nj), transpose(nj>6),toggle(true), - m(max(6,nj)), - n(min(6,nj)), + m(static_cast(max(6,nj))), + n(static_cast(min(6,nj))), jac_eigen(m,n), U(Eigen::MatrixXd::Identity(m,m)), V(Eigen::MatrixXd::Identity(n,n)), @@ -50,8 +50,8 @@ namespace KDL jnt2jac.updateInternalDataStructures(); jac.resize(nj); transpose = (nj > 6); - m = max(6,nj); - n = min(6,nj); + m = static_cast(max(6,nj)); + n = static_cast(min(6,nj)); jac_eigen.conservativeResize(m,n); U.conservativeResizeLike(Eigen::MatrixXd::Identity(m,m)); V.conservativeResizeLike(Eigen::MatrixXd::Identity(n,n)); diff --git a/orocos_kdl/src/jacobian.cpp b/orocos_kdl/src/jacobian.cpp index a4942076..21d3d649 100644 --- a/orocos_kdl/src/jacobian.cpp +++ b/orocos_kdl/src/jacobian.cpp @@ -68,12 +68,12 @@ namespace KDL unsigned int Jacobian::rows()const { - return data.rows(); + return static_cast(data.rows()); } unsigned int Jacobian::columns()const { - return data.cols(); + return static_cast(data.cols()); } void SetToZero(Jacobian& jac) diff --git a/orocos_kdl/src/jntarray.cpp b/orocos_kdl/src/jntarray.cpp index 6dc26218..32c875d0 100644 --- a/orocos_kdl/src/jntarray.cpp +++ b/orocos_kdl/src/jntarray.cpp @@ -69,12 +69,12 @@ namespace KDL unsigned int JntArray::rows()const { - return data.rows(); + return static_cast(data.rows()); } unsigned int JntArray::columns()const { - return data.cols(); + return static_cast(data.cols()); } void Add(const JntArray& src1,const JntArray& src2,JntArray& dest) diff --git a/orocos_kdl/src/jntspaceinertiamatrix.cpp b/orocos_kdl/src/jntspaceinertiamatrix.cpp index 31ea4200..fb8a4fed 100644 --- a/orocos_kdl/src/jntspaceinertiamatrix.cpp +++ b/orocos_kdl/src/jntspaceinertiamatrix.cpp @@ -67,12 +67,12 @@ namespace KDL unsigned int JntSpaceInertiaMatrix::rows()const { - return data.rows(); + return static_cast(data.rows()); } unsigned int JntSpaceInertiaMatrix::columns()const { - return data.cols(); + return static_cast(data.cols()); } diff --git a/orocos_kdl/src/tree.cpp b/orocos_kdl/src/tree.cpp index 6d8943de..70151e66 100644 --- a/orocos_kdl/src/tree.cpp +++ b/orocos_kdl/src/tree.cpp @@ -156,8 +156,8 @@ bool Tree::getChain(const std::string& chain_root, const std::string& chain_tip, } // add the segments from the common frame to the tip frame - for (int s=parents_chain_tip.size()-1; s>-1; s--){ - chain.addSegment(GetTreeElementSegment(getSegment(parents_chain_tip[s])->second)); + for (auto rit=parents_chain_tip.rbegin(); rit != parents_chain_tip.rend(); ++rit){ + chain.addSegment(GetTreeElementSegment(getSegment(*rit)->second)); } return true; } diff --git a/orocos_kdl/src/treeiksolverpos_online.cpp b/orocos_kdl/src/treeiksolverpos_online.cpp index 3e3d1318..594c3a05 100644 --- a/orocos_kdl/src/treeiksolverpos_online.cpp +++ b/orocos_kdl/src/treeiksolverpos_online.cpp @@ -35,12 +35,9 @@ TreeIkSolverPos_Online::TreeIkSolverPos_Online(const double& nr_of_jnts, const double x_dot_rot_max, TreeFkSolverPos& fksolver, TreeIkSolverVel& iksolver) : - q_min_(nr_of_jnts), - q_max_(nr_of_jnts), - q_dot_max_(nr_of_jnts), fksolver_(fksolver), iksolver_(iksolver), - q_dot_(nr_of_jnts) + q_dot_(static_cast(nr_of_jnts)) { q_min_ = q_min; q_max_ = q_max; diff --git a/orocos_kdl/src/utilities/error_stack.cxx b/orocos_kdl/src/utilities/error_stack.cxx index 78c5027a..c4837e6e 100644 --- a/orocos_kdl/src/utilities/error_stack.cxx +++ b/orocos_kdl/src/utilities/error_stack.cxx @@ -57,7 +57,11 @@ void IOTracePopStr(char* buffer,int size) { *buffer = 0; return; } +#if defined(_WIN32) + strncpy_s(buffer,size,errorstack.top().c_str(),size); +#else strncpy(buffer,errorstack.top().c_str(),size); +#endif buffer[size - 1] = '\0'; errorstack.pop(); } diff --git a/orocos_kdl/src/utilities/ldl_solver_eigen.cpp b/orocos_kdl/src/utilities/ldl_solver_eigen.cpp index 1729ead9..3f47afdc 100644 --- a/orocos_kdl/src/utilities/ldl_solver_eigen.cpp +++ b/orocos_kdl/src/utilities/ldl_solver_eigen.cpp @@ -25,7 +25,7 @@ namespace KDL{ int ldl_solver_eigen(const Eigen::MatrixXd& A, const Eigen::VectorXd& v, Eigen::MatrixXd& L, Eigen::VectorXd& D, Eigen::VectorXd& vtmp, Eigen::VectorXd& q) { - const int n = A.rows(); + const int n = static_cast(A.rows()); int error=SolverI::E_NOERROR; //Check sizes diff --git a/orocos_kdl/src/utilities/svd_eigen_HH.cpp b/orocos_kdl/src/utilities/svd_eigen_HH.cpp index 2fdb9d2b..7c7bd379 100644 --- a/orocos_kdl/src/utilities/svd_eigen_HH.cpp +++ b/orocos_kdl/src/utilities/svd_eigen_HH.cpp @@ -26,8 +26,8 @@ namespace KDL{ int svd_eigen_HH(const Eigen::MatrixXd &A, Eigen::MatrixXd &U, Eigen::VectorXd &S, Eigen::MatrixXd &V, Eigen::VectorXd &tmp, int maxiter, double epsilon) { //get the rows/columns of the matrix - const int rows = A.rows(); - const int cols = A.cols(); + const int rows = static_cast(A.rows()); + const int cols = static_cast(A.cols()); U.setZero(); U.topLeftCorner(rows,cols)=A;