r833 - in trunk: . archivers

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Mar 11 23:41:20 EDT 2007


Author: icculus
Date: 2007-03-11 23:41:20 -0400 (Sun, 11 Mar 2007)
New Revision: 833

Modified:
   trunk/CMakeLists.txt
   trunk/archivers/lzma.c
   trunk/physfs.c
Log:
Fixes for BeOS and gcc2.

Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2007-03-12 01:07:45 UTC (rev 832)
+++ trunk/CMakeLists.txt	2007-03-12 03:41:20 UTC (rev 833)
@@ -42,8 +42,13 @@
 # Add some gcc-specific command lines.
 IF(CMAKE_COMPILER_IS_GNUCC)
     # Always build with debug symbols...you can strip it later.
-    ADD_DEFINITIONS(-g -pipe -Wall -Werror -fsigned-char)
+    ADD_DEFINITIONS(-g -pipe -Werror -fsigned-char)
 
+    # Stupid BeOS generates warnings in the system headers.
+    IF(NOT BEOS)
+        ADD_DEFINITIONS(-Wall)
+    ENDIF(NOT BEOS)
+
     CHECK_C_SOURCE_COMPILES("
         #if ((defined(__GNUC__)) && (__GNUC__ >= 4))
         int main(int argc, char **argv) { int is_gcc4 = 1; return 0; }
@@ -92,6 +97,7 @@
     # We add this explicitly, since we don't want CMake to think this
     #  is a C++ project unless we're on BeOS.
     SET(PHYSFS_BEOS_SRCS platform/beos.cpp)
+    SET(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} be root)
 ENDIF(BEOS)
 
 # Almost everything is "compiled" here, but things that don't apply to the

Modified: trunk/archivers/lzma.c
===================================================================
--- trunk/archivers/lzma.c	2007-03-12 01:07:45 UTC (rev 832)
+++ trunk/archivers/lzma.c	2007-03-12 03:41:20 UTC (rev 833)
@@ -265,6 +265,10 @@
     PHYSFS_sint64 wantedSize = objSize*objCount;
     PHYSFS_sint64 remainingSize = entry->file->Size - entry->position;
 
+    size_t fileSize;
+    ISzAlloc allocImp;
+    ISzAlloc allocTempImp;
+
     BAIL_IF_MACRO(wantedSize == 0, NULL, 0); /* quick rejection. */
     BAIL_IF_MACRO(remainingSize == 0, ERR_PAST_EOF, 0);
 
@@ -276,10 +280,6 @@
         __PHYSFS_setError(ERR_PAST_EOF); /* this is always true here. */
     } /* if */
 
-    size_t fileSize;
-    ISzAlloc allocImp;
-    ISzAlloc allocTempImp;
-
     /* Prepare callbacks for 7z */
     allocImp.Alloc = SzAllocPhysicsFS;
     allocImp.Free = SzFreePhysicsFS;

Modified: trunk/physfs.c
===================================================================
--- trunk/physfs.c	2007-03-12 01:07:45 UTC (rev 832)
+++ trunk/physfs.c	2007-03-12 03:41:20 UTC (rev 833)
@@ -1503,10 +1503,12 @@
                                     const char *_fname, void *data)
 {
     size_t len = strlen(arcfname);
+    char *ptr = NULL;
+    char *end = NULL;
     char *mountPoint = (char *) alloca(strlen(i->mountPoint) + 1);
     strcpy(mountPoint, i->mountPoint);
-    char *ptr = mountPoint + ((len) ? len + 1 : 0);
-    char *end = strchr(ptr, '/');
+    ptr = mountPoint + ((len) ? len + 1 : 0);
+    end = strchr(ptr, '/');
     assert(end);  /* should always find a terminating '/'. */
     *end = '\0';
     callback(data, _fname, ptr);




More information about the physfs-commits mailing list