Tabs-to-spaces patch by James Turk.
This commit is contained in:
parent
db279de4d1
commit
f4309f51e8
|
@ -899,9 +899,9 @@ static int zip_has_symlink_attr(ZIPentry *entry, PHYSFS_uint32 extern_attr)
|
||||||
static PHYSFS_sint64 zip_dos_time_to_physfs_time(PHYSFS_uint32 dostime)
|
static PHYSFS_sint64 zip_dos_time_to_physfs_time(PHYSFS_uint32 dostime)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32_WCE
|
#ifdef _WIN32_WCE
|
||||||
/* We have no struct tm and no mktime right now.
|
/* We have no struct tm and no mktime right now.
|
||||||
FIXME: This should probably be fixed at some point.
|
FIXME: This should probably be fixed at some point.
|
||||||
*/
|
*/
|
||||||
return -1;
|
return -1;
|
||||||
#else
|
#else
|
||||||
PHYSFS_uint32 dosdate;
|
PHYSFS_uint32 dosdate;
|
||||||
|
|
|
@ -118,8 +118,8 @@ static int MY_GETC(MY_FILETYPE *const fp) {
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
static char * MY_GETS(char * const str, const int size,
|
static char * MY_GETS(char * const str, const int size,
|
||||||
MY_FILETYPE *const fp) {
|
MY_FILETYPE *const fp) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int c;
|
int c;
|
||||||
do {
|
do {
|
||||||
|
@ -131,9 +131,9 @@ static char * MY_GETS(char * const str, const int size,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
str[i++] = c;
|
str[i++] = c;
|
||||||
} while (c != '\0' &&
|
} while (c != '\0' &&
|
||||||
c != -1 &&
|
c != -1 &&
|
||||||
c != '\n');
|
c != '\n');
|
||||||
str[i] = '\0';
|
str[i] = '\0';
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
44
physfs.c
44
physfs.c
|
@ -165,32 +165,32 @@ static void __PHYSFS_quick_sort(void *a, PHYSFS_uint32 lo, PHYSFS_uint32 hi,
|
||||||
PHYSFS_uint32 j;
|
PHYSFS_uint32 j;
|
||||||
PHYSFS_uint32 v;
|
PHYSFS_uint32 v;
|
||||||
|
|
||||||
if ((hi - lo) <= PHYSFS_QUICKSORT_THRESHOLD)
|
if ((hi - lo) <= PHYSFS_QUICKSORT_THRESHOLD)
|
||||||
__PHYSFS_bubble_sort(a, lo, hi, cmpfn, swapfn);
|
__PHYSFS_bubble_sort(a, lo, hi, cmpfn, swapfn);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
i = (hi + lo) / 2;
|
i = (hi + lo) / 2;
|
||||||
|
|
||||||
if (cmpfn(a, lo, i) > 0) swapfn(a, lo, i);
|
if (cmpfn(a, lo, i) > 0) swapfn(a, lo, i);
|
||||||
if (cmpfn(a, lo, hi) > 0) swapfn(a, lo, hi);
|
if (cmpfn(a, lo, hi) > 0) swapfn(a, lo, hi);
|
||||||
if (cmpfn(a, i, hi) > 0) swapfn(a, i, hi);
|
if (cmpfn(a, i, hi) > 0) swapfn(a, i, hi);
|
||||||
|
|
||||||
j = hi - 1;
|
j = hi - 1;
|
||||||
swapfn(a, i, j);
|
swapfn(a, i, j);
|
||||||
i = lo;
|
i = lo;
|
||||||
v = j;
|
v = j;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
while(cmpfn(a, ++i, v) < 0) { /* do nothing */ }
|
while(cmpfn(a, ++i, v) < 0) { /* do nothing */ }
|
||||||
while(cmpfn(a, --j, v) > 0) { /* do nothing */ }
|
while(cmpfn(a, --j, v) > 0) { /* do nothing */ }
|
||||||
if (j < i)
|
if (j < i)
|
||||||
break;
|
break;
|
||||||
swapfn(a, i, j);
|
swapfn(a, i, j);
|
||||||
} /* while */
|
} /* while */
|
||||||
swapfn(a, i, hi-1);
|
swapfn(a, i, hi-1);
|
||||||
__PHYSFS_quick_sort(a, lo, j, cmpfn, swapfn);
|
__PHYSFS_quick_sort(a, lo, j, cmpfn, swapfn);
|
||||||
__PHYSFS_quick_sort(a, i+1, hi, cmpfn, swapfn);
|
__PHYSFS_quick_sort(a, i+1, hi, cmpfn, swapfn);
|
||||||
} /* else */
|
} /* else */
|
||||||
} /* __PHYSFS_quick_sort */
|
} /* __PHYSFS_quick_sort */
|
||||||
|
|
||||||
|
|
||||||
|
@ -675,7 +675,7 @@ static char *calculateBaseDir(const char *argv0)
|
||||||
*/
|
*/
|
||||||
retval = __PHYSFS_platformCurrentDir();
|
retval = __PHYSFS_platformCurrentDir();
|
||||||
if(retval != NULL) {
|
if(retval != NULL) {
|
||||||
return(retval);
|
return(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1851,7 +1851,7 @@ PHYSFS_sint64 PHYSFS_fileLength(PHYSFS_file *handle)
|
||||||
int PHYSFS_setBuffer(PHYSFS_file *handle, PHYSFS_uint64 _bufsize)
|
int PHYSFS_setBuffer(PHYSFS_file *handle, PHYSFS_uint64 _bufsize)
|
||||||
{
|
{
|
||||||
FileHandle *h = (FileHandle *) handle->opaque;
|
FileHandle *h = (FileHandle *) handle->opaque;
|
||||||
PHYSFS_uint32 bufsize = (PHYSFS_uint32) _bufsize;
|
PHYSFS_uint32 bufsize = (PHYSFS_uint32) _bufsize;
|
||||||
|
|
||||||
BAIL_IF_MACRO(_bufsize > 0xFFFFFFFF, "buffer must fit in 32-bits", 0);
|
BAIL_IF_MACRO(_bufsize > 0xFFFFFFFF, "buffer must fit in 32-bits", 0);
|
||||||
BAIL_IF_MACRO(!PHYSFS_flush(handle), NULL, 0);
|
BAIL_IF_MACRO(!PHYSFS_flush(handle), NULL, 0);
|
||||||
|
|
|
@ -54,28 +54,28 @@
|
||||||
#ifndef PHYSFS_Swap16
|
#ifndef PHYSFS_Swap16
|
||||||
static __inline__ PHYSFS_uint16 PHYSFS_Swap16(PHYSFS_uint16 D)
|
static __inline__ PHYSFS_uint16 PHYSFS_Swap16(PHYSFS_uint16 D)
|
||||||
{
|
{
|
||||||
return((D<<8)|(D>>8));
|
return((D<<8)|(D>>8));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifndef PHYSFS_Swap32
|
#ifndef PHYSFS_Swap32
|
||||||
static __inline__ PHYSFS_uint32 PHYSFS_Swap32(PHYSFS_uint32 D)
|
static __inline__ PHYSFS_uint32 PHYSFS_Swap32(PHYSFS_uint32 D)
|
||||||
{
|
{
|
||||||
return((D<<24)|((D<<8)&0x00FF0000)|((D>>8)&0x0000FF00)|(D>>24));
|
return((D<<24)|((D<<8)&0x00FF0000)|((D>>8)&0x0000FF00)|(D>>24));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifndef PHYSFS_NO_64BIT_SUPPORT
|
#ifndef PHYSFS_NO_64BIT_SUPPORT
|
||||||
#ifndef PHYSFS_Swap64
|
#ifndef PHYSFS_Swap64
|
||||||
static __inline__ PHYSFS_uint64 PHYSFS_Swap64(PHYSFS_uint64 val) {
|
static __inline__ PHYSFS_uint64 PHYSFS_Swap64(PHYSFS_uint64 val) {
|
||||||
PHYSFS_uint32 hi, lo;
|
PHYSFS_uint32 hi, lo;
|
||||||
|
|
||||||
/* Separate into high and low 32-bit values and swap them */
|
/* Separate into high and low 32-bit values and swap them */
|
||||||
lo = (PHYSFS_uint32)(val&0xFFFFFFFF);
|
lo = (PHYSFS_uint32)(val&0xFFFFFFFF);
|
||||||
val >>= 32;
|
val >>= 32;
|
||||||
hi = (PHYSFS_uint32)(val&0xFFFFFFFF);
|
hi = (PHYSFS_uint32)(val&0xFFFFFFFF);
|
||||||
val = PHYSFS_Swap32(lo);
|
val = PHYSFS_Swap32(lo);
|
||||||
val <<= 32;
|
val <<= 32;
|
||||||
val |= PHYSFS_Swap32(hi);
|
val |= PHYSFS_Swap32(hi);
|
||||||
return(val);
|
return(val);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
|
@ -84,7 +84,7 @@ static __inline__ PHYSFS_uint64 PHYSFS_Swap64(PHYSFS_uint64 val) {
|
||||||
If there is no real 64-bit datatype, then compilers will complain about
|
If there is no real 64-bit datatype, then compilers will complain about
|
||||||
the fake 64-bit datatype that PHYSFS provides when it compiles user code.
|
the fake 64-bit datatype that PHYSFS provides when it compiles user code.
|
||||||
*/
|
*/
|
||||||
#define PHYSFS_Swap64(X) (X)
|
#define PHYSFS_Swap64(X) (X)
|
||||||
#endif
|
#endif
|
||||||
#endif /* PHYSFS_NO_64BIT_SUPPORT */
|
#endif /* PHYSFS_NO_64BIT_SUPPORT */
|
||||||
|
|
||||||
|
|
|
@ -622,15 +622,15 @@ typedef struct __PHYSFS_DIRFUNCTIONS__
|
||||||
int (*isSymLink)(DirHandle *r, const char *name, int *fileExists);
|
int (*isSymLink)(DirHandle *r, const char *name, int *fileExists);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Retrieve the last modification time (mtime) of a file.
|
* Retrieve the last modification time (mtime) of a file.
|
||||||
* Returns -1 on failure, or the file's mtime in seconds since
|
* Returns -1 on failure, or the file's mtime in seconds since
|
||||||
* the epoch (Jan 1, 1970) on success.
|
* the epoch (Jan 1, 1970) on success.
|
||||||
* This filename is in platform-independent notation.
|
* This filename is in platform-independent notation.
|
||||||
*
|
*
|
||||||
* Regardless of success or failure, please set *exists to
|
* Regardless of success or failure, please set *exists to
|
||||||
* non-zero if the file existed (even if it's a broken symlink!),
|
* non-zero if the file existed (even if it's a broken symlink!),
|
||||||
* zero if it did not.
|
* zero if it did not.
|
||||||
*/
|
*/
|
||||||
PHYSFS_sint64 (*getLastModTime)(DirHandle *r, const char *fnm, int *exist);
|
PHYSFS_sint64 (*getLastModTime)(DirHandle *r, const char *fnm, int *exist);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
#define __PHYSICSFS_INTERNAL__
|
#define __PHYSICSFS_INTERNAL__
|
||||||
#include "physfs_internal.h"
|
#include "physfs_internal.h"
|
||||||
|
|
||||||
#define INVALID_FILE_ATTRIBUTES 0xFFFFFFFF
|
#define INVALID_FILE_ATTRIBUTES 0xFFFFFFFF
|
||||||
#define INVALID_SET_FILE_POINTER 0xFFFFFFFF
|
#define INVALID_SET_FILE_POINTER 0xFFFFFFFF
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
HANDLE handle;
|
HANDLE handle;
|
||||||
|
@ -41,15 +41,15 @@ static const char *win32strerror(void)
|
||||||
TCHAR *ptr = msgbuf;
|
TCHAR *ptr = msgbuf;
|
||||||
|
|
||||||
FormatMessage(
|
FormatMessage(
|
||||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
FORMAT_MESSAGE_FROM_SYSTEM |
|
||||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||||
NULL,
|
NULL,
|
||||||
GetLastError(),
|
GetLastError(),
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
|
||||||
msgbuf,
|
msgbuf,
|
||||||
sizeof (msgbuf) / sizeof (TCHAR),
|
sizeof (msgbuf) / sizeof (TCHAR),
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
/* chop off newlines. */
|
/* chop off newlines. */
|
||||||
for (ptr = msgbuf; *ptr; ptr++)
|
for (ptr = msgbuf; *ptr; ptr++)
|
||||||
|
@ -71,23 +71,23 @@ static char *UnicodeToAsc(const wchar_t *w_str)
|
||||||
|
|
||||||
if(w_str!=NULL)
|
if(w_str!=NULL)
|
||||||
{
|
{
|
||||||
int len=wcslen(w_str)+1;
|
int len=wcslen(w_str)+1;
|
||||||
str=(char *)malloc(len);
|
str=(char *)malloc(len);
|
||||||
|
|
||||||
if(WideCharToMultiByte(CP_ACP,0,w_str,-1,str,len,NULL,NULL)==0)
|
if(WideCharToMultiByte(CP_ACP,0,w_str,-1,str,len,NULL,NULL)==0)
|
||||||
{ //Conversion failed
|
{ //Conversion failed
|
||||||
free(str);
|
free(str);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //Conversion successful
|
{ //Conversion successful
|
||||||
return(str);
|
return(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //Given NULL string
|
{ //Given NULL string
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,21 +96,21 @@ static wchar_t *AscToUnicode(const char *str)
|
||||||
wchar_t *w_str=NULL;
|
wchar_t *w_str=NULL;
|
||||||
if(str!=NULL)
|
if(str!=NULL)
|
||||||
{
|
{
|
||||||
int len=strlen(str)+1;
|
int len=strlen(str)+1;
|
||||||
w_str=(wchar_t *)malloc(sizeof(wchar_t)*len);
|
w_str=(wchar_t *)malloc(sizeof(wchar_t)*len);
|
||||||
if(MultiByteToWideChar(CP_ACP,0,str,-1,w_str,len)==0)
|
if(MultiByteToWideChar(CP_ACP,0,str,-1,w_str,len)==0)
|
||||||
{
|
{
|
||||||
free(w_str);
|
free(w_str);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return(w_str);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return NULL;
|
return(w_str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,16 +130,16 @@ static char *getExePath()
|
||||||
__PHYSFS_setError(win32strerror());
|
__PHYSFS_setError(win32strerror());
|
||||||
} else {
|
} else {
|
||||||
retval[buflen] = '\0'; /* does API always null-terminate this? */
|
retval[buflen] = '\0'; /* does API always null-terminate this? */
|
||||||
ptr = retval+buflen;
|
ptr = retval+buflen;
|
||||||
while( ptr != retval )
|
while( ptr != retval )
|
||||||
{
|
{
|
||||||
if( *ptr != _T('\\') ) {
|
if( *ptr != _T('\\') ) {
|
||||||
*ptr-- = _T('\0');
|
*ptr-- = _T('\0');
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
success = 1;
|
success = 1;
|
||||||
} /* else */
|
} /* else */
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
|
@ -156,7 +156,7 @@ static char *getExePath()
|
||||||
charretval = UnicodeToAsc(retval);
|
charretval = UnicodeToAsc(retval);
|
||||||
free(retval);
|
free(retval);
|
||||||
if(charretval == NULL) {
|
if(charretval == NULL) {
|
||||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(charretval); /* w00t. */
|
return(charretval); /* w00t. */
|
||||||
|
@ -220,11 +220,11 @@ int __PHYSFS_platformExists(const char *fname)
|
||||||
int retval=0;
|
int retval=0;
|
||||||
|
|
||||||
wchar_t *w_fname=AscToUnicode(fname);
|
wchar_t *w_fname=AscToUnicode(fname);
|
||||||
|
|
||||||
if(w_fname!=NULL)
|
if(w_fname!=NULL)
|
||||||
{
|
{
|
||||||
retval=(GetFileAttributes(w_fname) != INVALID_FILE_ATTRIBUTES);
|
retval=(GetFileAttributes(w_fname) != INVALID_FILE_ATTRIBUTES);
|
||||||
free(w_fname);
|
free(w_fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(retval);
|
return(retval);
|
||||||
|
@ -245,8 +245,8 @@ int __PHYSFS_platformIsDirectory(const char *fname)
|
||||||
|
|
||||||
if(w_fname!=NULL)
|
if(w_fname!=NULL)
|
||||||
{
|
{
|
||||||
retval=((GetFileAttributes(w_fname) & FILE_ATTRIBUTE_DIRECTORY) != 0);
|
retval=((GetFileAttributes(w_fname) & FILE_ATTRIBUTE_DIRECTORY) != 0);
|
||||||
free(w_fname);
|
free(w_fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(retval);
|
return(retval);
|
||||||
|
@ -258,8 +258,8 @@ char *__PHYSFS_platformCvtToDependent(const char *prepend,
|
||||||
const char *append)
|
const char *append)
|
||||||
{
|
{
|
||||||
int len = ((prepend) ? strlen(prepend) : 0) +
|
int len = ((prepend) ? strlen(prepend) : 0) +
|
||||||
((append) ? strlen(append) : 0) +
|
((append) ? strlen(append) : 0) +
|
||||||
strlen(dirName) + 1;
|
strlen(dirName) + 1;
|
||||||
char *retval = malloc(len);
|
char *retval = malloc(len);
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ LinkedStringList *__PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
|
|
||||||
/* Allocate a new string for path, maybe '\\', "*", and NULL terminator */
|
/* Allocate a new string for path, maybe '\\', "*", and NULL terminator */
|
||||||
SearchPath = (char *) alloca(len + 3);
|
SearchPath = (char *) alloca(len + 3);
|
||||||
BAIL_IF_MACRO(SearchPath == NULL, ERR_OUT_OF_MEMORY, NULL);
|
BAIL_IF_MACRO(SearchPath == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||||
|
|
||||||
/* Copy current dirname */
|
/* Copy current dirname */
|
||||||
strcpy(SearchPath, dirname);
|
strcpy(SearchPath, dirname);
|
||||||
|
@ -325,7 +325,7 @@ LinkedStringList *__PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
|
|
||||||
if(dir == INVALID_HANDLE_VALUE)
|
if(dir == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -340,7 +340,7 @@ LinkedStringList *__PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
if (l == NULL)
|
if (l == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
l->str=UnicodeToAsc(ent.cFileName);
|
l->str=UnicodeToAsc(ent.cFileName);
|
||||||
|
|
||||||
if (l->str == NULL)
|
if (l->str == NULL)
|
||||||
{
|
{
|
||||||
|
@ -385,17 +385,17 @@ int __PHYSFS_platformMkDir(const char *path)
|
||||||
wchar_t *w_path = AscToUnicode(path);
|
wchar_t *w_path = AscToUnicode(path);
|
||||||
if(w_path!=NULL)
|
if(w_path!=NULL)
|
||||||
{
|
{
|
||||||
DWORD rc = CreateDirectory(w_path, NULL);
|
DWORD rc = CreateDirectory(w_path, NULL);
|
||||||
free(w_path);
|
free(w_path);
|
||||||
if(rc==0)
|
if(rc==0)
|
||||||
{
|
{
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
} /* __PHYSFS_platformMkDir */
|
} /* __PHYSFS_platformMkDir */
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ static void *doOpen(const char *fname, DWORD mode, DWORD creation, int rdonly)
|
||||||
|
|
||||||
if(fileHandle==INVALID_HANDLE_VALUE)
|
if(fileHandle==INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
BAIL_IF_MACRO(fileHandle == INVALID_HANDLE_VALUE, win32strerror(), NULL);
|
BAIL_IF_MACRO(fileHandle == INVALID_HANDLE_VALUE, win32strerror(), NULL);
|
||||||
|
@ -421,8 +421,8 @@ static void *doOpen(const char *fname, DWORD mode, DWORD creation, int rdonly)
|
||||||
retval = malloc(sizeof (winCEfile));
|
retval = malloc(sizeof (winCEfile));
|
||||||
if (retval == NULL)
|
if (retval == NULL)
|
||||||
{
|
{
|
||||||
CloseHandle(fileHandle);
|
CloseHandle(fileHandle);
|
||||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
|
BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
retval->readonly = rdonly;
|
retval->readonly = rdonly;
|
||||||
|
@ -474,7 +474,7 @@ PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer,
|
||||||
/*!!! - uint32 might be a greater # than DWORD */
|
/*!!! - uint32 might be a greater # than DWORD */
|
||||||
if(!ReadFile(FileHandle, buffer, count * size, &CountOfBytesRead, NULL))
|
if(!ReadFile(FileHandle, buffer, count * size, &CountOfBytesRead, NULL))
|
||||||
{
|
{
|
||||||
retval=-1;
|
retval=-1;
|
||||||
} /* if */
|
} /* if */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -499,7 +499,7 @@ PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer,
|
||||||
/*!!! - uint32 might be a greater # than DWORD */
|
/*!!! - uint32 might be a greater # than DWORD */
|
||||||
if(!WriteFile(FileHandle, buffer, count * size, &CountOfBytesWritten, NULL))
|
if(!WriteFile(FileHandle, buffer, count * size, &CountOfBytesWritten, NULL))
|
||||||
{
|
{
|
||||||
retval=-1;
|
retval=-1;
|
||||||
} /* if */
|
} /* if */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -626,14 +626,14 @@ int __PHYSFS_platformDelete(const char *path)
|
||||||
/* If filename is a folder */
|
/* If filename is a folder */
|
||||||
if (GetFileAttributes(w_path) == FILE_ATTRIBUTE_DIRECTORY)
|
if (GetFileAttributes(w_path) == FILE_ATTRIBUTE_DIRECTORY)
|
||||||
{
|
{
|
||||||
int retval=!RemoveDirectory(w_path);
|
int retval=!RemoveDirectory(w_path);
|
||||||
free(w_path);
|
free(w_path);
|
||||||
BAIL_IF_MACRO(retval, win32strerror(), 0);
|
BAIL_IF_MACRO(retval, win32strerror(), 0);
|
||||||
} /* if */
|
} /* if */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int retval=!DeleteFile(w_path);
|
int retval=!DeleteFile(w_path);
|
||||||
free(w_path);
|
free(w_path);
|
||||||
BAIL_IF_MACRO(retval, win32strerror(), 0);
|
BAIL_IF_MACRO(retval, win32strerror(), 0);
|
||||||
} /* else */
|
} /* else */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue