Revision: 9047
          http://playerstage.svn.sourceforge.net/playerstage/?rev=9047&view=rev
Author:   jpgr87
Date:     2011-05-22 23:50:26 +0000 (Sun, 22 May 2011)

Log Message:
-----------
Applied patch #3305527: Solaris compatible patch again

Modified Paths:
--------------
    code/player/trunk/server/drivers/localization/ekfvloc/ekfvloc_driver.cc
    code/player/trunk/server/drivers/localization/ekfvloc/hregions.cc
    code/player/trunk/server/drivers/localization/ekfvloc/matrix.h
    code/player/trunk/server/drivers/mixed/mbase/motorpacket.cc
    code/player/trunk/server/drivers/position/differential/driver.cc

Modified: 
code/player/trunk/server/drivers/localization/ekfvloc/ekfvloc_driver.cc
===================================================================
--- code/player/trunk/server/drivers/localization/ekfvloc/ekfvloc_driver.cc     
2011-05-22 23:45:19 UTC (rev 9046)
+++ code/player/trunk/server/drivers/localization/ekfvloc/ekfvloc_driver.cc     
2011-05-22 23:50:26 UTC (rev 9047)
@@ -168,6 +168,8 @@
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <sys/types.h>
+#include <stddef.h>
+#include <unistd.h>
 
 #include <libplayercore/device.h>
 #include <libplayercore/driver.h>
@@ -249,7 +251,7 @@
     Pose GroundTruth(void);
 
     void PublishInterfaces(double timestamp); // Publish all output interfaces
-    
+
     bool PrepareDebug(int port); // False on failure
     void SendDebug(const GuiData &gui_data) const;
     void DrawDebug(const GuiData &gui_data);
@@ -306,9 +308,9 @@
             localize_.LoadMap(mapfile_.c_str());
             printf("Map loaded from %s\n", mapfile_.c_str());
         }
-        catch (exception &e)
+        catch (...)
         {
-            PLAYER_ERROR1("File could not be loaded: %s", e.what());
+            PLAYER_ERROR("File could not be loaded");
         }
     }
     else

Modified: code/player/trunk/server/drivers/localization/ekfvloc/hregions.cc
===================================================================
--- code/player/trunk/server/drivers/localization/ekfvloc/hregions.cc   
2011-05-22 23:45:19 UTC (rev 9046)
+++ code/player/trunk/server/drivers/localization/ekfvloc/hregions.cc   
2011-05-22 23:50:26 UTC (rev 9047)
@@ -47,7 +47,7 @@
     double sum            = 0.0;
     const int n           = 20;
     const double half_sum = n * 0.5;
-    const double dt_sum   = sqrt(n / 12);
+    const double dt_sum   = sqrt(static_cast<double>(n) / 12.0); // sqrt(int) 
fails to compile on SunCC, cast it to double
 
     for (int i = 0; i < n; i++)
         sum += rand() / RAND_MAX;

Modified: code/player/trunk/server/drivers/localization/ekfvloc/matrix.h
===================================================================
--- code/player/trunk/server/drivers/localization/ekfvloc/matrix.h      
2011-05-22 23:45:19 UTC (rev 9046)
+++ code/player/trunk/server/drivers/localization/ekfvloc/matrix.h      
2011-05-22 23:50:26 UTC (rev 9047)
@@ -98,7 +98,7 @@
 #pragma option -w-inl -w-pch
 #endif
 
-#if ( defined(__BORLANDC__) || _MSC_VER <= 1000 ) && !defined( __GNUG__ )
+#if ( defined(__BORLANDC__) || _MSC_VER <= 1000 ) && !defined( __GNUG__ ) && 
!defined(__SUNPRO_CC)
 #  include <stdio.h>
 #  include <stdlib.h>
 #  include <math.h>
@@ -110,6 +110,7 @@
 #  include <cstdlib>
 #  include <string>
 #  include <iostream>
+#  include <algorithm>
 #endif
 
 #if defined(_MSC_VER) && _MSC_VER <= 1000
@@ -132,6 +133,10 @@
 #  define _NO_EXCEPTION
 #endif
 
+#if defined(__SUNPRO_CC)
+#  define _NO_EXCEPTION
+#endif
+
 #if defined(_NO_EXCEPTION)
 #  define _NO_THROW
 #  define _THROW_MATRIX_ERROR

Modified: code/player/trunk/server/drivers/mixed/mbase/motorpacket.cc
===================================================================
--- code/player/trunk/server/drivers/mixed/mbase/motorpacket.cc 2011-05-22 
23:45:19 UTC (rev 9046)
+++ code/player/trunk/server/drivers/mixed/mbase/motorpacket.cc 2011-05-22 
23:50:26 UTC (rev 9047)
@@ -117,7 +117,7 @@
 
                data->position.vel.py = 0.0;
                //obtengo la velrot y veltrans (funcion inversa del veldrift)
-               int veltransCalculado = (int)(ceil ((this->lvel+this->rvel)/2));
+               int veltransCalculado = (int)(ceil 
(static_cast<double>((this->lvel+this->rvel)/2)));
                data->position.vel.px = (double)veltransCalculado / 1e3;
                data->position.vel.pa = 
(((double)this->lvel-this->rvel)/(robotParams[param_idx]->RobotWidth));
 

Modified: code/player/trunk/server/drivers/position/differential/driver.cc
===================================================================
--- code/player/trunk/server/drivers/position/differential/driver.cc    
2011-05-22 23:45:19 UTC (rev 9046)
+++ code/player/trunk/server/drivers/position/differential/driver.cc    
2011-05-22 23:50:26 UTC (rev 9047)
@@ -91,6 +91,10 @@
 #include <cmath>
 #include <stdexcept>
 
+#if defined(__SUNPRO_CC)
+using namespace std;
+#endif
+
 using namespace driver_differential;
 
 const int kNumMotors = 2;


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

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to