Revision: 8318
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8318&view=rev
Author:   rtv
Date:     2009-10-20 21:43:52 +0000 (Tue, 20 Oct 2009)

Log Message:
-----------
applied patch from Jeff Donner, fixing some signed/unsigned comparisons

Modified Paths:
--------------
    code/stage/trunk/CMakeLists.txt
    code/stage/trunk/libstage/camera.cc
    code/stage/trunk/libstage/file_manager.cc
    code/stage/trunk/libstage/model.cc
    code/stage/trunk/libstage/model_blinkenlight.cc
    code/stage/trunk/libstage/model_blobfinder.cc
    code/stage/trunk/libstage/model_draw.cc
    code/stage/trunk/libstage/model_fiducial.cc
    code/stage/trunk/libstage/model_gripper.cc
    code/stage/trunk/libstage/model_laser.cc
    code/stage/trunk/libstage/model_position.cc
    code/stage/trunk/libstage/model_ranger.cc
    code/stage/trunk/libstage/powerpack.cc
    code/stage/trunk/libstage/stage.hh

Modified: code/stage/trunk/CMakeLists.txt
===================================================================
--- code/stage/trunk/CMakeLists.txt     2009-10-20 20:41:13 UTC (rev 8317)
+++ code/stage/trunk/CMakeLists.txt     2009-10-20 21:43:52 UTC (rev 8318)
@@ -35,7 +35,7 @@
 IF (NOT PROJECT_OS_WIN AND NOT PROJECT_OS_SOLARIS)
     # Using -Wall on Windows causes MSVC to produce thousands of warnings in 
its
     # own standard headers, dramatically slowing down the build.
-    SET (WALL "-Wall" )
+    SET (WALL "-Wall " )
 ENDIF (NOT PROJECT_OS_WIN AND NOT PROJECT_OS_SOLARIS)
 
 #####################################

Modified: code/stage/trunk/libstage/camera.cc
===================================================================
--- code/stage/trunk/libstage/camera.cc 2009-10-20 20:41:13 UTC (rev 8317)
+++ code/stage/trunk/libstage/camera.cc 2009-10-20 21:43:52 UTC (rev 8318)
@@ -25,6 +25,8 @@
 
 void PerspectiveCamera::move( float x, float y, float z )
 {
+  (void)z; // avoid warning about unused var
+
        //scale relative to zoom level
        x *= _z / 100.0;
        y *= _z / 100.0;

Modified: code/stage/trunk/libstage/file_manager.cc
===================================================================
--- code/stage/trunk/libstage/file_manager.cc   2009-10-20 20:41:13 UTC (rev 
8317)
+++ code/stage/trunk/libstage/file_manager.cc   2009-10-20 21:43:52 UTC (rev 
8318)
@@ -78,8 +78,8 @@
 
        std::string FileManager::stripFilename( std::string path ) {
                std::string pathChars( "\\/" );
-               size_t loc = path.find_last_of( pathChars );
-               if ( loc < 0 )
+                std::string::size_type loc = path.find_last_of( pathChars );
+               if ( loc == std::string::npos )
                        return path;
                else
                        return path.substr( 0, loc );

Modified: code/stage/trunk/libstage/model.cc
===================================================================
--- code/stage/trunk/libstage/model.cc  2009-10-20 20:41:13 UTC (rev 8317)
+++ code/stage/trunk/libstage/model.cc  2009-10-20 21:43:52 UTC (rev 8318)
@@ -1058,10 +1058,13 @@
         cellheight(0),
         pts()
 {
+  
 }
 
 void Model::RasterVis::Visualize( Model* mod, Camera* cam ) 
 {
+  (void)cam; // avoid warning about unused var
+
   if( data == NULL )
         return;
 

Modified: code/stage/trunk/libstage/model_blinkenlight.cc
===================================================================
--- code/stage/trunk/libstage/model_blinkenlight.cc     2009-10-20 20:41:13 UTC 
(rev 8317)
+++ code/stage/trunk/libstage/model_blinkenlight.cc     2009-10-20 21:43:52 UTC 
(rev 8318)
@@ -111,6 +111,8 @@
 
 void ModelBlinkenlight::DataVisualize( Camera* cam )
 {
+  (void)cam; // avoid warning about unused var
+
   // TODO XX
        if( on && showBlinkenData )
        {

Modified: code/stage/trunk/libstage/model_blobfinder.cc
===================================================================
--- code/stage/trunk/libstage/model_blobfinder.cc       2009-10-20 20:41:13 UTC 
(rev 8317)
+++ code/stage/trunk/libstage/model_blobfinder.cc       2009-10-20 21:43:52 UTC 
(rev 8318)
@@ -108,7 +108,9 @@
                                                                Model* finder,
                                                                const void* 
dummy )
 { 
-       return( ! finder->IsRelated( candidate ));
+  (void)dummy; // avoid warning about unused var
+
+  return( ! finder->IsRelated( candidate ));
 }      
 
 
@@ -299,6 +301,7 @@
 ModelBlobfinder::Vis::Vis( World* world ) 
   : Visualizer( "Blobfinder", "blobfinder_vis" )
 {
+  
   //world->RegisterOption( &showArea );
   //world->RegisterOption( &showStrikes );
   //world->RegisterOption( &showFov );

Modified: code/stage/trunk/libstage/model_draw.cc
===================================================================
--- code/stage/trunk/libstage/model_draw.cc     2009-10-20 20:41:13 UTC (rev 
8317)
+++ code/stage/trunk/libstage/model_draw.cc     2009-10-20 21:43:52 UTC (rev 
8318)
@@ -388,6 +388,8 @@
 void Model::DrawImage( uint32_t texture_id, Camera* cam, float alpha, 
                                                          double width, double 
height )
 {
+  (void)alpha; // avoid warning about unused var
+
   float yaw, pitch;
   pitch = - cam->pitch();
   yaw = - cam->yaw();
@@ -519,6 +521,7 @@
 
 void Model::DataVisualize( Camera* cam )
 {  
+  (void)cam; // avoid warning about unused var
 }
 
 void Model::DataVisualizeTree( Camera* cam )

Modified: code/stage/trunk/libstage/model_fiducial.cc
===================================================================
--- code/stage/trunk/libstage/model_fiducial.cc 2009-10-20 20:41:13 UTC (rev 
8317)
+++ code/stage/trunk/libstage/model_fiducial.cc 2009-10-20 21:43:52 UTC (rev 
8318)
@@ -100,6 +100,8 @@
                                                                                
                 Model* finder, 
                                                                                
                 const void* dummy )
 {
+  (void)dummy; // avoid warning about unused var
+
   return( ! finder->IsRelated( candidate ) );
 }      
 
@@ -238,6 +240,8 @@
 
 void ModelFiducial::DataVisualize( Camera* cam )
 {
+  (void)cam; // avoid warning about unused var
+
        if( showFov )
          {
                 PushColor( 1,0,1,0.2  ); // magenta, with a bit of alpha

Modified: code/stage/trunk/libstage/model_gripper.cc
===================================================================
--- code/stage/trunk/libstage/model_gripper.cc  2009-10-20 20:41:13 UTC (rev 
8317)
+++ code/stage/trunk/libstage/model_gripper.cc  2009-10-20 21:43:52 UTC (rev 
8318)
@@ -329,6 +329,8 @@
                                                                                
                Model* finder,
                                                                                
                const void* dummy )
 {
+  (void)dummy; // avoid warning about unused var
+
   return( (hit != finder) && hit->vis.gripper_return );
   // can't use the normal relation check, because we may pick things
   // up and we must still see them.
@@ -469,6 +471,8 @@
 
 void ModelGripper::DataVisualize( Camera* cam )
 {
+  (void)cam; // avoid warning about unused var
+
   // only draw if someone is using the gripper
   if( subs < 1 )
         return;

Modified: code/stage/trunk/libstage/model_laser.cc
===================================================================
--- code/stage/trunk/libstage/model_laser.cc    2009-10-20 20:41:13 UTC (rev 
8317)
+++ code/stage/trunk/libstage/model_laser.cc    2009-10-20 21:43:52 UTC (rev 
8318)
@@ -151,6 +151,8 @@
                                                                                
                                                        Model* finder,
                                                                                
                                                        const void* dummy )
 {
+  (void)dummy; // avoid warning about unused var
+
   // Ignore the model that's looking and things that are invisible to
   // lasers  
   return( (hit != finder) && (hit->vis.laser_return > 0 ) );
@@ -279,6 +281,8 @@
 
 void ModelLaser::Vis::Visualize( Model* mod, Camera* cam ) 
 {
+  (void)cam; // avoid warning about unused var
+
   ModelLaser* laser( dynamic_cast<ModelLaser*>(mod) );
        
   const std::vector<Sample>& samples( laser->GetSamples() );

Modified: code/stage/trunk/libstage/model_position.cc
===================================================================
--- code/stage/trunk/libstage/model_position.cc 2009-10-20 20:41:13 UTC (rev 
8317)
+++ code/stage/trunk/libstage/model_position.cc 2009-10-20 21:43:52 UTC (rev 
8318)
@@ -531,6 +531,8 @@
 
 void ModelPosition::PoseVis::Visualize( Model* mod, Camera* cam )
 {
+  (void)cam; // avoid warning about unused var
+
   ModelPosition* pos = dynamic_cast<ModelPosition*>(mod);
   
   // vizualize my estimated pose 
@@ -592,6 +594,8 @@
 
 void ModelPosition::WaypointVis::Visualize( Model* mod, Camera* cam )
 {
+  (void)cam; // avoid warning about unused var
+
   ModelPosition* pos = dynamic_cast<ModelPosition*>(mod);
   const std::vector<Waypoint>& waypoints = pos->waypoints;
 

Modified: code/stage/trunk/libstage/model_ranger.cc
===================================================================
--- code/stage/trunk/libstage/model_ranger.cc   2009-10-20 20:41:13 UTC (rev 
8317)
+++ code/stage/trunk/libstage/model_ranger.cc   2009-10-20 21:43:52 UTC (rev 
8318)
@@ -248,6 +248,8 @@
                                                                  Model* 
finder, 
                                                                  const void* 
dummy )
 {
+  (void)dummy; // avoid warning about unused var
+
   // Ignore myself, my children, and my ancestors.
   return( candidate->vis.ranger_return && !candidate->IsRelated( finder ) );
 }      
@@ -286,6 +288,8 @@
 
 void ModelRanger::DataVisualize( Camera* cam )
 {
+  (void)cam; // avoid warning about unused var
+
   if( sensors.size() < 1 )
     return;
        

Modified: code/stage/trunk/libstage/powerpack.cc
===================================================================
--- code/stage/trunk/libstage/powerpack.cc      2009-10-20 20:41:13 UTC (rev 
8317)
+++ code/stage/trunk/libstage/powerpack.cc      2009-10-20 21:43:52 UTC (rev 
8318)
@@ -53,6 +53,8 @@
 /** OpenGL visualization of the powerpack state */
 void PowerPack::Visualize( Camera* cam ) 
 {
+  (void)cam; // avoid warning about unused var
+
   const double height = 0.5;
   const double width = 0.2;
   
@@ -283,6 +285,8 @@
 
 void PowerPack::DissipationVis::Visualize( Model* mod, Camera* cam )
 {
+  (void)cam; // avoid warning about unused var
+
   // go into world coordinates
   
   glPushMatrix();
@@ -317,11 +321,11 @@
 {
   //printf( "accumulate %.2f %.2f %.2f\n", x, y, amount );
 
-  unsigned int ix = (x+width/2.0)/cellsize;
-  unsigned int iy = (y+height/2.0)/cellsize;
+  int ix = (x+width/2.0)/cellsize;
+  int iy = (y+height/2.0)/cellsize;
 
   // don't accumulate if we're outside the grid
-  if( ix < 0 || ix >= columns || iy < 0 || iy >= rows )
+  if( ix < 0 || ix >= int(columns) || iy < 0 || iy >= int(rows) )
                return;
        
   stg_joules_t& j = cells[ ix + (iy*columns) ];

Modified: code/stage/trunk/libstage/stage.hh
===================================================================
--- code/stage/trunk/libstage/stage.hh  2009-10-20 20:41:13 UTC (rev 8317)
+++ code/stage/trunk/libstage/stage.hh  2009-10-20 21:43:52 UTC (rev 8318)
@@ -333,7 +333,8 @@
     Velocity( stg_meters_t x, 
                                  stg_meters_t y, 
                                  stg_meters_t z,
-                                 stg_radians_t a ) 
+                                 stg_radians_t a ) :
+               Pose( x, y, z, a )
     { /*empty*/ }
     
     Velocity()
@@ -917,8 +918,11 @@
     { return stg_point_int_t( MetersToPixels(pt.x), MetersToPixels(pt.y)); };
                
     // dummy implementations to be overloaded by GUI subclasses
-    virtual void PushColor( Color col ) { /* do nothing */  };
-    virtual void PushColor( double r, double g, double b, double a ) { /* do 
nothing */  };
+    virtual void PushColor( Color col ) 
+        { /* do nothing */  (void)col; };
+    virtual void PushColor( double r, double g, double b, double a ) 
+        { /* do nothing */ (void)r; (void)g; (void)b; (void)a; };
+        
     virtual void PopColor(){ /* do nothing */  };
                
     SuperRegion* CreateSuperRegion( stg_point_int_t origin );
@@ -1646,7 +1650,7 @@
                  : callback(cb), arg(arg) {}
                        
                stg_cb_t( stg_world_callback_t cb, void* arg ) 
-                 : callback(NULL), arg(arg) {}
+                 : callback(NULL), arg(arg) { (void)cb; }
                        
                stg_cb_t() : callback(NULL), arg(NULL) {}
                        
@@ -2634,7 +2638,7 @@
         virtual void Save();
 
         /** Configure the gripper */
-        void SetConfig( config_t & newcfg ){ this->cfg = cfg; FixBlocks(); }
+        void SetConfig( config_t & newcfg ){ this->cfg = newcfg; FixBlocks(); }
         
         /** Returns the state of the gripper .*/
         config_t GetConfig(){ return cfg; };


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to