Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build warnings on Windows #390

Merged
merged 5 commits into from
Apr 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions orocos_kdl/src/chainiksolvervel_pinv_givens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned int>(max(6,nj))),
n(static_cast<unsigned int>(min(6,nj))),
jac_eigen(m,n),
U(Eigen::MatrixXd::Identity(m,m)),
V(Eigen::MatrixXd::Identity(n,n)),
Expand All @@ -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<unsigned int>(max(6,nj));
n = static_cast<unsigned int>(min(6,nj));
jac_eigen.conservativeResize(m,n);
U.conservativeResizeLike(Eigen::MatrixXd::Identity(m,m));
V.conservativeResizeLike(Eigen::MatrixXd::Identity(n,n));
Expand Down
4 changes: 2 additions & 2 deletions orocos_kdl/src/jacobian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ namespace KDL

unsigned int Jacobian::rows()const
{
return data.rows();
return static_cast<unsigned int>(data.rows());
}

unsigned int Jacobian::columns()const
{
return data.cols();
return static_cast<unsigned int>(data.cols());
}

void SetToZero(Jacobian& jac)
Expand Down
4 changes: 2 additions & 2 deletions orocos_kdl/src/jntarray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ namespace KDL

unsigned int JntArray::rows()const
{
return data.rows();
return static_cast<unsigned int>(data.rows());
}

unsigned int JntArray::columns()const
{
return data.cols();
return static_cast<unsigned int>(data.cols());
}

void Add(const JntArray& src1,const JntArray& src2,JntArray& dest)
Expand Down
4 changes: 2 additions & 2 deletions orocos_kdl/src/jntspaceinertiamatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ namespace KDL

unsigned int JntSpaceInertiaMatrix::rows()const
{
return data.rows();
return static_cast<unsigned int>(data.rows());
}

unsigned int JntSpaceInertiaMatrix::columns()const
{
return data.cols();
return static_cast<unsigned int>(data.cols());
}


Expand Down
4 changes: 2 additions & 2 deletions orocos_kdl/src/tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 1 addition & 4 deletions orocos_kdl/src/treeiksolverpos_online.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned int>(nr_of_jnts))
{
q_min_ = q_min;
q_max_ = q_max;
Expand Down
4 changes: 4 additions & 0 deletions orocos_kdl/src/utilities/error_stack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
MatthijsBurgh marked this conversation as resolved.
Show resolved Hide resolved
buffer[size - 1] = '\0';
errorstack.pop();
}
Expand Down
2 changes: 1 addition & 1 deletion orocos_kdl/src/utilities/ldl_solver_eigen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(A.rows());
int error=SolverI::E_NOERROR;

//Check sizes
Expand Down
4 changes: 2 additions & 2 deletions orocos_kdl/src/utilities/svd_eigen_HH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(A.rows());
const int cols = static_cast<int>(A.cols());

U.setZero();
U.topLeftCorner(rows,cols)=A;
Expand Down