Revision: 8048
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8048&view=rev
Author:   thjc
Date:     2009-07-17 06:47:50 +0000 (Fri, 17 Jul 2009)

Log Message:
-----------
fixed some compiler warnings, added some extra getcwd error handling to stop 
some warnings

Modified Paths:
--------------
    code/stage/trunk/libstage/model_load.cc
    code/stage/trunk/libstage/worldfile.cc
    code/stage/trunk/libstageplugin/p_blobfinder.cc

Modified: code/stage/trunk/libstage/model_load.cc
===================================================================
--- code/stage/trunk/libstage/model_load.cc     2009-07-17 05:39:05 UTC (rev 
8047)
+++ code/stage/trunk/libstage/model_load.cc     2009-07-17 06:47:50 UTC (rev 
8048)
@@ -301,7 +301,14 @@
 
   /* Initialise libltdl. */
   int errors = lt_dlinit();
-  assert(errors==0);
+  if (errors)
+  {
+    printf( "Libtool error: %s. Failed to init libtool. Quitting\n",
+      lt_dlerror() ); // report the error from libtool
+    puts( "libtool error #1" );
+    fflush( stdout );
+    exit(-1);
+  }
 
   lt_dlsetsearchpath( FileManager::stagePath().c_str() );
 

Modified: code/stage/trunk/libstage/worldfile.cc
===================================================================
--- code/stage/trunk/libstage/worldfile.cc      2009-07-17 05:39:05 UTC (rev 
8047)
+++ code/stage/trunk/libstage/worldfile.cc      2009-07-17 06:47:50 UTC (rev 
8048)
@@ -537,6 +537,11 @@
       char *tmp = strdup(this->filename);
       fullpath = new char[PATH_MAX];
       char* dummy = getcwd(fullpath, PATH_MAX);
+      if (!dummy)
+      {
+        PRINT_ERR2("unable to get cwd %d: %s", errno, strerror(errno));
+        return false;
+      }
       strcat( fullpath, "/" );
       strcat( fullpath, dirname(tmp));
       strcat( fullpath, "/" );
@@ -1663,6 +1668,12 @@
       char *tmp = strdup(this->filename);
                char* fullpath = new char[PATH_MAX];
       char* dummy = getcwd(fullpath, PATH_MAX);
+      if (!dummy)
+      {
+        PRINT_ERR2("unable to get cwd %d: %s", errno, strerror(errno));
+        return value;
+      }
+
       strcat( fullpath, "/" );
       strcat( fullpath, dirname(tmp));
       strcat( fullpath, "/" );

Modified: code/stage/trunk/libstageplugin/p_blobfinder.cc
===================================================================
--- code/stage/trunk/libstageplugin/p_blobfinder.cc     2009-07-17 05:39:05 UTC 
(rev 8047)
+++ code/stage/trunk/libstageplugin/p_blobfinder.cc     2009-07-17 06:47:50 UTC 
(rev 8048)
@@ -96,9 +96,9 @@
                  bfd.blobs[b].bottom = blobs[b].bottom;
 
                  bfd.blobs[b].color = 
-                        (uint8_t)(blobs[b].color.r*255.0) << 16 + 
-                        (uint8_t)(blobs[b].color.g*255.0) << 8 + 
-                        (uint8_t)(blobs[b].color.b*255.0);
+                        ((uint8_t)(blobs[b].color.r*255.0) << 16) +
+                        ((uint8_t)(blobs[b].color.g*255.0) << 8) +
+                        ((uint8_t)(blobs[b].color.b*255.0));
                         
                  bfd.blobs[b].area  = dx * dy;
 


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

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to