From 5fb2990594367111df8e9868ed819fd7fe92b876 Mon Sep 17 00:00:00 2001
From: olivier-stasse <olivier.stasse@aist.go.jp>
Date: Wed, 23 Feb 2011 16:24:35 +0900
Subject: [PATCH] Fix warning and remove unused setReference(strm) for
 generator-vel-ref.

---
 ...FootConstraintsAsLinearSystemForVelRef.cpp |  2 +-
 .../generator-vel-ref.cpp                     | 10 +--------
 .../generator-vel-ref.hh                      |  6 -----
 src/ZMPRefTrajectoryGeneration/qp-problem.cpp | 22 +++++++++----------
 src/privatepgtypes.cpp                        |  4 ++--
 5 files changed, 14 insertions(+), 30 deletions(-)

diff --git a/src/Mathematics/FootConstraintsAsLinearSystemForVelRef.cpp b/src/Mathematics/FootConstraintsAsLinearSystemForVelRef.cpp
index 102f9ca6..a3678713 100644
--- a/src/Mathematics/FootConstraintsAsLinearSystemForVelRef.cpp
+++ b/src/Mathematics/FootConstraintsAsLinearSystemForVelRef.cpp
@@ -163,7 +163,7 @@ FootConstraintsAsLinearSystemForVelRef::setVertices( convex_hull_t & ConvexHull,
 						     int constraints_type)
 {
 
-  edges_s * conv_hulls;
+  edges_s * conv_hulls=0;
   switch(constraints_type)
     {
     case ZMP_CONSTRAINTS:
diff --git a/src/ZMPRefTrajectoryGeneration/generator-vel-ref.cpp b/src/ZMPRefTrajectoryGeneration/generator-vel-ref.cpp
index 5e42bd9f..31074157 100644
--- a/src/ZMPRefTrajectoryGeneration/generator-vel-ref.cpp
+++ b/src/ZMPRefTrajectoryGeneration/generator-vel-ref.cpp
@@ -59,15 +59,7 @@ GeneratorVelRef::setPonderation( IntermedQPMat & Matrices, double weight, int ty
   IntermedQPMat::objective_variant_t & Objective = Matrices.Objective( type );
   Objective.weight = weight;
 
-}
-
-
-void 
-GeneratorVelRef::setReference(std::istringstream &strm)
-{
-  //TODO:
-}
-	
+}	
 
 void
 GeneratorVelRef::previewSupportStates(IntermedQPMat & Matrices,
diff --git a/src/ZMPRefTrajectoryGeneration/generator-vel-ref.hh b/src/ZMPRefTrajectoryGeneration/generator-vel-ref.hh
index 94cda884..5249789b 100644
--- a/src/ZMPRefTrajectoryGeneration/generator-vel-ref.hh
+++ b/src/ZMPRefTrajectoryGeneration/generator-vel-ref.hh
@@ -57,8 +57,6 @@ namespace PatternGeneratorJRL
     ~GeneratorVelRef();
     /// \}
 
-//    /// \brief Call method to handle the plugins (SimplePlugin interface).
-//    void CallMethod(std::string &Method, std::istringstream &strm);
 
     /// \brief Set the weights on the objective terms
     ///
@@ -67,10 +65,6 @@ namespace PatternGeneratorJRL
     /// \param[in] objective
     void setPonderation( IntermedQPMat & Matrices, double weight, int objective );
 
-    /// \brief Set the velocity reference from string
-    ///
-    /// \param[in] strm velocity reference string
-    void setReference(std::istringstream &strm);
 
     /// \brief Preview support state for the whole preview period
     ///
diff --git a/src/ZMPRefTrajectoryGeneration/qp-problem.cpp b/src/ZMPRefTrajectoryGeneration/qp-problem.cpp
index 84a04b15..0a3ccfea 100644
--- a/src/ZMPRefTrajectoryGeneration/qp-problem.cpp
+++ b/src/ZMPRefTrajectoryGeneration/qp-problem.cpp
@@ -90,8 +90,6 @@ void
 QPProblem_s::clear( int type )
 {
 
-  double * array;
-  int array_size;
   switch(type)
     {
     case MATRIX_Q:
@@ -188,13 +186,13 @@ QPProblem_s::addTerm( const MAL_MATRIX (&Mat, double), int type,
     {
     case MATRIX_Q:
       pArray_s = &Q_;
-      nbvariables_ = (col+Mat.size2()>nbvariables_) ? col+Mat.size2() : nbvariables_;
+      nbvariables_ = (col+Mat.size2()>(unsigned int)nbvariables_) ? col+Mat.size2() : nbvariables_;
       break;
 
     case MATRIX_DU:
       pArray_s = &DU_;
-      nbconstraints_ = (row+Mat.size1()>nbconstraints_) ? row+Mat.size1() : nbconstraints_;
-      nbvariables_ = (col+Mat.size2()>nbvariables_) ? col+Mat.size2() : nbvariables_;
+      nbconstraints_ = (row+Mat.size1()>(unsigned int)nbconstraints_) ? row+Mat.size1() : nbconstraints_;
+      nbvariables_ = (col+Mat.size2()>(unsigned int)nbvariables_) ? col+Mat.size2() : nbvariables_;
       break;
     }
 
@@ -212,8 +210,8 @@ QPProblem_s::addTerm( const MAL_MATRIX (&Mat, double), int type,
       war_.resize(2*(3*nbvariables_*nbvariables_/2+10*nbvariables_+2*(nbconstraints_+1)+20000), 1,true);
     }
 
-  for( int i = 0;i < MAL_MATRIX_NB_ROWS(Mat); i++)
-    for( int j = 0;j < MAL_MATRIX_NB_COLS(Mat); j++)
+  for( unsigned int i = 0;i < MAL_MATRIX_NB_ROWS(Mat); i++)
+    for( unsigned int j = 0;j < MAL_MATRIX_NB_COLS(Mat); j++)
       {
         pArray_s->array_[row+i+(col+j)*pArray_s->nrows_] += Mat(i,j);
       }
@@ -232,22 +230,22 @@ void QPProblem_s::addTerm( const MAL_VECTOR (&Vec, double), int type,
     {
     case VECTOR_D:
       pArray_s = &D_;
-      nbvariables_ = (row+Vec.size()>nbvariables_) ? row+Vec.size() : nbvariables_;
+      nbvariables_ = (row+Vec.size()>(unsigned int)nbvariables_) ? row+Vec.size() : nbvariables_;
       break;
 
     case VECTOR_XL:
       pArray_s = &XL_;
-      nbvariables_ = (row+Vec.size()>nbvariables_) ? row+Vec.size() : nbvariables_;
+      nbvariables_ = (row+Vec.size()>(unsigned int)nbvariables_) ? row+Vec.size() : nbvariables_;
       break;
 
     case VECTOR_XU:
       pArray_s = &XU_;
-      nbvariables_ = (row+Vec.size()>nbvariables_) ? row+Vec.size() : nbvariables_;
+      nbvariables_ = (row+Vec.size()>(unsigned int)nbvariables_) ? row+Vec.size() : nbvariables_;
       break;
 
     case VECTOR_DS:
       pArray_s = &DS_;
-      nbconstraints_ = (row+Vec.size()>nbconstraints_) ? row+Vec.size() : nbconstraints_;
+      nbconstraints_ = (row+Vec.size()>(unsigned int)nbconstraints_) ? row+Vec.size() : nbconstraints_;
       break;
     }
 
@@ -257,7 +255,7 @@ void QPProblem_s::addTerm( const MAL_VECTOR (&Vec, double), int type,
     }
 
   boost_ublas::vector<double>::const_iterator VecIt = Vec.begin();
-  for( int i = 0; i < Vec.size(); i++ )
+  for( unsigned int i = 0; i < Vec.size(); i++ )
   {
     pArray_s->array_[row+i] += *VecIt;
     VecIt++;
diff --git a/src/privatepgtypes.cpp b/src/privatepgtypes.cpp
index 953779e1..46ced799 100644
--- a/src/privatepgtypes.cpp
+++ b/src/privatepgtypes.cpp
@@ -135,7 +135,7 @@ namespace PatternGeneratorJRL
       double c_a = cos(angle);
       double s_a = sin(angle);
 
-      for( int j=0;j<X.size();j++ )
+      for( unsigned int j=0;j<X.size();j++ )
         {
           X[j] = ( X[j]*c_a - Y[j]*s_a );
           Y[j] = ( X[j]*s_a + Y[j]*c_a );
@@ -171,7 +171,7 @@ namespace PatternGeneratorJRL
   void
   convex_hull_t::set(const double * arrayX, const double * arrayY)
     {
-      for(int i=0;i<X.size();i++)
+      for(unsigned int i=0;i<X.size();i++)
         {
           X[i] = arrayX[i];
           Y[i] = arrayY[i];
-- 
GitLab