r848 - in trunk: . archivers lzma platform
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Mon Mar 19 03:44:16 EDT 2007
Author: icculus
Date: 2007-03-19 03:44:04 -0400 (Mon, 19 Mar 2007)
New Revision: 848
Modified:
trunk/
trunk/CMakeLists.txt
trunk/archivers/lzma.c
trunk/lzma/7zIn.c
trunk/physfs_internal.h
trunk/platform/windows.c
Log:
Patched to compile with latest Platform SDK.
Property changes on: trunk
___________________________________________________________________
Name: svn:ignore
- physfs.spec
docs
build
Debug
debug
Release
release
CMakeScripts
CMakeCache.txt
install_manifest.txt
test_physfs
CMakeTmp
CMakeFiles
Makefile
*.a
*.so
*.so.*
*.dylib
*.dll
*.exe
*.xcodeproj
*.build
*.vcproj
*.sln
*.cmake
*.make
*.log
*.dsp
*.dsw
*.dir
*.ncb
+ physfs.spec
docs
build
Debug
debug
Release
release
CMakeScripts
CMakeCache.txt
install_manifest.txt
test_physfs
CMakeTmp
CMakeFiles
Makefile
*.a
*.so
*.so.*
*.dylib
*.dll
*.exe
*.xcodeproj
*.build
*.vcproj
*.vcproj.*
*.sln
*.cmake
*.make
*.log
*.dsp
*.dsw
*.dir
*.ncb
*.suo
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt 2007-03-19 06:58:49 UTC (rev 847)
+++ trunk/CMakeLists.txt 2007-03-19 07:44:04 UTC (rev 848)
@@ -62,6 +62,11 @@
ENDIF(PHYSFS_IS_GCC4)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
+IF(MSVC)
+ # VS.NET 8.0 got really really anal about strcpy, etc, which even if we
+ # cleaned up our code, zlib, etc still use...so disable the warning.
+ ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS=1)
+ENDIF(MSVC)
# Basic chunks of source code ...
Modified: trunk/archivers/lzma.c
===================================================================
--- trunk/archivers/lzma.c 2007-03-19 06:58:49 UTC (rev 847)
+++ trunk/archivers/lzma.c 2007-03-19 07:44:04 UTC (rev 848)
@@ -86,7 +86,7 @@
PHYSFS_uint32 fileIndex; /* Index of file in archive */
PHYSFS_uint32 folderIndex; /* Index of folder in archive */
size_t offset; /* Offset in folder */
- PHYSFS_uint32 position; /* Current "virtual" position in file */
+ PHYSFS_uint64 position; /* Current "virtual" position in file */
} LZMAentry;
@@ -116,13 +116,13 @@
size_t *processedSize)
{
CFileInStream *s = (CFileInStream *)object;
- size_t processedSizeLoc;
+ PHYSFS_sint64 processedSizeLoc;
if (maxReqSize > kBufferSize)
maxReqSize = kBufferSize;
processedSizeLoc = __PHYSFS_platformRead(s->File, g_Buffer, 1, maxReqSize);
*buffer = g_Buffer;
- if (processedSize != 0)
- *processedSize = processedSizeLoc;
+ if (processedSize != NULL)
+ *processedSize = (size_t) processedSizeLoc;
return SZ_OK;
} /* SzFileReadImp */
@@ -313,10 +313,11 @@
} /* if */
/* Copy wanted bytes over from cache to outBuffer */
- strncpy(outBuffer,
+/* !!! FIXME: strncpy for non-string data? */
+ strncpy(outBuffer,
(void*) (entry->archive->folder[entry->folderIndex].cache +
entry->offset + entry->position),
- wantedSize);
+ (size_t) wantedSize);
entry->position += wantedSize;
return objCount;
} /* LZMA_read */
@@ -465,7 +466,7 @@
* Init with 0 so we know when a folder is already cached
* Values will be set by LZMA_read()
*/
- memset(archive->folder, 0, len);
+ memset(archive->folder, 0, (size_t) len);
return(archive);
} /* LZMA_openArchive */
Modified: trunk/lzma/7zIn.c
===================================================================
--- trunk/lzma/7zIn.c 2007-03-19 06:58:49 UTC (rev 847)
+++ trunk/lzma/7zIn.c 2007-03-19 07:44:04 UTC (rev 848)
@@ -188,8 +188,9 @@
size -= processedSize;
do
{
- *data++ = *(Byte*)inBuffer++;
- }
+ *(data++) = *((Byte*)inBuffer);
+ inBuffer = ((Byte*) inBuffer) + 1;
+ }
while (--processedSize != 0);
}
#else
Modified: trunk/physfs_internal.h
===================================================================
--- trunk/physfs_internal.h 2007-03-19 06:58:49 UTC (rev 847)
+++ trunk/physfs_internal.h 2007-03-19 07:44:04 UTC (rev 848)
@@ -24,6 +24,11 @@
#define assert(x)
#endif
+/* !!! FIXME: remove this when revamping stack allocation code... */
+#ifdef _MSC_VER
+#include <malloc.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -32,8 +37,8 @@
#define malloc(x) Do not use malloc() directly.
#define realloc(x, y) Do not use realloc() directly.
#define free(x) Do not use free() directly.
+/* !!! FIXME: add alloca check here. */
-
/* The LANG section. */
/* please send questions/translations to Ryan: icculus at icculus.org. */
Modified: trunk/platform/windows.c
===================================================================
--- trunk/platform/windows.c 2007-03-19 06:58:49 UTC (rev 847)
+++ trunk/platform/windows.c 2007-03-19 07:44:04 UTC (rev 848)
@@ -21,10 +21,12 @@
#include "physfs_internal.h"
-#if (defined _MSC_VER)
- #define alloca(x) _alloca(x)
-#elif (defined __MINGW32__) /* scary...hopefully this is okay. */
- #define alloca(x) __builtin_alloca(x)
+#if (!defined alloca)
+ #if ((defined _MSC_VER)
+ #define alloca(x) _alloca(x)
+ #elif (defined __MINGW32__) /* scary...hopefully this is okay. */
+ #define alloca(x) __builtin_alloca(x)
+ #endif
#endif
#define LOWORDER_UINT64(pos) (PHYSFS_uint32) \
More information about the physfs-commits
mailing list