From DONOTREPLY at icculus.org Mon Oct 1 11:47:07 2007 From: DONOTREPLY at icculus.org (DONOTREPLY at icculus.org) Date: 1 Oct 2007 11:47:07 -0400 Subject: r916 - trunk/platform Message-ID: <20071001154707.2439.qmail@icculus.org> Author: icculus Date: 2007-10-01 11:47:07 -0400 (Mon, 01 Oct 2007) New Revision: 916 Modified: trunk/platform/windows.c Log: Minor windows cleanups. Modified: trunk/platform/windows.c =================================================================== --- trunk/platform/windows.c 2007-07-12 10:37:56 UTC (rev 915) +++ trunk/platform/windows.c 2007-10-01 15:47:07 UTC (rev 916) @@ -360,7 +360,6 @@ static char *getExePath(void) { DWORD buflen = 64; - int success = 0; LPWSTR modpath = NULL; char *retval = NULL; @@ -797,6 +796,8 @@ /* this could probably use a cleanup. */ char *__PHYSFS_platformRealPath(const char *path) { + /* !!! FIXME: this should return NULL if (path) doesn't exist? */ + /* !!! FIXME: Need to handle symlinks in Vista... */ /* !!! FIXME: try GetFullPathName() instead? */ /* this function should be UTF-8 clean. */ char *retval = NULL; @@ -934,14 +935,14 @@ * * Returns non-zero if successful, otherwise it returns zero on failure. */ - static int getOSInfo(void) - { - OSVERSIONINFO osVerInfo; /* Information about the OS */ - osVerInfo.dwOSVersionInfoSize = sizeof(osVerInfo); - BAIL_IF_MACRO(!GetVersionEx(&osVerInfo), winApiStrError(), 0); - osHasUnicode = (osVerInfo.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS); - return(1); - } /* getOSInfo */ +static int getOSInfo(void) +{ + OSVERSIONINFO osVerInfo; /* Information about the OS */ + osVerInfo.dwOSVersionInfoSize = sizeof(osVerInfo); + BAIL_IF_MACRO(!GetVersionEx(&osVerInfo), winApiStrError(), 0); + osHasUnicode = (osVerInfo.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS); + return(1); +} /* getOSInfo */ int __PHYSFS_platformInit(void) From DONOTREPLY at icculus.org Mon Oct 1 11:47:40 2007 From: DONOTREPLY at icculus.org (DONOTREPLY at icculus.org) Date: 1 Oct 2007 11:47:40 -0400 Subject: r917 - branches/stable-1.0 branches/stable-1.0/platform trunk trunk/platform Message-ID: <20071001154740.2825.qmail@icculus.org> Author: icculus Date: 2007-10-01 11:47:40 -0400 (Mon, 01 Oct 2007) New Revision: 917 Modified: branches/stable-1.0/CHANGELOG branches/stable-1.0/platform/win32.c trunk/CHANGELOG.txt trunk/platform/windows.c Log: Mingw32 fix for 64-bit literals. Modified: branches/stable-1.0/CHANGELOG =================================================================== --- branches/stable-1.0/CHANGELOG 2007-10-01 15:47:07 UTC (rev 916) +++ branches/stable-1.0/CHANGELOG 2007-10-01 15:47:40 UTC (rev 917) @@ -4,6 +4,7 @@ -- stuff in the stable-1.0 branch, backported from 2.0.0 dev branch, etc --- +10012007 - More mingw32 fixes. 07122007 - Maybe fixed compile on mingw32. 07112007 - Fixed crash on zero-byte read/write (thanks, Ensiform!). 05052007 - Fixed zip archiver: could do bogus seek if a small, non-zip file Modified: branches/stable-1.0/platform/win32.c =================================================================== --- branches/stable-1.0/platform/win32.c 2007-10-01 15:47:07 UTC (rev 916) +++ branches/stable-1.0/platform/win32.c 2007-10-01 15:47:40 UTC (rev 917) @@ -29,10 +29,8 @@ #define alloca(x) __builtin_alloca(x) #endif -#define LOWORDER_UINT64(pos) (PHYSFS_uint32) \ - (pos & 0x00000000FFFFFFFF) -#define HIGHORDER_UINT64(pos) (PHYSFS_uint32) \ - (((pos & 0xFFFFFFFF00000000) >> 32) & 0x00000000FFFFFFFF) +#define LOWORDER_UINT64(pos) ((PHYSFS_uint32) (pos & 0xFFFFFFFF)) +#define HIGHORDER_UINT64(pos) ((PHYSFS_uint32) ((pos >> 32) & 0xFFFFFFFF)) /* GetUserProfileDirectory() is only available on >= NT4 (no 9x/ME systems!) */ typedef BOOL (STDMETHODCALLTYPE FAR * LPFNGETUSERPROFILEDIR) ( Modified: trunk/CHANGELOG.txt =================================================================== --- trunk/CHANGELOG.txt 2007-10-01 15:47:07 UTC (rev 916) +++ trunk/CHANGELOG.txt 2007-10-01 15:47:40 UTC (rev 917) @@ -2,6 +2,7 @@ * CHANGELOG. */ +10012007 - More mingw32 fixes. 07122007 - Maybe fixed compile on mingw32. 07112007 - Fixed crash on zero-byte read/write (thanks, Ensiform!). 05272007 - FIXME removal: Replaced a strncpy() with a memcpy(). Modified: trunk/platform/windows.c =================================================================== --- trunk/platform/windows.c 2007-10-01 15:47:07 UTC (rev 916) +++ trunk/platform/windows.c 2007-10-01 15:47:40 UTC (rev 917) @@ -26,10 +26,8 @@ #include "physfs_internal.h" -#define LOWORDER_UINT64(pos) (PHYSFS_uint32) \ - (pos & 0x00000000FFFFFFFF) -#define HIGHORDER_UINT64(pos) (PHYSFS_uint32) \ - (((pos & 0xFFFFFFFF00000000) >> 32) & 0x00000000FFFFFFFF) +#define LOWORDER_UINT64(pos) ((PHYSFS_uint32) (pos & 0xFFFFFFFF)) +#define HIGHORDER_UINT64(pos) ((PHYSFS_uint32) ((pos >> 32) & 0xFFFFFFFF)) /* * Users without the platform SDK don't have this defined. The original docs