Revision: 7793
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7793&view=rev
Author:   rtv
Date:     2009-06-05 19:02:15 +0000 (Fri, 05 Jun 2009)

Log Message:
-----------
applied Toby's crash-fixin' patch

Modified Paths:
--------------
    code/stage/trunk/CMakeLists.txt
    code/stage/trunk/libstage/world.cc

Modified: code/stage/trunk/CMakeLists.txt
===================================================================
--- code/stage/trunk/CMakeLists.txt     2009-06-05 16:16:45 UTC (rev 7792)
+++ code/stage/trunk/CMakeLists.txt     2009-06-05 19:02:15 UTC (rev 7793)
@@ -14,8 +14,6 @@
 OPTION (BUILD_LSPTEST "Build Player plugin tests" OFF)
 OPTION (CPACK_CFG "[release building] generate CPack configuration files" OFF)
 
-add_definitions(-O2 -g -Wall)
-
 # todo - this doesn't work yet. Run Stage headless with -g.
 # OPTION (BUILD_GUI "Build FLTK-based GUI. If OFF, build a gui-less Stage 
useful e.g. for headless compute clusters." ON ) 
 
@@ -41,6 +39,10 @@
 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in 
                                        ${CMAKE_CURRENT_SOURCE_DIR}/config.h 
@ONLY)
 
+# Enable -Wall by default
+SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
+SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+
 message( STATUS "Checking for libtool" )
 find_path( LTDL_INCLUDE_DIR ltdl.h DOC "Libtool include dir" )
 find_library( LTDL_LIB ltdl DOC "Libtool lib" )

Modified: code/stage/trunk/libstage/world.cc
===================================================================
--- code/stage/trunk/libstage/world.cc  2009-06-05 16:16:45 UTC (rev 7792)
+++ code/stage/trunk/libstage/world.cc  2009-06-05 19:02:15 UTC (rev 7793)
@@ -730,6 +730,7 @@
                                          n > 0 )
                                {                        
                                  //printf( "cx %d cy %d\n", cx, cy );
+                                 assert(c >= reg->cells);
                                  
                                  for( std::vector<Block*>::iterator it = 
c->blocks.begin();
                                                 it != c->blocks.end();
@@ -759,6 +760,8 @@
                                                  }                             
  
                                         }
                                  
+                                 assert (sx >= -2 && sx < 2);
+                                 assert (sy >= -2 && sy < 2);
                                  // increment our cell in the correct direction
                                  if( exy < 0 ) // we're iterating along X
                                         {
@@ -771,7 +774,7 @@
                                         {
                                                glob.y += sy; // global 
coordinate
                                                exy -= bx;                      
                        
-                                               c += sy * Region::WIDTH; // 
move the cell up or down
+                                               c += sy * static_cast<int> 
(Region::WIDTH); // move the cell up or down
                                                cy += sy; // cell coordinate 
for bounds checking
                                         }                       
                                  n--; // decrement the manhattan distance 
remaining


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

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to