Cleaned up returns that look like function calls for my updated coding style.
This commit is contained in:
parent
17b2640d71
commit
595ac1da39
|
@ -77,14 +77,14 @@ static int matchesPattern(const char *fname, const char *wildcard,
|
|||
fnameptr++;
|
||||
|
||||
if (x != y)
|
||||
return(0);
|
||||
return 0;
|
||||
} /* else */
|
||||
} /* while */
|
||||
|
||||
while (*wildptr == '*')
|
||||
wildptr++;
|
||||
|
||||
return(*fnameptr == *wildptr);
|
||||
return (*fnameptr == *wildptr);
|
||||
} /* matchesPattern */
|
||||
|
||||
typedef struct
|
||||
|
@ -188,7 +188,7 @@ char **PHYSFSEXT_enumerateFilesWildcard(const char *dir, const char *wildcard,
|
|||
} /* if */
|
||||
|
||||
PHYSFS_freeList(list);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* PHYSFSEXT_enumerateFilesWildcard */
|
||||
|
||||
|
||||
|
@ -203,20 +203,20 @@ int main(int argc, char **argv)
|
|||
{
|
||||
printf("USAGE: %s <pattern> <caseSen>\n"
|
||||
" where <caseSen> is 1 or 0.\n", argv[0]);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_init(argv[0]))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_init(): %s\n", PHYSFS_getLastError());
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_addToSearchPath(".", 1))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_addToSearchPath(): %s\n", PHYSFS_getLastError());
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
flist = PHYSFSEXT_enumerateFilesWildcard("/", argv[1], atoi(argv[2]));
|
||||
|
@ -231,7 +231,7 @@ int main(int argc, char **argv)
|
|||
PHYSFSEXT_freeEnumeration(flist);
|
||||
PHYSFS_deinit();
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
} /* main */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -37,12 +37,12 @@ static int caseInsensitiveStringCompare(const char *x, const char *y)
|
|||
ux = toupper((int) *x);
|
||||
uy = toupper((int) *y);
|
||||
if (ux != uy)
|
||||
return((ux > uy) ? 1 : -1);
|
||||
return ((ux > uy) ? 1 : -1);
|
||||
x++;
|
||||
y++;
|
||||
} while ((ux) && (uy));
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
} /* caseInsensitiveStringCompare */
|
||||
|
||||
|
||||
|
@ -53,7 +53,7 @@ static int locateOneElement(char *buf)
|
|||
char **i;
|
||||
|
||||
if (PHYSFS_exists(buf))
|
||||
return(1); /* quick rejection: exists in current case. */
|
||||
return 1; /* quick rejection: exists in current case. */
|
||||
|
||||
ptr = strrchr(buf, '/'); /* find entry at end of path. */
|
||||
if (ptr == NULL)
|
||||
|
@ -75,13 +75,13 @@ static int locateOneElement(char *buf)
|
|||
{
|
||||
strcpy(ptr, *i); /* found a match. Overwrite with this case. */
|
||||
PHYSFS_freeList(rc);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
} /* for */
|
||||
|
||||
/* no match at all... */
|
||||
PHYSFS_freeList(rc);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* locateOneElement */
|
||||
|
||||
|
||||
|
@ -96,7 +96,7 @@ int PHYSFSEXT_locateCorrectCase(char *buf)
|
|||
|
||||
ptr = prevptr = buf;
|
||||
if (*ptr == '\0')
|
||||
return(0); /* Uh...I guess that's success. */
|
||||
return 0; /* Uh...I guess that's success. */
|
||||
|
||||
while (ptr = strchr(ptr + 1, '/'))
|
||||
{
|
||||
|
@ -104,11 +104,11 @@ int PHYSFSEXT_locateCorrectCase(char *buf)
|
|||
rc = locateOneElement(buf);
|
||||
*ptr = '/'; /* restore path separator */
|
||||
if (!rc)
|
||||
return(-2); /* missing element in path. */
|
||||
return -2; /* missing element in path. */
|
||||
} /* while */
|
||||
|
||||
/* check final element... */
|
||||
return(locateOneElement(buf) ? 0 : -1);
|
||||
return locateOneElement(buf ? 0 : -1);
|
||||
} /* PHYSFSEXT_locateCorrectCase */
|
||||
|
||||
|
||||
|
@ -122,35 +122,35 @@ int main(int argc, char **argv)
|
|||
if (!PHYSFS_init(argv[0]))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_init(): %s\n", PHYSFS_getLastError());
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_addToSearchPath(".", 1))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_addToSearchPath(): %s\n", PHYSFS_getLastError());
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_setWriteDir("."))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_setWriteDir(): %s\n", PHYSFS_getLastError());
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_mkdir("/a/b/c"))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_mkdir(): %s\n", PHYSFS_getLastError());
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_mkdir("/a/b/C"))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_mkdir(): %s\n", PHYSFS_getLastError());
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
f = PHYSFS_openWrite("/a/b/c/x.txt");
|
||||
|
@ -159,7 +159,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
fprintf(stderr, "PHYSFS_openWrite(): %s\n", PHYSFS_getLastError());
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
f = PHYSFS_openWrite("/a/b/C/X.txt");
|
||||
|
@ -168,7 +168,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
fprintf(stderr, "PHYSFS_openWrite(): %s\n", PHYSFS_getLastError());
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
strcpy(buf, "/a/b/c/x.txt");
|
||||
|
@ -211,7 +211,7 @@ int main(int argc, char **argv)
|
|||
PHYSFS_delete("/a/b");
|
||||
PHYSFS_delete("/a");
|
||||
PHYSFS_deinit();
|
||||
return(0);
|
||||
return 0;
|
||||
} /* main */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ static void *do_http(void *_args)
|
|||
close(args->sock);
|
||||
free(args->addr);
|
||||
free(args);
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* do_http */
|
||||
|
||||
|
||||
|
@ -202,7 +202,7 @@ static int create_listen_socket(short portnum)
|
|||
} /* if */
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* create_listen_socket */
|
||||
|
||||
|
||||
|
@ -244,13 +244,13 @@ int main(int argc, char **argv)
|
|||
if (argc == 1)
|
||||
{
|
||||
printf("USAGE: %s <archive1> [archive2 [... archiveN]]\n", argv[0]);
|
||||
return(42);
|
||||
return 42;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_init(argv[0]))
|
||||
{
|
||||
printf("PHYSFS_init() failed: %s\n", PHYSFS_getLastError());
|
||||
return(42);
|
||||
return 42;
|
||||
} /* if */
|
||||
|
||||
/* normally, this is bad practice, but oh well. */
|
||||
|
@ -266,7 +266,7 @@ int main(int argc, char **argv)
|
|||
if (listensocket < 0)
|
||||
{
|
||||
printf("listen socket failed to create.\n");
|
||||
return(42);
|
||||
return 42;
|
||||
} /* if */
|
||||
|
||||
while (1) /* infinite loop for now. */
|
||||
|
@ -278,13 +278,13 @@ int main(int argc, char **argv)
|
|||
{
|
||||
printf("accept() failed: %s\n", strerror(errno));
|
||||
close(listensocket);
|
||||
return(42);
|
||||
return 42;
|
||||
} /* if */
|
||||
|
||||
serve_http_request(s, &addr, len);
|
||||
} /* while */
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
} /* main */
|
||||
|
||||
/* end of physfshttpd.c ... */
|
||||
|
|
|
@ -40,18 +40,18 @@ static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence)
|
|||
{
|
||||
SDL_SetError("Can't find position in file: %s",
|
||||
PHYSFS_getLastError());
|
||||
return(-1);
|
||||
return -1;
|
||||
} /* if */
|
||||
|
||||
pos = (int) current;
|
||||
if ( ((PHYSFS_sint64) pos) != current )
|
||||
{
|
||||
SDL_SetError("Can't fit current file position in an int!");
|
||||
return(-1);
|
||||
return -1;
|
||||
} /* if */
|
||||
|
||||
if (offset == 0) /* this is a "tell" call. We're done. */
|
||||
return(pos);
|
||||
return pos;
|
||||
|
||||
pos += offset;
|
||||
} /* else if */
|
||||
|
@ -62,14 +62,14 @@ static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence)
|
|||
if (len == -1)
|
||||
{
|
||||
SDL_SetError("Can't find end of file: %s", PHYSFS_getLastError());
|
||||
return(-1);
|
||||
return -1;
|
||||
} /* if */
|
||||
|
||||
pos = (int) len;
|
||||
if ( ((PHYSFS_sint64) pos) != len )
|
||||
{
|
||||
SDL_SetError("Can't fit end-of-file position in an int!");
|
||||
return(-1);
|
||||
return -1;
|
||||
} /* if */
|
||||
|
||||
pos += offset;
|
||||
|
@ -78,22 +78,22 @@ static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence)
|
|||
else
|
||||
{
|
||||
SDL_SetError("Invalid 'whence' parameter.");
|
||||
return(-1);
|
||||
return -1;
|
||||
} /* else */
|
||||
|
||||
if ( pos < 0 )
|
||||
{
|
||||
SDL_SetError("Attempt to seek past start of file.");
|
||||
return(-1);
|
||||
return -1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_seek(handle, (PHYSFS_uint64) pos))
|
||||
{
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
return(-1);
|
||||
return -1;
|
||||
} /* if */
|
||||
|
||||
return(pos);
|
||||
return pos;
|
||||
} /* physfsrwops_seek */
|
||||
|
||||
|
||||
|
@ -107,7 +107,7 @@ static int physfsrwops_read(SDL_RWops *rw, void *ptr, int size, int maxnum)
|
|||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
} /* if */
|
||||
|
||||
return((int) rc);
|
||||
return ((int) rc);
|
||||
} /* physfsrwops_read */
|
||||
|
||||
|
||||
|
@ -118,7 +118,7 @@ static int physfsrwops_write(SDL_RWops *rw, const void *ptr, int size, int num)
|
|||
if (rc != num)
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
|
||||
return((int) rc);
|
||||
return ((int) rc);
|
||||
} /* physfsrwops_write */
|
||||
|
||||
|
||||
|
@ -128,11 +128,11 @@ static int physfsrwops_close(SDL_RWops *rw)
|
|||
if (!PHYSFS_close(handle))
|
||||
{
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
return(-1);
|
||||
return -1;
|
||||
} /* if */
|
||||
|
||||
SDL_FreeRW(rw);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* physfsrwops_close */
|
||||
|
||||
|
||||
|
@ -155,7 +155,7 @@ static SDL_RWops *create_rwops(PHYSFS_File *handle)
|
|||
} /* if */
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* create_rwops */
|
||||
|
||||
|
||||
|
@ -167,25 +167,25 @@ SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_File *handle)
|
|||
else
|
||||
retval = create_rwops(handle);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* PHYSFSRWOPS_makeRWops */
|
||||
|
||||
|
||||
SDL_RWops *PHYSFSRWOPS_openRead(const char *fname)
|
||||
{
|
||||
return(create_rwops(PHYSFS_openRead(fname)));
|
||||
return create_rwops(PHYSFS_openRead(fname));
|
||||
} /* PHYSFSRWOPS_openRead */
|
||||
|
||||
|
||||
SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname)
|
||||
{
|
||||
return(create_rwops(PHYSFS_openWrite(fname)));
|
||||
return create_rwops(PHYSFS_openWrite(fname));
|
||||
} /* PHYSFSRWOPS_openWrite */
|
||||
|
||||
|
||||
SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname)
|
||||
{
|
||||
return(create_rwops(PHYSFS_openAppend(fname)));
|
||||
return create_rwops(PHYSFS_openAppend(fname));
|
||||
} /* PHYSFSRWOPS_openAppend */
|
||||
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ int main(int argc, char **argv)
|
|||
if (!PHYSFS_init(argv[0]))
|
||||
{
|
||||
printf("PHYSFS_init() failed: %s\n", PHYSFS_getLastError());
|
||||
return(42);
|
||||
return 42;
|
||||
} /* if */
|
||||
|
||||
rc = PHYSFS_addToSearchPath(argv[0], 0);
|
||||
|
@ -49,7 +49,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
printf("Couldn't find self-extract data: %s\n", PHYSFS_getLastError());
|
||||
printf("This might mean you didn't append a zipfile to the binary.\n");
|
||||
return(42);
|
||||
return 42;
|
||||
} /* if */
|
||||
|
||||
char **files = PHYSFS_enumerateFiles("/");
|
||||
|
@ -61,6 +61,6 @@ int main(int argc, char **argv)
|
|||
} /* for */
|
||||
PHYSFS_freeList(files);
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
} /* main */
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ static PHYSFS_sint64 DIR_read(fvoid *opaque, void *buffer,
|
|||
{
|
||||
PHYSFS_sint64 retval;
|
||||
retval = __PHYSFS_platformRead(opaque, buffer, objSize, objCount);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* DIR_read */
|
||||
|
||||
|
||||
|
@ -28,31 +28,31 @@ static PHYSFS_sint64 DIR_write(fvoid *opaque, const void *buffer,
|
|||
{
|
||||
PHYSFS_sint64 retval;
|
||||
retval = __PHYSFS_platformWrite(opaque, buffer, objSize, objCount);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* DIR_write */
|
||||
|
||||
|
||||
static int DIR_eof(fvoid *opaque)
|
||||
{
|
||||
return(__PHYSFS_platformEOF(opaque));
|
||||
return __PHYSFS_platformEOF(opaque);
|
||||
} /* DIR_eof */
|
||||
|
||||
|
||||
static PHYSFS_sint64 DIR_tell(fvoid *opaque)
|
||||
{
|
||||
return(__PHYSFS_platformTell(opaque));
|
||||
return __PHYSFS_platformTell(opaque);
|
||||
} /* DIR_tell */
|
||||
|
||||
|
||||
static int DIR_seek(fvoid *opaque, PHYSFS_uint64 offset)
|
||||
{
|
||||
return(__PHYSFS_platformSeek(opaque, offset));
|
||||
return __PHYSFS_platformSeek(opaque, offset);
|
||||
} /* DIR_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 DIR_fileLength(fvoid *opaque)
|
||||
{
|
||||
return(__PHYSFS_platformFileLength(opaque));
|
||||
return __PHYSFS_platformFileLength(opaque);
|
||||
} /* DIR_fileLength */
|
||||
|
||||
|
||||
|
@ -65,14 +65,14 @@ static int DIR_fileClose(fvoid *opaque)
|
|||
*/
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformFlush(opaque), NULL, 0);
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformClose(opaque), NULL, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* DIR_fileClose */
|
||||
|
||||
|
||||
static int DIR_isArchive(const char *filename, int forWriting)
|
||||
{
|
||||
/* directories ARE archives in this driver... */
|
||||
return(__PHYSFS_platformIsDirectory(filename));
|
||||
return __PHYSFS_platformIsDirectory(filename);
|
||||
} /* DIR_isArchive */
|
||||
|
||||
|
||||
|
@ -95,7 +95,7 @@ static void *DIR_openArchive(const char *name, int forWriting)
|
|||
if (strcmp((name + namelen) - seplen, dirsep) != 0)
|
||||
strcat(retval, dirsep);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* DIR_openArchive */
|
||||
|
||||
|
||||
|
@ -121,7 +121,7 @@ static int DIR_exists(dvoid *opaque, const char *name)
|
|||
BAIL_IF_MACRO(f == NULL, NULL, 0);
|
||||
retval = __PHYSFS_platformExists(f);
|
||||
allocator.Free(f);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* DIR_exists */
|
||||
|
||||
|
||||
|
@ -135,7 +135,7 @@ static int DIR_isDirectory(dvoid *opaque, const char *name, int *fileExists)
|
|||
if (*fileExists)
|
||||
retval = __PHYSFS_platformIsDirectory(d);
|
||||
allocator.Free(d);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* DIR_isDirectory */
|
||||
|
||||
|
||||
|
@ -149,7 +149,7 @@ static int DIR_isSymLink(dvoid *opaque, const char *name, int *fileExists)
|
|||
if (*fileExists)
|
||||
retval = __PHYSFS_platformIsSymLink(f);
|
||||
allocator.Free(f);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* DIR_isSymLink */
|
||||
|
||||
|
||||
|
@ -165,7 +165,7 @@ static PHYSFS_sint64 DIR_getLastModTime(dvoid *opaque,
|
|||
if (*fileExists)
|
||||
retval = __PHYSFS_platformGetLastModTime(d);
|
||||
allocator.Free(d);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* DIR_getLastModTime */
|
||||
|
||||
|
||||
|
@ -184,32 +184,32 @@ static fvoid *doOpen(dvoid *opaque, const char *name,
|
|||
if (!(*fileExists))
|
||||
{
|
||||
allocator.Free(f);
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* if */
|
||||
} /* if */
|
||||
|
||||
rc = openFunc(f);
|
||||
allocator.Free(f);
|
||||
|
||||
return((fvoid *) rc);
|
||||
return ((fvoid *) rc);
|
||||
} /* doOpen */
|
||||
|
||||
|
||||
static fvoid *DIR_openRead(dvoid *opaque, const char *fnm, int *exist)
|
||||
{
|
||||
return(doOpen(opaque, fnm, __PHYSFS_platformOpenRead, exist));
|
||||
return doOpen(opaque, fnm, __PHYSFS_platformOpenRead, exist);
|
||||
} /* DIR_openRead */
|
||||
|
||||
|
||||
static fvoid *DIR_openWrite(dvoid *opaque, const char *filename)
|
||||
{
|
||||
return(doOpen(opaque, filename, __PHYSFS_platformOpenWrite, NULL));
|
||||
return doOpen(opaque, filename, __PHYSFS_platformOpenWrite, NULL);
|
||||
} /* DIR_openWrite */
|
||||
|
||||
|
||||
static fvoid *DIR_openAppend(dvoid *opaque, const char *filename)
|
||||
{
|
||||
return(doOpen(opaque, filename, __PHYSFS_platformOpenAppend, NULL));
|
||||
return doOpen(opaque, filename, __PHYSFS_platformOpenAppend, NULL);
|
||||
} /* DIR_openAppend */
|
||||
|
||||
|
||||
|
@ -221,7 +221,7 @@ static int DIR_remove(dvoid *opaque, const char *name)
|
|||
BAIL_IF_MACRO(f == NULL, NULL, 0);
|
||||
retval = __PHYSFS_platformDelete(f);
|
||||
allocator.Free(f);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* DIR_remove */
|
||||
|
||||
|
||||
|
@ -233,7 +233,7 @@ static int DIR_mkdir(dvoid *opaque, const char *name)
|
|||
BAIL_IF_MACRO(f == NULL, NULL, 0);
|
||||
retval = __PHYSFS_platformMkDir(f);
|
||||
allocator.Free(f);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* DIR_mkdir */
|
||||
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ static PHYSFS_sint64 GRP_read(fvoid *opaque, void *buffer,
|
|||
if (rc > 0)
|
||||
finfo->curPos += (PHYSFS_uint32) (rc * objSize);
|
||||
|
||||
return(rc);
|
||||
return rc;
|
||||
} /* GRP_read */
|
||||
|
||||
|
||||
|
@ -97,13 +97,13 @@ static int GRP_eof(fvoid *opaque)
|
|||
{
|
||||
GRPfileinfo *finfo = (GRPfileinfo *) opaque;
|
||||
GRPentry *entry = finfo->entry;
|
||||
return(finfo->curPos >= entry->size);
|
||||
return (finfo->curPos >= entry->size);
|
||||
} /* GRP_eof */
|
||||
|
||||
|
||||
static PHYSFS_sint64 GRP_tell(fvoid *opaque)
|
||||
{
|
||||
return(((GRPfileinfo *) opaque)->curPos);
|
||||
return ((GRPfileinfo *) opaque)->curPos;
|
||||
} /* GRP_tell */
|
||||
|
||||
|
||||
|
@ -119,14 +119,14 @@ static int GRP_seek(fvoid *opaque, PHYSFS_uint64 offset)
|
|||
if (rc)
|
||||
finfo->curPos = (PHYSFS_uint32) offset;
|
||||
|
||||
return(rc);
|
||||
return rc;
|
||||
} /* GRP_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 GRP_fileLength(fvoid *opaque)
|
||||
{
|
||||
GRPfileinfo *finfo = (GRPfileinfo *) opaque;
|
||||
return((PHYSFS_sint64) finfo->entry->size);
|
||||
return ((PHYSFS_sint64) finfo->entry->size);
|
||||
} /* GRP_fileLength */
|
||||
|
||||
|
||||
|
@ -135,7 +135,7 @@ static int GRP_fileClose(fvoid *opaque)
|
|||
GRPfileinfo *finfo = (GRPfileinfo *) opaque;
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformClose(finfo->handle), NULL, 0);
|
||||
allocator.Free(finfo);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* GRP_fileClose */
|
||||
|
||||
|
||||
|
@ -164,7 +164,7 @@ static int grp_open(const char *filename, int forWriting,
|
|||
|
||||
*count = PHYSFS_swapULE32(*count);
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
|
||||
openGrp_failed:
|
||||
if (*fh != NULL)
|
||||
|
@ -172,7 +172,7 @@ openGrp_failed:
|
|||
|
||||
*count = -1;
|
||||
*fh = NULL;
|
||||
return(0);
|
||||
return 0;
|
||||
} /* grp_open */
|
||||
|
||||
|
||||
|
@ -185,7 +185,7 @@ static int GRP_isArchive(const char *filename, int forWriting)
|
|||
if (fh != NULL)
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* GRP_isArchive */
|
||||
|
||||
|
||||
|
@ -194,7 +194,7 @@ static int grp_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
|||
if (one != two)
|
||||
{
|
||||
const GRPentry *a = (const GRPentry *) _a;
|
||||
return(strcmp(a[one].name, a[two].name));
|
||||
return (strcmp(a[one].name, a[two].name));
|
||||
} /* if */
|
||||
|
||||
return 0;
|
||||
|
@ -239,7 +239,7 @@ static int grp_load_entries(const char *name, int forWriting, GRPinfo *info)
|
|||
if (__PHYSFS_platformRead(fh, &entry->name, 12, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
entry->name[12] = '\0'; /* name isn't null-terminated in file. */
|
||||
|
@ -249,7 +249,7 @@ static int grp_load_entries(const char *name, int forWriting, GRPinfo *info)
|
|||
if (__PHYSFS_platformRead(fh, &entry->size, 4, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
entry->size = PHYSFS_swapULE32(entry->size);
|
||||
|
@ -261,7 +261,7 @@ static int grp_load_entries(const char *name, int forWriting, GRPinfo *info)
|
|||
|
||||
__PHYSFS_sort(info->entries, info->entryCount,
|
||||
grp_entry_cmp, grp_entry_swap);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* grp_load_entries */
|
||||
|
||||
|
||||
|
@ -282,7 +282,7 @@ static void *GRP_openArchive(const char *name, int forWriting)
|
|||
strcpy(info->filename, name);
|
||||
info->last_mod_time = modtime;
|
||||
|
||||
return(info);
|
||||
return info;
|
||||
|
||||
GRP_openArchive_failed:
|
||||
if (info != NULL)
|
||||
|
@ -294,7 +294,7 @@ GRP_openArchive_failed:
|
|||
allocator.Free(info);
|
||||
} /* if */
|
||||
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* GRP_openArchive */
|
||||
|
||||
|
||||
|
@ -338,7 +338,7 @@ static GRPentry *grp_find_entry(GRPinfo *info, const char *name)
|
|||
middle = lo + ((hi - lo) / 2);
|
||||
rc = strcmp(name, a[middle].name);
|
||||
if (rc == 0) /* found it! */
|
||||
return(&a[middle]);
|
||||
return &a[middle];
|
||||
else if (rc > 0)
|
||||
lo = middle + 1;
|
||||
else
|
||||
|
@ -351,21 +351,21 @@ static GRPentry *grp_find_entry(GRPinfo *info, const char *name)
|
|||
|
||||
static int GRP_exists(dvoid *opaque, const char *name)
|
||||
{
|
||||
return(grp_find_entry((GRPinfo *) opaque, name) != NULL);
|
||||
return (grp_find_entry((GRPinfo *) opaque, name) != NULL);
|
||||
} /* GRP_exists */
|
||||
|
||||
|
||||
static int GRP_isDirectory(dvoid *opaque, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = GRP_exists(opaque, name);
|
||||
return(0); /* never directories in a groupfile. */
|
||||
return 0; /* never directories in a groupfile. */
|
||||
} /* GRP_isDirectory */
|
||||
|
||||
|
||||
static int GRP_isSymLink(dvoid *opaque, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = GRP_exists(opaque, name);
|
||||
return(0); /* never symlinks in a groupfile. */
|
||||
return 0; /* never symlinks in a groupfile. */
|
||||
} /* GRP_isSymLink */
|
||||
|
||||
|
||||
|
@ -380,7 +380,7 @@ static PHYSFS_sint64 GRP_getLastModTime(dvoid *opaque,
|
|||
if (*fileExists) /* use time of GRP itself in the physical filesystem. */
|
||||
retval = info->last_mod_time;
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* GRP_getLastModTime */
|
||||
|
||||
|
||||
|
@ -402,12 +402,12 @@ static fvoid *GRP_openRead(dvoid *opaque, const char *fnm, int *fileExists)
|
|||
(!__PHYSFS_platformSeek(finfo->handle, entry->startPos)) )
|
||||
{
|
||||
allocator.Free(finfo);
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* if */
|
||||
|
||||
finfo->curPos = 0;
|
||||
finfo->entry = entry;
|
||||
return(finfo);
|
||||
return finfo;
|
||||
} /* GRP_openRead */
|
||||
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ static PHYSFS_sint64 HOG_read(fvoid *opaque, void *buffer,
|
|||
if (rc > 0)
|
||||
finfo->curPos += (PHYSFS_uint32) (rc * objSize);
|
||||
|
||||
return(rc);
|
||||
return rc;
|
||||
} /* HOG_read */
|
||||
|
||||
|
||||
|
@ -111,13 +111,13 @@ static int HOG_eof(fvoid *opaque)
|
|||
{
|
||||
HOGfileinfo *finfo = (HOGfileinfo *) opaque;
|
||||
HOGentry *entry = finfo->entry;
|
||||
return(finfo->curPos >= entry->size);
|
||||
return (finfo->curPos >= entry->size);
|
||||
} /* HOG_eof */
|
||||
|
||||
|
||||
static PHYSFS_sint64 HOG_tell(fvoid *opaque)
|
||||
{
|
||||
return(((HOGfileinfo *) opaque)->curPos);
|
||||
return ((HOGfileinfo *) opaque)->curPos;
|
||||
} /* HOG_tell */
|
||||
|
||||
|
||||
|
@ -133,14 +133,14 @@ static int HOG_seek(fvoid *opaque, PHYSFS_uint64 offset)
|
|||
if (rc)
|
||||
finfo->curPos = (PHYSFS_uint32) offset;
|
||||
|
||||
return(rc);
|
||||
return rc;
|
||||
} /* HOG_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 HOG_fileLength(fvoid *opaque)
|
||||
{
|
||||
HOGfileinfo *finfo = (HOGfileinfo *) opaque;
|
||||
return((PHYSFS_sint64) finfo->entry->size);
|
||||
return ((PHYSFS_sint64) finfo->entry->size);
|
||||
} /* HOG_fileLength */
|
||||
|
||||
|
||||
|
@ -149,7 +149,7 @@ static int HOG_fileClose(fvoid *opaque)
|
|||
HOGfileinfo *finfo = (HOGfileinfo *) opaque;
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformClose(finfo->handle), NULL, 0);
|
||||
allocator.Free(finfo);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* HOG_fileClose */
|
||||
|
||||
|
||||
|
@ -201,7 +201,7 @@ static int hog_open(const char *filename, int forWriting,
|
|||
if (!__PHYSFS_platformSeek(*fh, 3))
|
||||
goto openHog_failed;
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
|
||||
openHog_failed:
|
||||
if (*fh != NULL)
|
||||
|
@ -209,7 +209,7 @@ openHog_failed:
|
|||
|
||||
*count = -1;
|
||||
*fh = NULL;
|
||||
return(0);
|
||||
return 0;
|
||||
} /* hog_open */
|
||||
|
||||
|
||||
|
@ -222,7 +222,7 @@ static int HOG_isArchive(const char *filename, int forWriting)
|
|||
if (fh != NULL)
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* HOG_isArchive */
|
||||
|
||||
|
||||
|
@ -231,7 +231,7 @@ static int hog_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
|||
if (one != two)
|
||||
{
|
||||
const HOGentry *a = (const HOGentry *) _a;
|
||||
return(__PHYSFS_stricmpASCII(a[one].name, a[two].name));
|
||||
return __PHYSFS_stricmpASCII(a[one].name, a[two].name);
|
||||
} /* if */
|
||||
|
||||
return 0;
|
||||
|
@ -272,13 +272,13 @@ static int hog_load_entries(const char *name, int forWriting, HOGinfo *info)
|
|||
if (__PHYSFS_platformRead(fh, &entry->name, 13, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(fh, &entry->size, 4, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
entry->size = PHYSFS_swapULE32(entry->size);
|
||||
|
@ -286,14 +286,14 @@ static int hog_load_entries(const char *name, int forWriting, HOGinfo *info)
|
|||
if (entry->startPos == -1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Skip over entry */
|
||||
if (!__PHYSFS_platformSeek(fh, entry->startPos + entry->size))
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
} /* for */
|
||||
|
||||
|
@ -301,7 +301,7 @@ static int hog_load_entries(const char *name, int forWriting, HOGinfo *info)
|
|||
|
||||
__PHYSFS_sort(info->entries, info->entryCount,
|
||||
hog_entry_cmp, hog_entry_swap);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* hog_load_entries */
|
||||
|
||||
|
||||
|
@ -321,7 +321,7 @@ static void *HOG_openArchive(const char *name, int forWriting)
|
|||
strcpy(info->filename, name);
|
||||
info->last_mod_time = modtime;
|
||||
|
||||
return(info);
|
||||
return info;
|
||||
|
||||
HOG_openArchive_failed:
|
||||
if (info != NULL)
|
||||
|
@ -333,7 +333,7 @@ HOG_openArchive_failed:
|
|||
allocator.Free(info);
|
||||
} /* if */
|
||||
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* HOG_openArchive */
|
||||
|
||||
|
||||
|
@ -377,7 +377,7 @@ static HOGentry *hog_find_entry(HOGinfo *info, const char *name)
|
|||
middle = lo + ((hi - lo) / 2);
|
||||
rc = __PHYSFS_stricmpASCII(name, a[middle].name);
|
||||
if (rc == 0) /* found it! */
|
||||
return(&a[middle]);
|
||||
return &a[middle];
|
||||
else if (rc > 0)
|
||||
lo = middle + 1;
|
||||
else
|
||||
|
@ -390,21 +390,21 @@ static HOGentry *hog_find_entry(HOGinfo *info, const char *name)
|
|||
|
||||
static int HOG_exists(dvoid *opaque, const char *name)
|
||||
{
|
||||
return(hog_find_entry(((HOGinfo *) opaque), name) != NULL);
|
||||
return (hog_find_entry(((HOGinfo *) opaque), name) != NULL);
|
||||
} /* HOG_exists */
|
||||
|
||||
|
||||
static int HOG_isDirectory(dvoid *opaque, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = HOG_exists(opaque, name);
|
||||
return(0); /* never directories in a groupfile. */
|
||||
return 0; /* never directories in a groupfile. */
|
||||
} /* HOG_isDirectory */
|
||||
|
||||
|
||||
static int HOG_isSymLink(dvoid *opaque, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = HOG_exists(opaque, name);
|
||||
return(0); /* never symlinks in a groupfile. */
|
||||
return 0; /* never symlinks in a groupfile. */
|
||||
} /* HOG_isSymLink */
|
||||
|
||||
|
||||
|
@ -419,7 +419,7 @@ static PHYSFS_sint64 HOG_getLastModTime(dvoid *opaque,
|
|||
if (*fileExists) /* use time of HOG itself in the physical filesystem. */
|
||||
retval = info->last_mod_time;
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* HOG_getLastModTime */
|
||||
|
||||
|
||||
|
@ -441,12 +441,12 @@ static fvoid *HOG_openRead(dvoid *opaque, const char *fnm, int *fileExists)
|
|||
(!__PHYSFS_platformSeek(finfo->handle, entry->startPos)) )
|
||||
{
|
||||
allocator.Free(finfo);
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* if */
|
||||
|
||||
finfo->curPos = 0;
|
||||
finfo->entry = entry;
|
||||
return(finfo);
|
||||
return finfo;
|
||||
} /* HOG_openRead */
|
||||
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ static int lzma_file_cmp_stdlib(const void *key, const void *object)
|
|||
{
|
||||
const char *name = (const char *) key;
|
||||
LZMAfile *file = (LZMAfile *) object;
|
||||
return(strcmp(name, file->item->Name));
|
||||
return strcmp(name, file->item->Name);
|
||||
} /* lzma_file_cmp_posix */
|
||||
|
||||
|
||||
|
@ -186,7 +186,7 @@ static int lzma_file_cmp_stdlib(const void *key, const void *object)
|
|||
static int lzma_file_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
||||
{
|
||||
LZMAfile *files = (LZMAfile *) _a;
|
||||
return(strcmp(files[one].item->Name, files[two].item->Name));
|
||||
return strcmp(files[one].item->Name, files[two].item->Name);
|
||||
} /* lzma_file_cmp */
|
||||
|
||||
|
||||
|
@ -213,7 +213,7 @@ static LZMAfile * lzma_find_file(LZMAarchive *archive, const char *name)
|
|||
|
||||
BAIL_IF_MACRO(file == NULL, ERR_NO_SUCH_FILE, NULL);
|
||||
|
||||
return(file);
|
||||
return file;
|
||||
} /* lzma_find_file */
|
||||
|
||||
|
||||
|
@ -232,7 +232,7 @@ static int lzma_file_init(LZMAarchive *archive, PHYSFS_uint32 fileIndex)
|
|||
file->position = 0;
|
||||
file->offset = 0; /* Offset will be set by LZMA_read() */
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* lzma_load_file */
|
||||
|
||||
|
||||
|
@ -247,13 +247,13 @@ static int lzma_files_init(LZMAarchive *archive)
|
|||
{
|
||||
if (!lzma_file_init(archive, fileIndex))
|
||||
{
|
||||
return(0); // FALSE on failure
|
||||
return 0; // FALSE on failure
|
||||
}
|
||||
} /* for */
|
||||
|
||||
__PHYSFS_sort(archive->files, numFiles, lzma_file_cmp, lzma_file_swap);
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* lzma_load_files */
|
||||
|
||||
|
||||
|
@ -318,7 +318,7 @@ static int lzma_err(SZ_RESULT rc)
|
|||
__PHYSFS_setError(ERR_UNKNOWN_ERROR);
|
||||
} /* switch */
|
||||
|
||||
return(rc);
|
||||
return rc;
|
||||
} /* lzma_err */
|
||||
|
||||
|
||||
|
@ -433,7 +433,7 @@ static int LZMA_fileClose(fvoid *opaque)
|
|||
file->folder->cache = NULL;
|
||||
}
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* LZMA_fileClose */
|
||||
|
||||
|
||||
|
@ -457,7 +457,7 @@ static int LZMA_isArchive(const char *filename, int forWriting)
|
|||
__PHYSFS_platformClose(in);
|
||||
|
||||
/* Test whether sig is the 7z signature */
|
||||
return(TestSignatureCandidate(sig));
|
||||
return TestSignatureCandidate(sig);
|
||||
} /* LZMA_isArchive */
|
||||
|
||||
|
||||
|
@ -478,7 +478,7 @@ static void *LZMA_openArchive(const char *name, int forWriting)
|
|||
{
|
||||
__PHYSFS_platformClose(archive->stream.file);
|
||||
lzma_archive_exit(archive);
|
||||
return(NULL); // Error is set by platformOpenRead!
|
||||
return NULL; // Error is set by platformOpenRead!
|
||||
}
|
||||
|
||||
CrcGenerateTable();
|
||||
|
@ -534,7 +534,7 @@ static void *LZMA_openArchive(const char *name, int forWriting)
|
|||
BAIL_MACRO(ERR_UNKNOWN_ERROR, NULL);
|
||||
}
|
||||
|
||||
return(archive);
|
||||
return archive;
|
||||
} /* LZMA_openArchive */
|
||||
|
||||
|
||||
|
@ -603,7 +603,7 @@ static void LZMA_enumerateFiles(dvoid *opaque, const char *dname,
|
|||
static int LZMA_exists(dvoid *opaque, const char *name)
|
||||
{
|
||||
LZMAarchive *archive = (LZMAarchive *) opaque;
|
||||
return(lzma_find_file(archive, name) != NULL);
|
||||
return (lzma_find_file(archive, name) != NULL);
|
||||
} /* LZMA_exists */
|
||||
|
||||
|
||||
|
@ -619,7 +619,7 @@ static PHYSFS_sint64 LZMA_getLastModTime(dvoid *opaque,
|
|||
BAIL_IF_MACRO(file == NULL, NULL, -1);
|
||||
BAIL_IF_MACRO(!file->item->IsLastWriteTimeDefined, NULL, -1); // write-time may not be defined for every file
|
||||
|
||||
return(lzma_filetime_to_unix_timestamp(&file->item->LastWriteTime));
|
||||
return lzma_filetime_to_unix_timestamp(&file->item->LastWriteTime);
|
||||
} /* LZMA_getLastModTime */
|
||||
|
||||
|
||||
|
@ -630,7 +630,7 @@ static int LZMA_isDirectory(dvoid *opaque, const char *name, int *fileExists)
|
|||
|
||||
*fileExists = (file != NULL);
|
||||
|
||||
return(file == NULL ? 0 : file->item->IsDirectory);
|
||||
return ((file == NULL) ? 0 : file->item->IsDirectory);
|
||||
} /* LZMA_isDirectory */
|
||||
|
||||
|
||||
|
@ -652,7 +652,7 @@ static fvoid *LZMA_openRead(dvoid *opaque, const char *name, int *fileExists)
|
|||
file->position = 0;
|
||||
file->folder->references++; // Increase refcount for automatic cleanup...
|
||||
|
||||
return(file);
|
||||
return file;
|
||||
} /* LZMA_openRead */
|
||||
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ static PHYSFS_sint64 MVL_read(fvoid *opaque, void *buffer,
|
|||
if (rc > 0)
|
||||
finfo->curPos += (PHYSFS_uint32) (rc * objSize);
|
||||
|
||||
return(rc);
|
||||
return rc;
|
||||
} /* MVL_read */
|
||||
|
||||
|
||||
|
@ -100,13 +100,13 @@ static int MVL_eof(fvoid *opaque)
|
|||
{
|
||||
MVLfileinfo *finfo = (MVLfileinfo *) opaque;
|
||||
MVLentry *entry = finfo->entry;
|
||||
return(finfo->curPos >= entry->size);
|
||||
return (finfo->curPos >= entry->size);
|
||||
} /* MVL_eof */
|
||||
|
||||
|
||||
static PHYSFS_sint64 MVL_tell(fvoid *opaque)
|
||||
{
|
||||
return(((MVLfileinfo *) opaque)->curPos);
|
||||
return ((MVLfileinfo *) opaque)->curPos;
|
||||
} /* MVL_tell */
|
||||
|
||||
|
||||
|
@ -122,14 +122,14 @@ static int MVL_seek(fvoid *opaque, PHYSFS_uint64 offset)
|
|||
if (rc)
|
||||
finfo->curPos = (PHYSFS_uint32) offset;
|
||||
|
||||
return(rc);
|
||||
return rc;
|
||||
} /* MVL_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 MVL_fileLength(fvoid *opaque)
|
||||
{
|
||||
MVLfileinfo *finfo = (MVLfileinfo *) opaque;
|
||||
return((PHYSFS_sint64) finfo->entry->size);
|
||||
return ((PHYSFS_sint64) finfo->entry->size);
|
||||
} /* MVL_fileLength */
|
||||
|
||||
|
||||
|
@ -138,7 +138,7 @@ static int MVL_fileClose(fvoid *opaque)
|
|||
MVLfileinfo *finfo = (MVLfileinfo *) opaque;
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformClose(finfo->handle), NULL, 0);
|
||||
allocator.Free(finfo);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* MVL_fileClose */
|
||||
|
||||
|
||||
|
@ -167,7 +167,7 @@ static int mvl_open(const char *filename, int forWriting,
|
|||
|
||||
*count = PHYSFS_swapULE32(*count);
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
|
||||
openMvl_failed:
|
||||
if (*fh != NULL)
|
||||
|
@ -175,7 +175,7 @@ openMvl_failed:
|
|||
|
||||
*count = -1;
|
||||
*fh = NULL;
|
||||
return(0);
|
||||
return 0;
|
||||
} /* mvl_open */
|
||||
|
||||
|
||||
|
@ -188,7 +188,7 @@ static int MVL_isArchive(const char *filename, int forWriting)
|
|||
if (fh != NULL)
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* MVL_isArchive */
|
||||
|
||||
|
||||
|
@ -197,7 +197,7 @@ static int mvl_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
|||
if (one != two)
|
||||
{
|
||||
const MVLentry *a = (const MVLentry *) _a;
|
||||
return(strcmp(a[one].name, a[two].name));
|
||||
return strcmp(a[one].name, a[two].name);
|
||||
} /* if */
|
||||
|
||||
return 0;
|
||||
|
@ -241,13 +241,13 @@ static int mvl_load_entries(const char *name, int forWriting, MVLinfo *info)
|
|||
if (__PHYSFS_platformRead(fh, &entry->name, 13, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(fh, &entry->size, 4, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
entry->size = PHYSFS_swapULE32(entry->size);
|
||||
|
@ -259,7 +259,7 @@ static int mvl_load_entries(const char *name, int forWriting, MVLinfo *info)
|
|||
|
||||
__PHYSFS_sort(info->entries, info->entryCount,
|
||||
mvl_entry_cmp, mvl_entry_swap);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* mvl_load_entries */
|
||||
|
||||
|
||||
|
@ -278,7 +278,7 @@ static void *MVL_openArchive(const char *name, int forWriting)
|
|||
|
||||
strcpy(info->filename, name);
|
||||
info->last_mod_time = modtime;
|
||||
return(info);
|
||||
return info;
|
||||
|
||||
MVL_openArchive_failed:
|
||||
if (info != NULL)
|
||||
|
@ -290,7 +290,7 @@ MVL_openArchive_failed:
|
|||
allocator.Free(info);
|
||||
} /* if */
|
||||
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* MVL_openArchive */
|
||||
|
||||
|
||||
|
@ -334,7 +334,7 @@ static MVLentry *mvl_find_entry(MVLinfo *info, const char *name)
|
|||
middle = lo + ((hi - lo) / 2);
|
||||
rc = __PHYSFS_stricmpASCII(name, a[middle].name);
|
||||
if (rc == 0) /* found it! */
|
||||
return(&a[middle]);
|
||||
return &a[middle];
|
||||
else if (rc > 0)
|
||||
lo = middle + 1;
|
||||
else
|
||||
|
@ -347,21 +347,21 @@ static MVLentry *mvl_find_entry(MVLinfo *info, const char *name)
|
|||
|
||||
static int MVL_exists(dvoid *opaque, const char *name)
|
||||
{
|
||||
return(mvl_find_entry(((MVLinfo *) opaque), name) != NULL);
|
||||
return (mvl_find_entry((MVLinfo *) opaque, name) != NULL);
|
||||
} /* MVL_exists */
|
||||
|
||||
|
||||
static int MVL_isDirectory(dvoid *opaque, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = MVL_exists(opaque, name);
|
||||
return(0); /* never directories in a groupfile. */
|
||||
return 0; /* never directories in a groupfile. */
|
||||
} /* MVL_isDirectory */
|
||||
|
||||
|
||||
static int MVL_isSymLink(dvoid *opaque, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = MVL_exists(opaque, name);
|
||||
return(0); /* never symlinks in a groupfile. */
|
||||
return 0; /* never symlinks in a groupfile. */
|
||||
} /* MVL_isSymLink */
|
||||
|
||||
|
||||
|
@ -376,7 +376,7 @@ static PHYSFS_sint64 MVL_getLastModTime(dvoid *opaque,
|
|||
if (*fileExists) /* use time of MVL itself in the physical filesystem. */
|
||||
retval = info->last_mod_time;
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* MVL_getLastModTime */
|
||||
|
||||
|
||||
|
@ -398,12 +398,12 @@ static fvoid *MVL_openRead(dvoid *opaque, const char *fnm, int *fileExists)
|
|||
(!__PHYSFS_platformSeek(finfo->handle, entry->startPos)) )
|
||||
{
|
||||
allocator.Free(finfo);
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* if */
|
||||
|
||||
finfo->curPos = 0;
|
||||
finfo->entry = entry;
|
||||
return(finfo);
|
||||
return finfo;
|
||||
} /* MVL_openRead */
|
||||
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ static PHYSFS_sint64 QPAK_read(fvoid *opaque, void *buffer,
|
|||
if (rc > 0)
|
||||
finfo->curPos += (PHYSFS_uint32) (rc * objSize);
|
||||
|
||||
return(rc);
|
||||
return rc;
|
||||
} /* QPAK_read */
|
||||
|
||||
|
||||
|
@ -114,13 +114,13 @@ static int QPAK_eof(fvoid *opaque)
|
|||
{
|
||||
QPAKfileinfo *finfo = (QPAKfileinfo *) opaque;
|
||||
QPAKentry *entry = finfo->entry;
|
||||
return(finfo->curPos >= entry->size);
|
||||
return (finfo->curPos >= entry->size);
|
||||
} /* QPAK_eof */
|
||||
|
||||
|
||||
static PHYSFS_sint64 QPAK_tell(fvoid *opaque)
|
||||
{
|
||||
return(((QPAKfileinfo *) opaque)->curPos);
|
||||
return ((QPAKfileinfo *) opaque)->curPos;
|
||||
} /* QPAK_tell */
|
||||
|
||||
|
||||
|
@ -136,14 +136,14 @@ static int QPAK_seek(fvoid *opaque, PHYSFS_uint64 offset)
|
|||
if (rc)
|
||||
finfo->curPos = (PHYSFS_uint32) offset;
|
||||
|
||||
return(rc);
|
||||
return rc;
|
||||
} /* QPAK_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 QPAK_fileLength(fvoid *opaque)
|
||||
{
|
||||
QPAKfileinfo *finfo = (QPAKfileinfo *) opaque;
|
||||
return((PHYSFS_sint64) finfo->entry->size);
|
||||
return ((PHYSFS_sint64) finfo->entry->size);
|
||||
} /* QPAK_fileLength */
|
||||
|
||||
|
||||
|
@ -152,7 +152,7 @@ static int QPAK_fileClose(fvoid *opaque)
|
|||
QPAKfileinfo *finfo = (QPAKfileinfo *) opaque;
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformClose(finfo->handle), NULL, 0);
|
||||
allocator.Free(finfo);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* QPAK_fileClose */
|
||||
|
||||
|
||||
|
@ -190,7 +190,7 @@ static int qpak_open(const char *filename, int forWriting,
|
|||
goto openQpak_failed;
|
||||
|
||||
*count /= 64;
|
||||
return(1);
|
||||
return 1;
|
||||
|
||||
openQpak_failed:
|
||||
if (*fh != NULL)
|
||||
|
@ -198,7 +198,7 @@ openQpak_failed:
|
|||
|
||||
*count = -1;
|
||||
*fh = NULL;
|
||||
return(0);
|
||||
return 0;
|
||||
} /* qpak_open */
|
||||
|
||||
|
||||
|
@ -211,7 +211,7 @@ static int QPAK_isArchive(const char *filename, int forWriting)
|
|||
if (fh != NULL)
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* QPAK_isArchive */
|
||||
|
||||
|
||||
|
@ -220,7 +220,7 @@ static int qpak_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
|||
if (one != two)
|
||||
{
|
||||
const QPAKentry *a = (const QPAKentry *) _a;
|
||||
return(QPAK_strcmp(a[one].name, a[two].name));
|
||||
return QPAK_strcmp(a[one].name, a[two].name);
|
||||
} /* if */
|
||||
|
||||
return 0;
|
||||
|
@ -263,19 +263,19 @@ static int qpak_load_entries(const char *name, int forWriting, QPAKinfo *info)
|
|||
if (__PHYSFS_platformRead(fh,&entry->name,sizeof(entry->name),1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(fh,&loc,sizeof(loc),1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(fh,&entry->size,sizeof(entry->size),1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
entry->size = PHYSFS_swapULE32(entry->size);
|
||||
|
@ -286,7 +286,7 @@ static int qpak_load_entries(const char *name, int forWriting, QPAKinfo *info)
|
|||
|
||||
__PHYSFS_sort(info->entries, info->entryCount,
|
||||
qpak_entry_cmp, qpak_entry_swap);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* qpak_load_entries */
|
||||
|
||||
|
||||
|
@ -310,7 +310,7 @@ static void *QPAK_openArchive(const char *name, int forWriting)
|
|||
|
||||
strcpy(info->filename, name);
|
||||
info->last_mod_time = modtime;
|
||||
return(info);
|
||||
return info;
|
||||
|
||||
QPAK_openArchive_failed:
|
||||
if (info != NULL)
|
||||
|
@ -322,7 +322,7 @@ QPAK_openArchive_failed:
|
|||
allocator.Free(info);
|
||||
} /* if */
|
||||
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* QPAK_openArchive */
|
||||
|
||||
|
||||
|
@ -338,7 +338,7 @@ static PHYSFS_sint32 qpak_find_start_of_dir(QPAKinfo *info, const char *path,
|
|||
int rc;
|
||||
|
||||
if (*path == '\0') /* root dir? */
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
if ((dlen > 0) && (path[dlen - 1] == '/')) /* ignore trailing slash. */
|
||||
dlen--;
|
||||
|
@ -358,10 +358,10 @@ static PHYSFS_sint32 qpak_find_start_of_dir(QPAKinfo *info, const char *path,
|
|||
else
|
||||
{
|
||||
if (stop_on_first_find) /* Just checking dir's existance? */
|
||||
return(middle);
|
||||
return middle;
|
||||
|
||||
if (name[dlen + 1] == '\0') /* Skip initial dir entry. */
|
||||
return(middle + 1);
|
||||
return (middle + 1);
|
||||
|
||||
/* there might be more entries earlier in the list. */
|
||||
retval = middle;
|
||||
|
@ -375,7 +375,7 @@ static PHYSFS_sint32 qpak_find_start_of_dir(QPAKinfo *info, const char *path,
|
|||
hi = middle - 1;
|
||||
} /* while */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* qpak_find_start_of_dir */
|
||||
|
||||
|
||||
|
@ -473,11 +473,11 @@ static QPAKentry *qpak_find_entry(QPAKinfo *info, const char *path, int *isDir)
|
|||
{
|
||||
*isDir = (thispath[pathlen] == '/');
|
||||
if (*isDir)
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* if */
|
||||
|
||||
if (thispath[pathlen] == '\0') /* found entry? */
|
||||
return(&a[middle]);
|
||||
return &a[middle];
|
||||
else
|
||||
hi = middle - 1; /* adjust search params, try again. */
|
||||
} /* if */
|
||||
|
@ -495,7 +495,7 @@ static int QPAK_exists(dvoid *opaque, const char *name)
|
|||
int isDir;
|
||||
QPAKinfo *info = (QPAKinfo *) opaque;
|
||||
QPAKentry *entry = qpak_find_entry(info, name, &isDir);
|
||||
return((entry != NULL) || (isDir));
|
||||
return ((entry != NULL) || (isDir));
|
||||
} /* QPAK_exists */
|
||||
|
||||
|
||||
|
@ -507,7 +507,7 @@ static int QPAK_isDirectory(dvoid *opaque, const char *name, int *fileExists)
|
|||
|
||||
*fileExists = ((isDir) || (entry != NULL));
|
||||
if (isDir)
|
||||
return(1); /* definitely a dir. */
|
||||
return 1; /* definitely a dir. */
|
||||
|
||||
BAIL_MACRO(ERR_NO_SUCH_FILE, 0);
|
||||
} /* QPAK_isDirectory */
|
||||
|
@ -516,7 +516,7 @@ static int QPAK_isDirectory(dvoid *opaque, const char *name, int *fileExists)
|
|||
static int QPAK_isSymLink(dvoid *opaque, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = QPAK_exists(opaque, name);
|
||||
return(0); /* never symlinks in a quake pak. */
|
||||
return 0; /* never symlinks in a quake pak. */
|
||||
} /* QPAK_isSymLink */
|
||||
|
||||
|
||||
|
@ -533,7 +533,7 @@ static PHYSFS_sint64 QPAK_getLastModTime(dvoid *opaque,
|
|||
if (*fileExists) /* use time of QPAK itself in the physical filesystem. */
|
||||
retval = info->last_mod_time;
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* QPAK_getLastModTime */
|
||||
|
||||
|
||||
|
@ -557,12 +557,12 @@ static fvoid *QPAK_openRead(dvoid *opaque, const char *fnm, int *fileExists)
|
|||
(!__PHYSFS_platformSeek(finfo->handle, entry->startPos)) )
|
||||
{
|
||||
allocator.Free(finfo);
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* if */
|
||||
|
||||
finfo->curPos = 0;
|
||||
finfo->entry = entry;
|
||||
return(finfo);
|
||||
return finfo;
|
||||
} /* QPAK_openRead */
|
||||
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ static PHYSFS_sint64 WAD_read(fvoid *opaque, void *buffer,
|
|||
if (rc > 0)
|
||||
finfo->curPos += (PHYSFS_uint32) (rc * objSize);
|
||||
|
||||
return(rc);
|
||||
return rc;
|
||||
} /* WAD_read */
|
||||
|
||||
|
||||
|
@ -116,13 +116,13 @@ static int WAD_eof(fvoid *opaque)
|
|||
{
|
||||
WADfileinfo *finfo = (WADfileinfo *) opaque;
|
||||
WADentry *entry = finfo->entry;
|
||||
return(finfo->curPos >= entry->size);
|
||||
return (finfo->curPos >= entry->size);
|
||||
} /* WAD_eof */
|
||||
|
||||
|
||||
static PHYSFS_sint64 WAD_tell(fvoid *opaque)
|
||||
{
|
||||
return(((WADfileinfo *) opaque)->curPos);
|
||||
return ((WADfileinfo *) opaque)->curPos;
|
||||
} /* WAD_tell */
|
||||
|
||||
|
||||
|
@ -138,14 +138,14 @@ static int WAD_seek(fvoid *opaque, PHYSFS_uint64 offset)
|
|||
if (rc)
|
||||
finfo->curPos = (PHYSFS_uint32) offset;
|
||||
|
||||
return(rc);
|
||||
return rc;
|
||||
} /* WAD_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 WAD_fileLength(fvoid *opaque)
|
||||
{
|
||||
WADfileinfo *finfo = (WADfileinfo *) opaque;
|
||||
return((PHYSFS_sint64) finfo->entry->size);
|
||||
return ((PHYSFS_sint64) finfo->entry->size);
|
||||
} /* WAD_fileLength */
|
||||
|
||||
|
||||
|
@ -154,7 +154,7 @@ static int WAD_fileClose(fvoid *opaque)
|
|||
WADfileinfo *finfo = (WADfileinfo *) opaque;
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformClose(finfo->handle), NULL, 0);
|
||||
allocator.Free(finfo);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* WAD_fileClose */
|
||||
|
||||
|
||||
|
@ -188,7 +188,7 @@ static int wad_open(const char *filename, int forWriting,
|
|||
|
||||
*offset = PHYSFS_swapULE32(*offset);
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
|
||||
openWad_failed:
|
||||
if (*fh != NULL)
|
||||
|
@ -196,7 +196,7 @@ openWad_failed:
|
|||
|
||||
*count = -1;
|
||||
*fh = NULL;
|
||||
return(0);
|
||||
return 0;
|
||||
} /* wad_open */
|
||||
|
||||
|
||||
|
@ -209,7 +209,7 @@ static int WAD_isArchive(const char *filename, int forWriting)
|
|||
if (fh != NULL)
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* WAD_isArchive */
|
||||
|
||||
|
||||
|
@ -218,7 +218,7 @@ static int wad_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
|||
if (one != two)
|
||||
{
|
||||
const WADentry *a = (const WADentry *) _a;
|
||||
return(strcmp(a[one].name, a[two].name));
|
||||
return strcmp(a[one].name, a[two].name);
|
||||
} /* if */
|
||||
|
||||
return 0;
|
||||
|
@ -265,19 +265,19 @@ static int wad_load_entries(const char *name, int forWriting, WADinfo *info)
|
|||
if (__PHYSFS_platformRead(fh, &entry->startPos, 4, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(fh, &entry->size, 4, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(fh, &entry->name, 8, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
entry->name[8] = '\0'; /* name might not be null-terminated in file. */
|
||||
|
@ -289,7 +289,7 @@ static int wad_load_entries(const char *name, int forWriting, WADinfo *info)
|
|||
|
||||
__PHYSFS_sort(info->entries, info->entryCount,
|
||||
wad_entry_cmp, wad_entry_swap);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* wad_load_entries */
|
||||
|
||||
|
||||
|
@ -309,7 +309,7 @@ static void *WAD_openArchive(const char *name, int forWriting)
|
|||
|
||||
strcpy(info->filename, name);
|
||||
info->last_mod_time = modtime;
|
||||
return(info);
|
||||
return info;
|
||||
|
||||
WAD_openArchive_failed:
|
||||
if (info != NULL)
|
||||
|
@ -321,7 +321,7 @@ WAD_openArchive_failed:
|
|||
allocator.Free(info);
|
||||
} /* if */
|
||||
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* WAD_openArchive */
|
||||
|
||||
|
||||
|
@ -374,7 +374,7 @@ static WADentry *wad_find_entry(WADinfo *info, const char *name)
|
|||
middle = lo + ((hi - lo) / 2);
|
||||
rc = strcmp(name, a[middle].name);
|
||||
if (rc == 0) /* found it! */
|
||||
return(&a[middle]);
|
||||
return &a[middle];
|
||||
else if (rc > 0)
|
||||
lo = middle + 1;
|
||||
else
|
||||
|
@ -387,7 +387,7 @@ static WADentry *wad_find_entry(WADinfo *info, const char *name)
|
|||
|
||||
static int WAD_exists(dvoid *opaque, const char *name)
|
||||
{
|
||||
return(wad_find_entry(((WADinfo *) opaque), name) != NULL);
|
||||
return (wad_find_entry((WADinfo *) opaque, name) != NULL);
|
||||
} /* WAD_exists */
|
||||
|
||||
|
||||
|
@ -402,21 +402,21 @@ static int WAD_isDirectory(dvoid *opaque, const char *name, int *fileExists)
|
|||
|
||||
/* Can't be a directory if it's a subdirectory. */
|
||||
if (strchr(entry->name, '/') != NULL)
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
/* Check if it matches "MAP??" or "E?M?" ... */
|
||||
n = entry->name;
|
||||
if ((n[0] == 'E' && n[2] == 'M') ||
|
||||
(n[0] == 'M' && n[1] == 'A' && n[2] == 'P' && n[6] == 0))
|
||||
{
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
else
|
||||
{
|
||||
*fileExists = 0;
|
||||
return(0);
|
||||
return 0;
|
||||
} /* else */
|
||||
} /* WAD_isDirectory */
|
||||
|
||||
|
@ -424,7 +424,7 @@ static int WAD_isDirectory(dvoid *opaque, const char *name, int *fileExists)
|
|||
static int WAD_isSymLink(dvoid *opaque, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = WAD_exists(opaque, name);
|
||||
return(0); /* never symlinks in a wad. */
|
||||
return 0; /* never symlinks in a wad. */
|
||||
} /* WAD_isSymLink */
|
||||
|
||||
|
||||
|
@ -439,7 +439,7 @@ static PHYSFS_sint64 WAD_getLastModTime(dvoid *opaque,
|
|||
if (*fileExists) /* use time of WAD itself in the physical filesystem. */
|
||||
retval = info->last_mod_time;
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* WAD_getLastModTime */
|
||||
|
||||
|
||||
|
@ -461,12 +461,12 @@ static fvoid *WAD_openRead(dvoid *opaque, const char *fnm, int *fileExists)
|
|||
(!__PHYSFS_platformSeek(finfo->handle, entry->startPos)) )
|
||||
{
|
||||
allocator.Free(finfo);
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* if */
|
||||
|
||||
finfo->curPos = 0;
|
||||
finfo->entry = entry;
|
||||
return(finfo);
|
||||
return finfo;
|
||||
} /* WAD_openRead */
|
||||
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ typedef struct
|
|||
*/
|
||||
static voidpf zlibPhysfsAlloc(voidpf opaque, uInt items, uInt size)
|
||||
{
|
||||
return(((PHYSFS_Allocator *) opaque)->Malloc(items * size));
|
||||
return ((PHYSFS_Allocator *) opaque)->Malloc(items * size);
|
||||
} /* zlibPhysfsAlloc */
|
||||
|
||||
/*
|
||||
|
@ -145,17 +145,17 @@ static const char *zlib_error_string(int rc)
|
|||
{
|
||||
switch (rc)
|
||||
{
|
||||
case Z_OK: return(NULL); /* not an error. */
|
||||
case Z_STREAM_END: return(NULL); /* not an error. */
|
||||
case Z_OK: return NULL; /* not an error. */
|
||||
case Z_STREAM_END: return NULL; /* not an error. */
|
||||
#ifndef _WIN32_WCE
|
||||
case Z_ERRNO: return(strerror(errno));
|
||||
case Z_ERRNO: return strerror(errno);
|
||||
#endif
|
||||
case Z_NEED_DICT: return(ERR_NEED_DICT);
|
||||
case Z_DATA_ERROR: return(ERR_DATA_ERROR);
|
||||
case Z_MEM_ERROR: return(ERR_MEMORY_ERROR);
|
||||
case Z_BUF_ERROR: return(ERR_BUFFER_ERROR);
|
||||
case Z_VERSION_ERROR: return(ERR_VERSION_ERROR);
|
||||
default: return(ERR_UNKNOWN_ERROR);
|
||||
case Z_NEED_DICT: return ERR_NEED_DICT;
|
||||
case Z_DATA_ERROR: return ERR_DATA_ERROR;
|
||||
case Z_MEM_ERROR: return ERR_MEMORY_ERROR;
|
||||
case Z_BUF_ERROR: return ERR_BUFFER_ERROR;
|
||||
case Z_VERSION_ERROR: return ERR_VERSION_ERROR;
|
||||
default: return ERR_UNKNOWN_ERROR;
|
||||
} /* switch */
|
||||
} /* zlib_error_string */
|
||||
|
||||
|
@ -168,7 +168,7 @@ static int zlib_err(int rc)
|
|||
const char *str = zlib_error_string(rc);
|
||||
if (str != NULL)
|
||||
__PHYSFS_setError(str);
|
||||
return(rc);
|
||||
return rc;
|
||||
} /* zlib_err */
|
||||
|
||||
|
||||
|
@ -180,7 +180,7 @@ static int readui32(void *in, PHYSFS_uint32 *val)
|
|||
PHYSFS_uint32 v;
|
||||
BAIL_IF_MACRO(__PHYSFS_platformRead(in, &v, sizeof (v), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapULE32(v);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* readui32 */
|
||||
|
||||
|
||||
|
@ -192,7 +192,7 @@ static int readui16(void *in, PHYSFS_uint16 *val)
|
|||
PHYSFS_uint16 v;
|
||||
BAIL_IF_MACRO(__PHYSFS_platformRead(in, &v, sizeof (v), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapULE16(v);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* readui16 */
|
||||
|
||||
|
||||
|
@ -266,7 +266,7 @@ static PHYSFS_sint64 ZIP_read(fvoid *opaque, void *buf,
|
|||
if (retval > 0)
|
||||
finfo->uncompressed_position += (PHYSFS_uint32) (retval * objSize);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* ZIP_read */
|
||||
|
||||
|
||||
|
@ -280,13 +280,13 @@ static PHYSFS_sint64 ZIP_write(fvoid *opaque, const void *buf,
|
|||
static int ZIP_eof(fvoid *opaque)
|
||||
{
|
||||
ZIPfileinfo *finfo = (ZIPfileinfo *) opaque;
|
||||
return(finfo->uncompressed_position >= finfo->entry->uncompressed_size);
|
||||
return (finfo->uncompressed_position >= finfo->entry->uncompressed_size);
|
||||
} /* ZIP_eof */
|
||||
|
||||
|
||||
static PHYSFS_sint64 ZIP_tell(fvoid *opaque)
|
||||
{
|
||||
return(((ZIPfileinfo *) opaque)->uncompressed_position);
|
||||
return ((ZIPfileinfo *) opaque)->uncompressed_position;
|
||||
} /* ZIP_tell */
|
||||
|
||||
|
||||
|
@ -319,10 +319,10 @@ static int ZIP_seek(fvoid *opaque, PHYSFS_uint64 offset)
|
|||
z_stream str;
|
||||
initializeZStream(&str);
|
||||
if (zlib_err(inflateInit2(&str, -MAX_WBITS)) != Z_OK)
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
if (!__PHYSFS_platformSeek(in, entry->offset))
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
inflateEnd(&finfo->stream);
|
||||
memcpy(&finfo->stream, &str, sizeof (z_stream));
|
||||
|
@ -339,18 +339,18 @@ static int ZIP_seek(fvoid *opaque, PHYSFS_uint64 offset)
|
|||
maxread = sizeof (buf);
|
||||
|
||||
if (ZIP_read(finfo, buf, maxread, 1) != 1)
|
||||
return(0);
|
||||
return 0;
|
||||
} /* while */
|
||||
} /* else */
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* ZIP_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 ZIP_fileLength(fvoid *opaque)
|
||||
{
|
||||
ZIPfileinfo *finfo = (ZIPfileinfo *) opaque;
|
||||
return(finfo->entry->uncompressed_size);
|
||||
return finfo->entry->uncompressed_size;
|
||||
} /* ZIP_fileLength */
|
||||
|
||||
|
||||
|
@ -366,7 +366,7 @@ static int ZIP_fileClose(fvoid *opaque)
|
|||
allocator.Free(finfo->buffer);
|
||||
|
||||
allocator.Free(finfo);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* ZIP_fileClose */
|
||||
|
||||
|
||||
|
@ -416,14 +416,14 @@ static PHYSFS_sint64 zip_find_end_of_central_dir(void *in, PHYSFS_sint64 *len)
|
|||
if (totalread != 0)
|
||||
{
|
||||
if (__PHYSFS_platformRead(in, buf, maxread - 4, 1) != 1)
|
||||
return(-1);
|
||||
return -1;
|
||||
memcpy(&buf[maxread - 4], &extra, sizeof (extra));
|
||||
totalread += maxread - 4;
|
||||
} /* if */
|
||||
else
|
||||
{
|
||||
if (__PHYSFS_platformRead(in, buf, maxread, 1) != 1)
|
||||
return(-1);
|
||||
return -1;
|
||||
totalread += maxread;
|
||||
} /* else */
|
||||
|
||||
|
@ -454,7 +454,7 @@ static PHYSFS_sint64 zip_find_end_of_central_dir(void *in, PHYSFS_sint64 *len)
|
|||
if (len != NULL)
|
||||
*len = filelen;
|
||||
|
||||
return(filepos + i);
|
||||
return (filepos + i);
|
||||
} /* zip_find_end_of_central_dir */
|
||||
|
||||
|
||||
|
@ -486,7 +486,7 @@ static int ZIP_isArchive(const char *filename, int forWriting)
|
|||
} /* if */
|
||||
|
||||
__PHYSFS_platformClose(in);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* ZIP_isArchive */
|
||||
|
||||
|
||||
|
@ -537,11 +537,11 @@ static ZIPentry *zip_find_entry(ZIPinfo *info, const char *path, int *isDir)
|
|||
{
|
||||
*isDir = (thispath[pathlen] == '/');
|
||||
if (*isDir)
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* if */
|
||||
|
||||
if (thispath[pathlen] == '\0') /* found entry? */
|
||||
return(&a[middle]);
|
||||
return &a[middle];
|
||||
else
|
||||
hi = middle - 1; /* adjust search params, try again. */
|
||||
} /* if */
|
||||
|
@ -655,7 +655,7 @@ static ZIPentry *zip_follow_symlink(void *in, ZIPinfo *info, char *path)
|
|||
} /* if */
|
||||
|
||||
allocator.Free(path);
|
||||
return(entry);
|
||||
return entry;
|
||||
} /* zip_follow_symlink */
|
||||
|
||||
|
||||
|
@ -715,7 +715,7 @@ static int zip_resolve_symlink(void *in, ZIPinfo *info, ZIPentry *entry)
|
|||
entry->symlink = zip_follow_symlink(in, info, path);
|
||||
} /* else */
|
||||
|
||||
return(entry->symlink != NULL);
|
||||
return (entry->symlink != NULL);
|
||||
} /* zip_resolve_symlink */
|
||||
|
||||
|
||||
|
@ -755,7 +755,7 @@ static int zip_parse_local(void *in, ZIPentry *entry)
|
|||
BAIL_IF_MACRO(!readui16(in, &extralen), NULL, 0);
|
||||
|
||||
entry->offset += fnamelen + extralen + 30;
|
||||
return(1);
|
||||
return 1;
|
||||
} /* zip_parse_local */
|
||||
|
||||
|
||||
|
@ -800,7 +800,7 @@ static int zip_resolve(void *in, ZIPinfo *info, ZIPentry *entry)
|
|||
entry->resolved = ((retval) ? ZIP_RESOLVED : ZIP_BROKEN_FILE);
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* zip_resolve */
|
||||
|
||||
|
||||
|
@ -832,27 +832,24 @@ static int zip_version_does_symlinks(PHYSFS_uint32 version)
|
|||
break;
|
||||
} /* switch */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* zip_version_does_symlinks */
|
||||
|
||||
|
||||
static int zip_entry_is_symlink(const ZIPentry *entry)
|
||||
{
|
||||
return((entry->resolved == ZIP_UNRESOLVED_SYMLINK) ||
|
||||
(entry->resolved == ZIP_BROKEN_SYMLINK) ||
|
||||
(entry->symlink));
|
||||
return ((entry->resolved == ZIP_UNRESOLVED_SYMLINK) ||
|
||||
(entry->resolved == ZIP_BROKEN_SYMLINK) ||
|
||||
(entry->symlink));
|
||||
} /* zip_entry_is_symlink */
|
||||
|
||||
|
||||
static int zip_has_symlink_attr(ZIPentry *entry, PHYSFS_uint32 extern_attr)
|
||||
{
|
||||
PHYSFS_uint16 xattr = ((extern_attr >> 16) & 0xFFFF);
|
||||
|
||||
return (
|
||||
(zip_version_does_symlinks(entry->version)) &&
|
||||
(entry->uncompressed_size > 0) &&
|
||||
((xattr & UNIX_FILETYPE_MASK) == UNIX_FILETYPE_SYMLINK)
|
||||
);
|
||||
return ( (zip_version_does_symlinks(entry->version)) &&
|
||||
(entry->uncompressed_size > 0) &&
|
||||
((xattr & UNIX_FILETYPE_MASK) == UNIX_FILETYPE_SYMLINK) );
|
||||
} /* zip_has_symlink_attr */
|
||||
|
||||
|
||||
|
@ -884,7 +881,7 @@ static PHYSFS_sint64 zip_dos_time_to_physfs_time(PHYSFS_uint32 dostime)
|
|||
/* let mktime calculate daylight savings time. */
|
||||
unixtime.tm_isdst = -1;
|
||||
|
||||
return((PHYSFS_sint64) mktime(&unixtime));
|
||||
return ((PHYSFS_sint64) mktime(&unixtime));
|
||||
#endif
|
||||
} /* zip_dos_time_to_physfs_time */
|
||||
|
||||
|
@ -940,11 +937,11 @@ static int zip_load_entry(void *in, ZIPentry *entry, PHYSFS_uint32 ofs_fixup)
|
|||
if (!__PHYSFS_platformSeek(in, si64 + extralen + commentlen))
|
||||
goto zip_load_entry_puked;
|
||||
|
||||
return(1); /* success. */
|
||||
return 1; /* success. */
|
||||
|
||||
zip_load_entry_puked:
|
||||
allocator.Free(entry->name);
|
||||
return(0); /* failure. */
|
||||
return 0; /* failure. */
|
||||
} /* zip_load_entry */
|
||||
|
||||
|
||||
|
@ -953,7 +950,7 @@ static int zip_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
|||
if (one != two)
|
||||
{
|
||||
const ZIPentry *a = (const ZIPentry *) _a;
|
||||
return(strcmp(a[one].name, a[two].name));
|
||||
return strcmp(a[one].name, a[two].name);
|
||||
} /* if */
|
||||
|
||||
return 0;
|
||||
|
@ -990,12 +987,12 @@ static int zip_load_entries(void *in, ZIPinfo *info,
|
|||
if (!zip_load_entry(in, &info->entries[i], data_ofs))
|
||||
{
|
||||
zip_free_entries(info->entries, i);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
} /* for */
|
||||
|
||||
__PHYSFS_sort(info->entries, max, zip_entry_cmp, zip_entry_swap);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* zip_load_entries */
|
||||
|
||||
|
||||
|
@ -1062,7 +1059,7 @@ static int zip_parse_end_of_central_dir(void *in, ZIPinfo *info,
|
|||
*/
|
||||
BAIL_IF_MACRO((pos + 22 + ui16) != len, ERR_UNSUPPORTED_ARCHIVE, 0);
|
||||
|
||||
return(1); /* made it. */
|
||||
return 1; /* made it. */
|
||||
} /* zip_parse_end_of_central_dir */
|
||||
|
||||
|
||||
|
@ -1082,7 +1079,7 @@ static ZIPinfo *zip_create_zipinfo(const char *name)
|
|||
|
||||
info->archiveName = ptr;
|
||||
strcpy(info->archiveName, name);
|
||||
return(info);
|
||||
return info;
|
||||
} /* zip_create_zipinfo */
|
||||
|
||||
|
||||
|
@ -1108,7 +1105,7 @@ static void *ZIP_openArchive(const char *name, int forWriting)
|
|||
goto zip_openarchive_failed;
|
||||
|
||||
__PHYSFS_platformClose(in);
|
||||
return(info);
|
||||
return info;
|
||||
|
||||
zip_openarchive_failed:
|
||||
if (info != NULL)
|
||||
|
@ -1121,7 +1118,7 @@ zip_openarchive_failed:
|
|||
if (in != NULL)
|
||||
__PHYSFS_platformClose(in);
|
||||
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* ZIP_openArchive */
|
||||
|
||||
|
||||
|
@ -1137,7 +1134,7 @@ static PHYSFS_sint32 zip_find_start_of_dir(ZIPinfo *info, const char *path,
|
|||
int rc;
|
||||
|
||||
if (*path == '\0') /* root dir? */
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
if ((dlen > 0) && (path[dlen - 1] == '/')) /* ignore trailing slash. */
|
||||
dlen--;
|
||||
|
@ -1157,10 +1154,10 @@ static PHYSFS_sint32 zip_find_start_of_dir(ZIPinfo *info, const char *path,
|
|||
else
|
||||
{
|
||||
if (stop_on_first_find) /* Just checking dir's existance? */
|
||||
return(middle);
|
||||
return middle;
|
||||
|
||||
if (name[dlen + 1] == '\0') /* Skip initial dir entry. */
|
||||
return(middle + 1);
|
||||
return (middle + 1);
|
||||
|
||||
/* there might be more entries earlier in the list. */
|
||||
retval = middle;
|
||||
|
@ -1174,7 +1171,7 @@ static PHYSFS_sint32 zip_find_start_of_dir(ZIPinfo *info, const char *path,
|
|||
hi = middle - 1;
|
||||
} /* while */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* zip_find_start_of_dir */
|
||||
|
||||
|
||||
|
@ -1246,7 +1243,7 @@ static int ZIP_exists(dvoid *opaque, const char *name)
|
|||
int isDir;
|
||||
ZIPinfo *info = (ZIPinfo *) opaque;
|
||||
ZIPentry *entry = zip_find_entry(info, name, &isDir);
|
||||
return((entry != NULL) || (isDir));
|
||||
return ((entry != NULL) || (isDir));
|
||||
} /* ZIP_exists */
|
||||
|
||||
|
||||
|
@ -1260,10 +1257,10 @@ static PHYSFS_sint64 ZIP_getLastModTime(dvoid *opaque,
|
|||
|
||||
*fileExists = ((isDir) || (entry != NULL));
|
||||
if (isDir)
|
||||
return(1); /* Best I can do for a dir... */
|
||||
return 1; /* Best I can do for a dir... */
|
||||
|
||||
BAIL_IF_MACRO(entry == NULL, NULL, -1);
|
||||
return(entry->last_mod_time);
|
||||
return entry->last_mod_time;
|
||||
} /* ZIP_getLastModTime */
|
||||
|
||||
|
||||
|
@ -1275,7 +1272,7 @@ static int ZIP_isDirectory(dvoid *opaque, const char *name, int *fileExists)
|
|||
|
||||
*fileExists = ((isDir) || (entry != NULL));
|
||||
if (isDir)
|
||||
return(1); /* definitely a dir. */
|
||||
return 1; /* definitely a dir. */
|
||||
|
||||
/* Follow symlinks. This means we might need to resolve entries. */
|
||||
BAIL_IF_MACRO(entry == NULL, ERR_NO_SUCH_FILE, 0);
|
||||
|
@ -1288,13 +1285,13 @@ static int ZIP_isDirectory(dvoid *opaque, const char *name, int *fileExists)
|
|||
rc = zip_resolve(in, info, entry);
|
||||
__PHYSFS_platformClose(in);
|
||||
if (!rc)
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
BAIL_IF_MACRO(entry->resolved == ZIP_BROKEN_SYMLINK, NULL, 0);
|
||||
BAIL_IF_MACRO(entry->symlink == NULL, ERR_NOT_A_DIR, 0);
|
||||
|
||||
return(zip_find_start_of_dir(info, entry->symlink->name, 1) >= 0);
|
||||
return (zip_find_start_of_dir(info, entry->symlink->name, 1) >= 0);
|
||||
} /* ZIP_isDirectory */
|
||||
|
||||
|
||||
|
@ -1304,7 +1301,7 @@ static int ZIP_isSymLink(dvoid *opaque, const char *name, int *fileExists)
|
|||
const ZIPentry *entry = zip_find_entry((ZIPinfo *) opaque, name, &isDir);
|
||||
*fileExists = ((isDir) || (entry != NULL));
|
||||
BAIL_IF_MACRO(entry == NULL, NULL, 0);
|
||||
return(zip_entry_is_symlink(entry));
|
||||
return zip_entry_is_symlink(entry);
|
||||
} /* ZIP_isSymLink */
|
||||
|
||||
|
||||
|
@ -1328,7 +1325,7 @@ static void *zip_get_file_handle(const char *fn, ZIPinfo *inf, ZIPentry *entry)
|
|||
retval = NULL;
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* zip_get_file_handle */
|
||||
|
||||
|
||||
|
@ -1361,7 +1358,7 @@ static fvoid *ZIP_openRead(dvoid *opaque, const char *fnm, int *fileExists)
|
|||
if (zlib_err(inflateInit2(&finfo->stream, -MAX_WBITS)) != Z_OK)
|
||||
{
|
||||
ZIP_fileClose(finfo);
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* if */
|
||||
|
||||
finfo->buffer = (PHYSFS_uint8 *) allocator.Malloc(ZIP_READBUFSIZE);
|
||||
|
@ -1372,7 +1369,7 @@ static fvoid *ZIP_openRead(dvoid *opaque, const char *fnm, int *fileExists)
|
|||
} /* if */
|
||||
} /* if */
|
||||
|
||||
return(finfo);
|
||||
return finfo;
|
||||
} /* ZIP_openRead */
|
||||
|
||||
|
||||
|
|
182
src/physfs.c
182
src/physfs.c
|
@ -189,7 +189,7 @@ static char **doEnumStringList(void (*func)(PHYSFS_StringCallback, void *))
|
|||
func(enumStringListCallback, &ecd);
|
||||
BAIL_IF_MACRO(ecd.errorstr != NULL, ecd.errorstr, NULL);
|
||||
ecd.list[ecd.size] = NULL;
|
||||
return(ecd.list);
|
||||
return ecd.list;
|
||||
} /* doEnumStringList */
|
||||
|
||||
|
||||
|
@ -283,7 +283,7 @@ static ErrMsg *findErrorForCurrentThread(void)
|
|||
{
|
||||
if (errorLock != NULL)
|
||||
__PHYSFS_platformReleaseMutex(errorLock);
|
||||
return(i);
|
||||
return i;
|
||||
} /* if */
|
||||
} /* for */
|
||||
} /* if */
|
||||
|
@ -291,7 +291,7 @@ static ErrMsg *findErrorForCurrentThread(void)
|
|||
if (errorLock != NULL)
|
||||
__PHYSFS_platformReleaseMutex(errorLock);
|
||||
|
||||
return(NULL); /* no error available. */
|
||||
return NULL; /* no error available. */
|
||||
} /* findErrorForCurrentThread */
|
||||
|
||||
|
||||
|
@ -334,10 +334,10 @@ const char *PHYSFS_getLastError(void)
|
|||
ErrMsg *err = findErrorForCurrentThread();
|
||||
|
||||
if ((err == NULL) || (!err->errorAvailable))
|
||||
return(NULL);
|
||||
return NULL;
|
||||
|
||||
err->errorAvailable = 0;
|
||||
return(err->errorString);
|
||||
return err->errorString;
|
||||
} /* PHYSFS_getLastError */
|
||||
|
||||
|
||||
|
@ -383,7 +383,7 @@ static const char *find_filename_extension(const char *fname)
|
|||
if (retval != NULL)
|
||||
retval++; /* skip '.' */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* find_filename_extension */
|
||||
|
||||
|
||||
|
@ -409,7 +409,7 @@ static DirHandle *tryOpenDir(const PHYSFS_Archiver *funcs,
|
|||
} /* if */
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* tryOpenDir */
|
||||
|
||||
|
||||
|
@ -446,7 +446,7 @@ static DirHandle *openDirectory(const char *d, int forWriting)
|
|||
} /* else */
|
||||
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_UNSUPPORTED_ARCHIVE, NULL);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* openDirectory */
|
||||
|
||||
|
||||
|
@ -492,7 +492,7 @@ static int sanitizePlatformIndependentPath(const char *src, char *dst)
|
|||
*(dst++) = ch;
|
||||
} while (ch != '\0');
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* sanitizePlatformIndependentPath */
|
||||
|
||||
|
||||
|
@ -512,25 +512,25 @@ static int partOfMountPoint(DirHandle *h, char *fname)
|
|||
size_t len, mntpntlen;
|
||||
|
||||
if (h->mountPoint == NULL)
|
||||
return(0);
|
||||
return 0;
|
||||
else if (*fname == '\0')
|
||||
return(1);
|
||||
return 1;
|
||||
|
||||
len = strlen(fname);
|
||||
mntpntlen = strlen(h->mountPoint);
|
||||
if (len > mntpntlen) /* can't be a subset of mountpoint. */
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
/* if true, must be not a match or a complete match, but not a subset. */
|
||||
if ((len + 1) == mntpntlen)
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
rc = strncmp(fname, h->mountPoint, len); /* !!! FIXME: case insensitive? */
|
||||
if (rc != 0)
|
||||
return(0); /* not a match. */
|
||||
return 0; /* not a match. */
|
||||
|
||||
/* make sure /a/b matches /a/b/ and not /a/bc ... */
|
||||
return(h->mountPoint[len] == '/');
|
||||
return h->mountPoint[len] == '/';
|
||||
} /* partOfMountPoint */
|
||||
|
||||
|
||||
|
@ -568,7 +568,7 @@ static DirHandle *createDirHandle(const char *newDir,
|
|||
} /* if */
|
||||
|
||||
__PHYSFS_smallFree(tmpmntpnt);
|
||||
return(dirHandle);
|
||||
return dirHandle;
|
||||
|
||||
badDirHandle:
|
||||
if (dirHandle != NULL)
|
||||
|
@ -580,7 +580,7 @@ badDirHandle:
|
|||
} /* if */
|
||||
|
||||
__PHYSFS_smallFree(tmpmntpnt);
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* createDirHandle */
|
||||
|
||||
|
||||
|
@ -590,7 +590,7 @@ static int freeDirHandle(DirHandle *dh, FileHandle *openList)
|
|||
FileHandle *i;
|
||||
|
||||
if (dh == NULL)
|
||||
return(1);
|
||||
return 1;
|
||||
|
||||
for (i = openList; i != NULL; i = i->next)
|
||||
BAIL_IF_MACRO(i->dirHandle == dh, ERR_FILES_STILL_OPEN, 0);
|
||||
|
@ -599,7 +599,7 @@ static int freeDirHandle(DirHandle *dh, FileHandle *openList)
|
|||
allocator.Free(dh->dirName);
|
||||
allocator.Free(dh->mountPoint);
|
||||
allocator.Free(dh);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* freeDirHandle */
|
||||
|
||||
|
||||
|
@ -628,7 +628,7 @@ static char *calculateUserDir(void)
|
|||
allocator.Free((void *) uname);
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* calculateUserDir */
|
||||
|
||||
|
||||
|
@ -638,18 +638,18 @@ static int appendDirSep(char **dir)
|
|||
char *ptr;
|
||||
|
||||
if (strcmp((*dir + strlen(*dir)) - strlen(dirsep), dirsep) == 0)
|
||||
return(1);
|
||||
return 1;
|
||||
|
||||
ptr = (char *) allocator.Realloc(*dir, strlen(*dir) + strlen(dirsep) + 1);
|
||||
if (!ptr)
|
||||
{
|
||||
allocator.Free(*dir);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
strcat(ptr, dirsep);
|
||||
*dir = ptr;
|
||||
return(1);
|
||||
return 1;
|
||||
} /* appendDirSep */
|
||||
|
||||
|
||||
|
@ -662,7 +662,7 @@ static char *calculateBaseDir(const char *argv0)
|
|||
/* Give the platform layer first shot at this. */
|
||||
retval = __PHYSFS_platformCalcBaseDir(argv0);
|
||||
if (retval != NULL)
|
||||
return(retval);
|
||||
return retval;
|
||||
|
||||
/* We need argv0 to go on. */
|
||||
BAIL_IF_MACRO(argv0 == NULL, ERR_ARGV0_IS_NULL, NULL);
|
||||
|
@ -691,7 +691,7 @@ static char *calculateBaseDir(const char *argv0)
|
|||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
memcpy(retval, argv0, size);
|
||||
retval[size] = '\0';
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* if */
|
||||
|
||||
/* argv0 wasn't helpful. */
|
||||
|
@ -709,7 +709,7 @@ static int initializeMutexes(void)
|
|||
if (stateLock == NULL)
|
||||
goto initializeMutexes_failed;
|
||||
|
||||
return(1); /* success. */
|
||||
return 1; /* success. */
|
||||
|
||||
initializeMutexes_failed:
|
||||
if (errorLock != NULL)
|
||||
|
@ -719,7 +719,7 @@ initializeMutexes_failed:
|
|||
__PHYSFS_platformDestroyMutex(stateLock);
|
||||
|
||||
errorLock = stateLock = NULL;
|
||||
return(0); /* failed. */
|
||||
return 0; /* failed. */
|
||||
} /* initializeMutexes */
|
||||
|
||||
|
||||
|
@ -764,7 +764,7 @@ int PHYSFS_init(const char *argv0)
|
|||
{
|
||||
allocator.Free(baseDir);
|
||||
baseDir = NULL;
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
initialized = 1;
|
||||
|
@ -772,7 +772,7 @@ int PHYSFS_init(const char *argv0)
|
|||
/* This makes sure that the error subsystem is initialized. */
|
||||
__PHYSFS_setError(PHYSFS_getLastError());
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_init */
|
||||
|
||||
|
||||
|
@ -788,14 +788,14 @@ static int closeFileHandleList(FileHandle **list)
|
|||
if (!i->funcs->fileClose(i->opaque))
|
||||
{
|
||||
*list = i;
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
allocator.Free(i);
|
||||
} /* for */
|
||||
|
||||
*list = NULL;
|
||||
return(1);
|
||||
return 1;
|
||||
} /* closeFileHandleList */
|
||||
|
||||
|
||||
|
@ -852,19 +852,19 @@ int PHYSFS_deinit(void)
|
|||
allocator.Deinit();
|
||||
|
||||
errorLock = stateLock = NULL;
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_deinit */
|
||||
|
||||
|
||||
int PHYSFS_isInit(void)
|
||||
{
|
||||
return(initialized);
|
||||
return initialized;
|
||||
} /* PHYSFS_isInit */
|
||||
|
||||
|
||||
const PHYSFS_ArchiveInfo **PHYSFS_supportedArchiveTypes(void)
|
||||
{
|
||||
return(supported_types);
|
||||
return supported_types;
|
||||
} /* PHYSFS_supportedArchiveTypes */
|
||||
|
||||
|
||||
|
@ -883,13 +883,13 @@ void PHYSFS_freeList(void *list)
|
|||
|
||||
const char *PHYSFS_getDirSeparator(void)
|
||||
{
|
||||
return(__PHYSFS_platformDirSeparator);
|
||||
return __PHYSFS_platformDirSeparator;
|
||||
} /* PHYSFS_getDirSeparator */
|
||||
|
||||
|
||||
char **PHYSFS_getCdRomDirs(void)
|
||||
{
|
||||
return(doEnumStringList(__PHYSFS_platformDetectAvailableCDs));
|
||||
return doEnumStringList(__PHYSFS_platformDetectAvailableCDs);
|
||||
} /* PHYSFS_getCdRomDirs */
|
||||
|
||||
|
||||
|
@ -901,13 +901,13 @@ void PHYSFS_getCdRomDirsCallback(PHYSFS_StringCallback callback, void *data)
|
|||
|
||||
const char *PHYSFS_getBaseDir(void)
|
||||
{
|
||||
return(baseDir); /* this is calculated in PHYSFS_init()... */
|
||||
return baseDir; /* this is calculated in PHYSFS_init()... */
|
||||
} /* PHYSFS_getBaseDir */
|
||||
|
||||
|
||||
const char *PHYSFS_getUserDir(void)
|
||||
{
|
||||
return(userDir); /* this is calculated in PHYSFS_init()... */
|
||||
return userDir; /* this is calculated in PHYSFS_init()... */
|
||||
} /* PHYSFS_getUserDir */
|
||||
|
||||
|
||||
|
@ -920,7 +920,7 @@ const char *PHYSFS_getWriteDir(void)
|
|||
retval = writeDir->dirName;
|
||||
__PHYSFS_platformReleaseMutex(stateLock);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* PHYSFS_getWriteDir */
|
||||
|
||||
|
||||
|
@ -945,7 +945,7 @@ int PHYSFS_setWriteDir(const char *newDir)
|
|||
|
||||
__PHYSFS_platformReleaseMutex(stateLock);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* PHYSFS_setWriteDir */
|
||||
|
||||
|
||||
|
@ -986,13 +986,13 @@ int PHYSFS_mount(const char *newDir, const char *mountPoint, int appendToPath)
|
|||
} /* else */
|
||||
|
||||
__PHYSFS_platformReleaseMutex(stateLock);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_mount */
|
||||
|
||||
|
||||
int PHYSFS_addToSearchPath(const char *newDir, int appendToPath)
|
||||
{
|
||||
return(PHYSFS_mount(newDir, NULL, appendToPath));
|
||||
return PHYSFS_mount(newDir, NULL, appendToPath);
|
||||
} /* PHYSFS_addToSearchPath */
|
||||
|
||||
|
||||
|
@ -1029,7 +1029,7 @@ int PHYSFS_removeFromSearchPath(const char *oldDir)
|
|||
|
||||
char **PHYSFS_getSearchPath(void)
|
||||
{
|
||||
return(doEnumStringList(PHYSFS_getSearchPathCallback));
|
||||
return doEnumStringList(PHYSFS_getSearchPathCallback);
|
||||
} /* PHYSFS_getSearchPath */
|
||||
|
||||
|
||||
|
@ -1043,7 +1043,7 @@ const char *PHYSFS_getMountPoint(const char *dir)
|
|||
{
|
||||
const char *retval = ((i->mountPoint) ? i->mountPoint : "/");
|
||||
__PHYSFS_platformReleaseMutex(stateLock);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* if */
|
||||
} /* for */
|
||||
__PHYSFS_platformReleaseMutex(stateLock);
|
||||
|
@ -1166,7 +1166,7 @@ int PHYSFS_setSaneConfig(const char *organization, const char *appName,
|
|||
PHYSFS_freeList(rc);
|
||||
} /* if */
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_setSaneConfig */
|
||||
|
||||
|
||||
|
@ -1178,7 +1178,7 @@ void PHYSFS_permitSymbolicLinks(int allow)
|
|||
|
||||
int PHYSFS_symbolicLinksPermitted(void)
|
||||
{
|
||||
return(allowSymLinks);
|
||||
return allowSymLinks;
|
||||
} /* PHYSFS_symbolicLinksPermitted */
|
||||
|
||||
|
||||
|
@ -1249,7 +1249,7 @@ char *__PHYSFS_convertToDependent(const char *prepend,
|
|||
strcat(str, append);
|
||||
} /* if */
|
||||
|
||||
return(str);
|
||||
return str;
|
||||
} /* __PHYSFS_convertToDependent */
|
||||
|
||||
|
||||
|
@ -1281,7 +1281,7 @@ static int verifyPath(DirHandle *h, char **_fname, int allowMissing)
|
|||
char *end;
|
||||
|
||||
if (*fname == '\0') /* quick rejection. */
|
||||
return(1);
|
||||
return 1;
|
||||
|
||||
/* !!! FIXME: This codeblock sucks. */
|
||||
if (h->mountPoint != NULL) /* NULL mountpoint means "/". */
|
||||
|
@ -1337,7 +1337,7 @@ static int verifyPath(DirHandle *h, char **_fname, int allowMissing)
|
|||
} /* while */
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* verifyPath */
|
||||
|
||||
|
||||
|
@ -1381,7 +1381,7 @@ static int doMkdir(const char *_dname, char *dname)
|
|||
} /* while */
|
||||
|
||||
__PHYSFS_platformReleaseMutex(stateLock);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* doMkdir */
|
||||
|
||||
|
||||
|
@ -1397,7 +1397,7 @@ int PHYSFS_mkdir(const char *_dname)
|
|||
BAIL_IF_MACRO(dname == NULL, ERR_OUT_OF_MEMORY, 0);
|
||||
retval = doMkdir(_dname, dname);
|
||||
__PHYSFS_smallFree(dname);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* PHYSFS_mkdir */
|
||||
|
||||
|
||||
|
@ -1415,7 +1415,7 @@ static int doDelete(const char *_fname, char *fname)
|
|||
retval = h->funcs->remove(h->opaque, fname);
|
||||
|
||||
__PHYSFS_platformReleaseMutex(stateLock);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* doDelete */
|
||||
|
||||
|
||||
|
@ -1431,7 +1431,7 @@ int PHYSFS_delete(const char *_fname)
|
|||
BAIL_IF_MACRO(fname == NULL, ERR_OUT_OF_MEMORY, 0);
|
||||
retval = doDelete(_fname, fname);
|
||||
__PHYSFS_smallFree(fname);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* PHYSFS_delete */
|
||||
|
||||
|
||||
|
@ -1464,7 +1464,7 @@ const char *PHYSFS_getRealDir(const char *_fname)
|
|||
} /* if */
|
||||
|
||||
__PHYSFS_smallFree(fname);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* PHYSFS_getRealDir */
|
||||
|
||||
|
||||
|
@ -1485,7 +1485,7 @@ static int locateInStringList(const char *str,
|
|||
cmp = strcmp(list[middle], str);
|
||||
|
||||
if (cmp == 0) /* it's in the list already. */
|
||||
return(1);
|
||||
return 1;
|
||||
else if (cmp > 0)
|
||||
len = half_len;
|
||||
else
|
||||
|
@ -1496,7 +1496,7 @@ static int locateInStringList(const char *str,
|
|||
} /* while */
|
||||
|
||||
*pos = lo;
|
||||
return(0);
|
||||
return 0;
|
||||
} /* locateInStringList */
|
||||
|
||||
|
||||
|
@ -1544,7 +1544,7 @@ char **PHYSFS_enumerateFiles(const char *path)
|
|||
BAIL_IF_MACRO(ecd.list == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
PHYSFS_enumerateFilesCallback(path, enumFilesCallback, &ecd);
|
||||
ecd.list[ecd.size] = NULL;
|
||||
return(ecd.list);
|
||||
return ecd.list;
|
||||
} /* PHYSFS_enumerateFiles */
|
||||
|
||||
|
||||
|
@ -1617,7 +1617,7 @@ void PHYSFS_enumerateFilesCallback(const char *_fname,
|
|||
|
||||
int PHYSFS_exists(const char *fname)
|
||||
{
|
||||
return(PHYSFS_getRealDir(fname) != NULL);
|
||||
return (PHYSFS_getRealDir(fname) != NULL);
|
||||
} /* PHYSFS_exists */
|
||||
|
||||
|
||||
|
@ -1658,7 +1658,7 @@ PHYSFS_sint64 PHYSFS_getLastModTime(const char *_fname)
|
|||
} /* if */
|
||||
|
||||
__PHYSFS_smallFree(fname);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* PHYSFS_getLastModTime */
|
||||
|
||||
|
||||
|
@ -1697,7 +1697,7 @@ int PHYSFS_isDirectory(const char *_fname)
|
|||
} /* else */
|
||||
|
||||
__PHYSFS_smallFree(fname);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* PHYSFS_isDirectory */
|
||||
|
||||
|
||||
|
@ -1738,7 +1738,7 @@ int PHYSFS_isSymbolicLink(const char *_fname)
|
|||
} /* else */
|
||||
|
||||
__PHYSFS_smallFree(fname);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* PHYSFS_isSymbolicLink */
|
||||
|
||||
|
||||
|
@ -1795,19 +1795,19 @@ static PHYSFS_File *doOpenWrite(const char *_fname, int appending)
|
|||
} /* if */
|
||||
|
||||
__PHYSFS_smallFree(fname);
|
||||
return((PHYSFS_File *) fh);
|
||||
return ((PHYSFS_File *) fh);
|
||||
} /* doOpenWrite */
|
||||
|
||||
|
||||
PHYSFS_File *PHYSFS_openWrite(const char *filename)
|
||||
{
|
||||
return(doOpenWrite(filename, 0));
|
||||
return doOpenWrite(filename, 0);
|
||||
} /* PHYSFS_openWrite */
|
||||
|
||||
|
||||
PHYSFS_File *PHYSFS_openAppend(const char *filename)
|
||||
{
|
||||
return(doOpenWrite(filename, 1));
|
||||
return doOpenWrite(filename, 1);
|
||||
} /* PHYSFS_openAppend */
|
||||
|
||||
|
||||
|
@ -1870,7 +1870,7 @@ PHYSFS_File *PHYSFS_openRead(const char *_fname)
|
|||
} /* if */
|
||||
|
||||
__PHYSFS_smallFree(fname);
|
||||
return((PHYSFS_File *) fh);
|
||||
return ((PHYSFS_File *) fh);
|
||||
} /* PHYSFS_openRead */
|
||||
|
||||
|
||||
|
@ -1889,7 +1889,7 @@ static int closeHandleInOpenList(FileHandle **list, FileHandle *handle)
|
|||
if (rc)
|
||||
rc = handle->funcs->fileClose(handle->opaque);
|
||||
if (!rc)
|
||||
return(-1);
|
||||
return -1;
|
||||
|
||||
if (tmp != NULL) /* free any associated buffer. */
|
||||
allocator.Free(tmp);
|
||||
|
@ -1900,12 +1900,12 @@ static int closeHandleInOpenList(FileHandle **list, FileHandle *handle)
|
|||
prev->next = handle->next;
|
||||
|
||||
allocator.Free(handle);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
prev = i;
|
||||
} /* for */
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
} /* closeHandleInOpenList */
|
||||
|
||||
|
||||
|
@ -1927,7 +1927,7 @@ int PHYSFS_close(PHYSFS_File *_handle)
|
|||
|
||||
__PHYSFS_platformReleaseMutex(stateLock);
|
||||
BAIL_IF_MACRO(!rc, ERR_NOT_A_HANDLE, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_close */
|
||||
|
||||
|
||||
|
@ -1951,7 +1951,7 @@ static PHYSFS_sint64 doBufferedRead(FileHandle *fh, void *buffer,
|
|||
if (rc <= 0)
|
||||
{
|
||||
fh->bufpos -= remainder;
|
||||
return(((rc == -1) && (retval == 0)) ? -1 : retval);
|
||||
return ( ((rc == -1) && (retval == 0)) ? -1 : retval );
|
||||
} /* if */
|
||||
|
||||
buffered = fh->buffill = (PHYSFS_uint32) rc;
|
||||
|
@ -1971,7 +1971,7 @@ static PHYSFS_sint64 doBufferedRead(FileHandle *fh, void *buffer,
|
|||
objCount -= copied;
|
||||
} /* while */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* doBufferedRead */
|
||||
|
||||
|
||||
|
@ -1984,9 +1984,9 @@ PHYSFS_sint64 PHYSFS_read(PHYSFS_File *handle, void *buffer,
|
|||
BAIL_IF_MACRO(objSize == 0, NULL, 0);
|
||||
BAIL_IF_MACRO(objCount == 0, NULL, 0);
|
||||
if (fh->buffer != NULL)
|
||||
return(doBufferedRead(fh, buffer, objSize, objCount));
|
||||
return doBufferedRead(fh, buffer, objSize, objCount);
|
||||
|
||||
return(fh->funcs->read(fh->opaque, buffer, objSize, objCount));
|
||||
return fh->funcs->read(fh->opaque, buffer, objSize, objCount);
|
||||
} /* PHYSFS_read */
|
||||
|
||||
|
||||
|
@ -2001,12 +2001,12 @@ static PHYSFS_sint64 doBufferedWrite(PHYSFS_File *handle, const void *buffer,
|
|||
{
|
||||
memcpy(fh->buffer + fh->buffill, buffer, objSize * objCount);
|
||||
fh->buffill += (objSize * objCount);
|
||||
return(objCount);
|
||||
return objCount;
|
||||
} /* if */
|
||||
|
||||
/* would overflow buffer. Flush and then write the new objects, too. */
|
||||
BAIL_IF_MACRO(!PHYSFS_flush(handle), NULL, -1);
|
||||
return(fh->funcs->write(fh->opaque, buffer, objSize, objCount));
|
||||
return fh->funcs->write(fh->opaque, buffer, objSize, objCount);
|
||||
} /* doBufferedWrite */
|
||||
|
||||
|
||||
|
@ -2019,9 +2019,9 @@ PHYSFS_sint64 PHYSFS_write(PHYSFS_File *handle, const void *buffer,
|
|||
BAIL_IF_MACRO(objSize == 0, NULL, 0);
|
||||
BAIL_IF_MACRO(objCount == 0, NULL, 0);
|
||||
if (fh->buffer != NULL)
|
||||
return(doBufferedWrite(handle, buffer, objSize, objCount));
|
||||
return doBufferedWrite(handle, buffer, objSize, objCount);
|
||||
|
||||
return(fh->funcs->write(fh->opaque, buffer, objSize, objCount));
|
||||
return fh->funcs->write(fh->opaque, buffer, objSize, objCount);
|
||||
} /* PHYSFS_write */
|
||||
|
||||
|
||||
|
@ -2030,10 +2030,10 @@ int PHYSFS_eof(PHYSFS_File *handle)
|
|||
FileHandle *fh = (FileHandle *) handle;
|
||||
|
||||
if (!fh->forReading) /* never EOF on files opened for write/append. */
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
/* eof if buffer is empty and archiver says so. */
|
||||
return((fh->bufpos == fh->buffill) && (fh->funcs->eof(fh->opaque)));
|
||||
return (fh->bufpos == fh->buffill && (fh->funcs->eof(fh->opaque)));
|
||||
} /* PHYSFS_eof */
|
||||
|
||||
|
||||
|
@ -2044,7 +2044,7 @@ PHYSFS_sint64 PHYSFS_tell(PHYSFS_File *handle)
|
|||
PHYSFS_sint64 retval = fh->forReading ?
|
||||
(pos - fh->buffill) + fh->bufpos :
|
||||
(pos + fh->buffill);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* PHYSFS_tell */
|
||||
|
||||
|
||||
|
@ -2062,20 +2062,20 @@ int PHYSFS_seek(PHYSFS_File *handle, PHYSFS_uint64 pos)
|
|||
|| ((offset < 0) && (-offset <= fh->bufpos)) /* backward */ )
|
||||
{
|
||||
fh->bufpos += (PHYSFS_uint32) offset;
|
||||
return(1); /* successful seek */
|
||||
return 1; /* successful seek */
|
||||
} /* if */
|
||||
} /* if */
|
||||
|
||||
/* we have to fall back to a 'raw' seek. */
|
||||
fh->buffill = fh->bufpos = 0;
|
||||
return(fh->funcs->seek(fh->opaque, pos));
|
||||
return fh->funcs->seek(fh->opaque, pos);
|
||||
} /* PHYSFS_seek */
|
||||
|
||||
|
||||
PHYSFS_sint64 PHYSFS_fileLength(PHYSFS_File *handle)
|
||||
{
|
||||
FileHandle *fh = (FileHandle *) handle;
|
||||
return(fh->funcs->fileLength(fh->opaque));
|
||||
return fh->funcs->fileLength(fh->opaque);
|
||||
} /* PHYSFS_filelength */
|
||||
|
||||
|
||||
|
@ -2123,7 +2123,7 @@ int PHYSFS_setBuffer(PHYSFS_File *handle, PHYSFS_uint64 _bufsize)
|
|||
|
||||
fh->bufsize = bufsize;
|
||||
fh->buffill = fh->bufpos = 0;
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_setBuffer */
|
||||
|
||||
|
||||
|
@ -2133,14 +2133,14 @@ int PHYSFS_flush(PHYSFS_File *handle)
|
|||
PHYSFS_sint64 rc;
|
||||
|
||||
if ((fh->forReading) || (fh->bufpos == fh->buffill))
|
||||
return(1); /* open for read or buffer empty are successful no-ops. */
|
||||
return 1; /* open for read or buffer empty are successful no-ops. */
|
||||
|
||||
/* dump buffer to disk. */
|
||||
rc = fh->funcs->write(fh->opaque, fh->buffer + fh->bufpos,
|
||||
fh->buffill - fh->bufpos, 1);
|
||||
BAIL_IF_MACRO(rc <= 0, NULL, 0);
|
||||
fh->bufpos = fh->buffill = 0;
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_flush */
|
||||
|
||||
|
||||
|
@ -2151,7 +2151,7 @@ int PHYSFS_setAllocator(const PHYSFS_Allocator *a)
|
|||
if (externalAllocator)
|
||||
memcpy(&allocator, a, sizeof (PHYSFS_Allocator));
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_setAllocator */
|
||||
|
||||
|
||||
|
@ -2166,7 +2166,7 @@ static void *mallocAllocatorMalloc(PHYSFS_uint64 s)
|
|||
{
|
||||
BAIL_IF_MACRO(__PHYSFS_ui64FitsAddressSpace(s), ERR_OUT_OF_MEMORY, NULL);
|
||||
#undef malloc
|
||||
return(malloc((size_t) s));
|
||||
return malloc((size_t) s);
|
||||
} /* mallocAllocatorMalloc */
|
||||
|
||||
|
||||
|
@ -2174,7 +2174,7 @@ static void *mallocAllocatorRealloc(void *ptr, PHYSFS_uint64 s)
|
|||
{
|
||||
BAIL_IF_MACRO(__PHYSFS_ui64FitsAddressSpace(s), ERR_OUT_OF_MEMORY, NULL);
|
||||
#undef realloc
|
||||
return(realloc(ptr, (size_t) s));
|
||||
return realloc(ptr, (size_t) s);
|
||||
} /* mallocAllocatorRealloc */
|
||||
|
||||
|
||||
|
@ -2211,10 +2211,10 @@ void *__PHYSFS_initSmallAlloc(void *ptr, PHYSFS_uint64 len)
|
|||
/*printf("%s alloc'd (%d) bytes at (%p).\n",
|
||||
useHeap ? "heap" : "stack", (int) len, ptr);*/
|
||||
*retval = useHeap;
|
||||
return(retval+1);
|
||||
return (retval + 1);
|
||||
} /* if */
|
||||
|
||||
return(NULL); /* allocation failed. */
|
||||
return NULL; /* allocation failed. */
|
||||
} /* __PHYSFS_initSmallAlloc */
|
||||
|
||||
|
||||
|
|
|
@ -25,13 +25,13 @@
|
|||
#ifndef PHYSFS_Swap16
|
||||
static __inline__ PHYSFS_uint16 PHYSFS_Swap16(PHYSFS_uint16 D)
|
||||
{
|
||||
return((D<<8)|(D>>8));
|
||||
return ((D<<8)|(D>>8));
|
||||
}
|
||||
#endif
|
||||
#ifndef PHYSFS_Swap32
|
||||
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
|
||||
#ifndef PHYSFS_NO_64BIT_SUPPORT
|
||||
|
@ -46,7 +46,7 @@ static __inline__ PHYSFS_uint64 PHYSFS_Swap64(PHYSFS_uint64 val) {
|
|||
val = PHYSFS_Swap32(lo);
|
||||
val <<= 32;
|
||||
val |= PHYSFS_Swap32(hi);
|
||||
return(val);
|
||||
return val;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
|
@ -62,33 +62,33 @@ static __inline__ PHYSFS_uint64 PHYSFS_Swap64(PHYSFS_uint64 val) {
|
|||
|
||||
/* Byteswap item from the specified endianness to the native endianness */
|
||||
#if PHYSFS_BYTEORDER == PHYSFS_LIL_ENDIAN
|
||||
PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 x) { return(x); }
|
||||
PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 x) { return(x); }
|
||||
PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 x) { return(x); }
|
||||
PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 x) { return(x); }
|
||||
PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 x) { return(x); }
|
||||
PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 x) { return(x); }
|
||||
PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 x) { return x; }
|
||||
PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 x) { return x; }
|
||||
PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 x) { return x; }
|
||||
PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 x) { return x; }
|
||||
PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 x) { return x; }
|
||||
PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 x) { return x; }
|
||||
|
||||
PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 x) { return(PHYSFS_Swap16(x)); }
|
||||
PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 x) { return(PHYSFS_Swap16(x)); }
|
||||
PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 x) { return(PHYSFS_Swap32(x)); }
|
||||
PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 x) { return(PHYSFS_Swap32(x)); }
|
||||
PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 x) { return(PHYSFS_Swap64(x)); }
|
||||
PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 x) { return(PHYSFS_Swap64(x)); }
|
||||
PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 x) { return PHYSFS_Swap16(x); }
|
||||
PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 x) { return PHYSFS_Swap16(x); }
|
||||
PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 x) { return PHYSFS_Swap32(x); }
|
||||
PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 x) { return PHYSFS_Swap32(x); }
|
||||
PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 x) { return PHYSFS_Swap64(x); }
|
||||
PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 x) { return PHYSFS_Swap64(x); }
|
||||
#else
|
||||
PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 x) { return(PHYSFS_Swap16(x)); }
|
||||
PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 x) { return(PHYSFS_Swap16(x)); }
|
||||
PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 x) { return(PHYSFS_Swap32(x)); }
|
||||
PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 x) { return(PHYSFS_Swap32(x)); }
|
||||
PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 x) { return(PHYSFS_Swap64(x)); }
|
||||
PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 x) { return(PHYSFS_Swap64(x)); }
|
||||
PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 x) { return PHYSFS_Swap16(x); }
|
||||
PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 x) { return PHYSFS_Swap16(x); }
|
||||
PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 x) { return PHYSFS_Swap32(x); }
|
||||
PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 x) { return PHYSFS_Swap32(x); }
|
||||
PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 x) { return PHYSFS_Swap64(x); }
|
||||
PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 x) { return PHYSFS_Swap64(x); }
|
||||
|
||||
PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 x) { return(x); }
|
||||
PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 x) { return(x); }
|
||||
PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 x) { return(x); }
|
||||
PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 x) { return(x); }
|
||||
PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 x) { return(x); }
|
||||
PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 x) { return(x); }
|
||||
PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 x) { return x; }
|
||||
PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 x) { return x; }
|
||||
PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 x) { return x; }
|
||||
PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 x) { return x; }
|
||||
PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 x) { return x; }
|
||||
PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 x) { return x; }
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -98,7 +98,7 @@ int PHYSFS_readSLE16(PHYSFS_File *file, PHYSFS_sint16 *val)
|
|||
BAIL_IF_MACRO(val == NULL, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(PHYSFS_read(file, &in, sizeof (in), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapSLE16(in);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_readSLE16 */
|
||||
|
||||
|
||||
|
@ -108,7 +108,7 @@ int PHYSFS_readULE16(PHYSFS_File *file, PHYSFS_uint16 *val)
|
|||
BAIL_IF_MACRO(val == NULL, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(PHYSFS_read(file, &in, sizeof (in), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapULE16(in);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_readULE16 */
|
||||
|
||||
|
||||
|
@ -118,7 +118,7 @@ int PHYSFS_readSBE16(PHYSFS_File *file, PHYSFS_sint16 *val)
|
|||
BAIL_IF_MACRO(val == NULL, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(PHYSFS_read(file, &in, sizeof (in), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapSBE16(in);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_readSBE16 */
|
||||
|
||||
|
||||
|
@ -128,7 +128,7 @@ int PHYSFS_readUBE16(PHYSFS_File *file, PHYSFS_uint16 *val)
|
|||
BAIL_IF_MACRO(val == NULL, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(PHYSFS_read(file, &in, sizeof (in), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapUBE16(in);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_readUBE16 */
|
||||
|
||||
|
||||
|
@ -138,7 +138,7 @@ int PHYSFS_readSLE32(PHYSFS_File *file, PHYSFS_sint32 *val)
|
|||
BAIL_IF_MACRO(val == NULL, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(PHYSFS_read(file, &in, sizeof (in), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapSLE32(in);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_readSLE32 */
|
||||
|
||||
|
||||
|
@ -148,7 +148,7 @@ int PHYSFS_readULE32(PHYSFS_File *file, PHYSFS_uint32 *val)
|
|||
BAIL_IF_MACRO(val == NULL, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(PHYSFS_read(file, &in, sizeof (in), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapULE32(in);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_readULE32 */
|
||||
|
||||
|
||||
|
@ -158,7 +158,7 @@ int PHYSFS_readSBE32(PHYSFS_File *file, PHYSFS_sint32 *val)
|
|||
BAIL_IF_MACRO(val == NULL, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(PHYSFS_read(file, &in, sizeof (in), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapSBE32(in);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_readSBE32 */
|
||||
|
||||
|
||||
|
@ -168,7 +168,7 @@ int PHYSFS_readUBE32(PHYSFS_File *file, PHYSFS_uint32 *val)
|
|||
BAIL_IF_MACRO(val == NULL, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(PHYSFS_read(file, &in, sizeof (in), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapUBE32(in);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_readUBE32 */
|
||||
|
||||
|
||||
|
@ -178,7 +178,7 @@ int PHYSFS_readSLE64(PHYSFS_File *file, PHYSFS_sint64 *val)
|
|||
BAIL_IF_MACRO(val == NULL, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(PHYSFS_read(file, &in, sizeof (in), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapSLE64(in);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_readSLE64 */
|
||||
|
||||
|
||||
|
@ -188,7 +188,7 @@ int PHYSFS_readULE64(PHYSFS_File *file, PHYSFS_uint64 *val)
|
|||
BAIL_IF_MACRO(val == NULL, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(PHYSFS_read(file, &in, sizeof (in), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapULE64(in);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_readULE64 */
|
||||
|
||||
|
||||
|
@ -198,7 +198,7 @@ int PHYSFS_readSBE64(PHYSFS_File *file, PHYSFS_sint64 *val)
|
|||
BAIL_IF_MACRO(val == NULL, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(PHYSFS_read(file, &in, sizeof (in), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapSBE64(in);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_readSBE64 */
|
||||
|
||||
|
||||
|
@ -208,7 +208,7 @@ int PHYSFS_readUBE64(PHYSFS_File *file, PHYSFS_uint64 *val)
|
|||
BAIL_IF_MACRO(val == NULL, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(PHYSFS_read(file, &in, sizeof (in), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapUBE64(in);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_readUBE64 */
|
||||
|
||||
|
||||
|
@ -217,7 +217,7 @@ int PHYSFS_writeSLE16(PHYSFS_File *file, PHYSFS_sint16 val)
|
|||
{
|
||||
PHYSFS_sint16 out = PHYSFS_swapSLE16(val);
|
||||
BAIL_IF_MACRO(PHYSFS_write(file, &out, sizeof (out), 1) != 1, NULL, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_writeSLE16 */
|
||||
|
||||
|
||||
|
@ -225,7 +225,7 @@ int PHYSFS_writeULE16(PHYSFS_File *file, PHYSFS_uint16 val)
|
|||
{
|
||||
PHYSFS_uint16 out = PHYSFS_swapULE16(val);
|
||||
BAIL_IF_MACRO(PHYSFS_write(file, &out, sizeof (out), 1) != 1, NULL, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_writeULE16 */
|
||||
|
||||
|
||||
|
@ -233,7 +233,7 @@ int PHYSFS_writeSBE16(PHYSFS_File *file, PHYSFS_sint16 val)
|
|||
{
|
||||
PHYSFS_sint16 out = PHYSFS_swapSBE16(val);
|
||||
BAIL_IF_MACRO(PHYSFS_write(file, &out, sizeof (out), 1) != 1, NULL, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_writeSBE16 */
|
||||
|
||||
|
||||
|
@ -241,7 +241,7 @@ int PHYSFS_writeUBE16(PHYSFS_File *file, PHYSFS_uint16 val)
|
|||
{
|
||||
PHYSFS_uint16 out = PHYSFS_swapUBE16(val);
|
||||
BAIL_IF_MACRO(PHYSFS_write(file, &out, sizeof (out), 1) != 1, NULL, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_writeUBE16 */
|
||||
|
||||
|
||||
|
@ -249,7 +249,7 @@ int PHYSFS_writeSLE32(PHYSFS_File *file, PHYSFS_sint32 val)
|
|||
{
|
||||
PHYSFS_sint32 out = PHYSFS_swapSLE32(val);
|
||||
BAIL_IF_MACRO(PHYSFS_write(file, &out, sizeof (out), 1) != 1, NULL, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_writeSLE32 */
|
||||
|
||||
|
||||
|
@ -257,7 +257,7 @@ int PHYSFS_writeULE32(PHYSFS_File *file, PHYSFS_uint32 val)
|
|||
{
|
||||
PHYSFS_uint32 out = PHYSFS_swapULE32(val);
|
||||
BAIL_IF_MACRO(PHYSFS_write(file, &out, sizeof (out), 1) != 1, NULL, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_writeULE32 */
|
||||
|
||||
|
||||
|
@ -265,7 +265,7 @@ int PHYSFS_writeSBE32(PHYSFS_File *file, PHYSFS_sint32 val)
|
|||
{
|
||||
PHYSFS_sint32 out = PHYSFS_swapSBE32(val);
|
||||
BAIL_IF_MACRO(PHYSFS_write(file, &out, sizeof (out), 1) != 1, NULL, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_writeSBE32 */
|
||||
|
||||
|
||||
|
@ -273,7 +273,7 @@ int PHYSFS_writeUBE32(PHYSFS_File *file, PHYSFS_uint32 val)
|
|||
{
|
||||
PHYSFS_uint32 out = PHYSFS_swapUBE32(val);
|
||||
BAIL_IF_MACRO(PHYSFS_write(file, &out, sizeof (out), 1) != 1, NULL, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_writeUBE32 */
|
||||
|
||||
|
||||
|
@ -281,7 +281,7 @@ int PHYSFS_writeSLE64(PHYSFS_File *file, PHYSFS_sint64 val)
|
|||
{
|
||||
PHYSFS_sint64 out = PHYSFS_swapSLE64(val);
|
||||
BAIL_IF_MACRO(PHYSFS_write(file, &out, sizeof (out), 1) != 1, NULL, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_writeSLE64 */
|
||||
|
||||
|
||||
|
@ -289,7 +289,7 @@ int PHYSFS_writeULE64(PHYSFS_File *file, PHYSFS_uint64 val)
|
|||
{
|
||||
PHYSFS_uint64 out = PHYSFS_swapULE64(val);
|
||||
BAIL_IF_MACRO(PHYSFS_write(file, &out, sizeof (out), 1) != 1, NULL, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_writeULE64 */
|
||||
|
||||
|
||||
|
@ -297,7 +297,7 @@ int PHYSFS_writeSBE64(PHYSFS_File *file, PHYSFS_sint64 val)
|
|||
{
|
||||
PHYSFS_sint64 out = PHYSFS_swapSBE64(val);
|
||||
BAIL_IF_MACRO(PHYSFS_write(file, &out, sizeof (out), 1) != 1, NULL, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_writeSBE64 */
|
||||
|
||||
|
||||
|
@ -305,7 +305,7 @@ int PHYSFS_writeUBE64(PHYSFS_File *file, PHYSFS_uint64 val)
|
|||
{
|
||||
PHYSFS_uint64 out = PHYSFS_swapUBE64(val);
|
||||
BAIL_IF_MACRO(PHYSFS_write(file, &out, sizeof (out), 1) != 1, NULL, 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* PHYSFS_writeUBE64 */
|
||||
|
||||
/* end of physfs_byteorder.c ... */
|
||||
|
|
|
@ -48,7 +48,7 @@ static PHYSFS_uint32 utf8codepoint(const char **_str)
|
|||
else if (octet < 128) /* one octet char: 0 to 127 */
|
||||
{
|
||||
(*_str)++; /* skip to next possible start of codepoint. */
|
||||
return(octet);
|
||||
return octet;
|
||||
} /* else if */
|
||||
|
||||
else if ((octet > 127) && (octet < 192)) /* bad (starts with 10xxxxxx). */
|
||||
|
|
|
@ -67,7 +67,7 @@ int __PHYSFS_platformInit(void)
|
|||
ctx.deallocate = cfallocFree;
|
||||
cfallocator = CFAllocatorCreate(kCFAllocatorUseContext, &ctx);
|
||||
BAIL_IF_MACRO(cfallocator == NULL, ERR_OUT_OF_MEMORY, 0);
|
||||
return(1); /* success. */
|
||||
return 1; /* success. */
|
||||
} /* __PHYSFS_platformInit */
|
||||
|
||||
|
||||
|
@ -75,7 +75,7 @@ int __PHYSFS_platformDeinit(void)
|
|||
{
|
||||
CFRelease(cfallocator);
|
||||
cfallocator = NULL;
|
||||
return(1); /* always succeed. */
|
||||
return 1; /* always succeed. */
|
||||
} /* __PHYSFS_platformDeinit */
|
||||
|
||||
|
||||
|
@ -92,13 +92,13 @@ static int darwinIsWholeMedia(io_service_t service)
|
|||
CFTypeRef wholeMedia;
|
||||
|
||||
if (!IOObjectConformsTo(service, kIOMediaClass))
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
wholeMedia = IORegistryEntryCreateCFProperty(service,
|
||||
CFSTR(kIOMediaWholeKey),
|
||||
cfallocator, 0);
|
||||
if (wholeMedia == NULL)
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
retval = CFBooleanGetValue(wholeMedia);
|
||||
CFRelease(wholeMedia);
|
||||
|
@ -116,27 +116,27 @@ static int darwinIsMountedDisc(char *bsdName, mach_port_t masterPort)
|
|||
io_service_t service;
|
||||
|
||||
if ((matchingDict = IOBSDNameMatching(masterPort, 0, bsdName)) == NULL)
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
rc = IOServiceGetMatchingServices(masterPort, matchingDict, &iter);
|
||||
if ((rc != KERN_SUCCESS) || (!iter))
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
service = IOIteratorNext(iter);
|
||||
IOObjectRelease(iter);
|
||||
if (!service)
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
rc = IORegistryEntryCreateIterator(service, kIOServicePlane,
|
||||
kIORegistryIterateRecursively | kIORegistryIterateParents, &iter);
|
||||
|
||||
if (!iter)
|
||||
return(0);
|
||||
return 0;
|
||||
|
||||
if (rc != KERN_SUCCESS)
|
||||
{
|
||||
IOObjectRelease(iter);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
IOObjectRetain(service); /* add an extra object reference... */
|
||||
|
@ -157,7 +157,7 @@ static int darwinIsMountedDisc(char *bsdName, mach_port_t masterPort)
|
|||
IOObjectRelease(iter);
|
||||
IOObjectRelease(service);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* darwinIsMountedDisc */
|
||||
|
||||
|
||||
|
@ -212,7 +212,7 @@ static char *convertCFString(CFStringRef cfstr)
|
|||
BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* convertCFString */
|
||||
|
||||
|
||||
|
@ -242,7 +242,7 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0)
|
|||
{
|
||||
assert(0); /* shouldn't ever hit this... */
|
||||
CFRelease(cfmutstr);
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* if */
|
||||
|
||||
/* chop the "/exename" from the end of the path string... */
|
||||
|
@ -261,7 +261,7 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0)
|
|||
retval = convertCFString(cfmutstr);
|
||||
CFRelease(cfmutstr);
|
||||
|
||||
return(retval); /* whew. */
|
||||
return retval; /* whew. */
|
||||
} /* __PHYSFS_platformCalcBaseDir */
|
||||
|
||||
|
||||
|
@ -287,13 +287,13 @@ char *__PHYSFS_platformRealPath(const char *path)
|
|||
retval = convertCFString(cfstr);
|
||||
CFRelease(cfstr);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformRealPath */
|
||||
|
||||
|
||||
char *__PHYSFS_platformCurrentDir(void)
|
||||
{
|
||||
return(__PHYSFS_platformRealPath(".")); /* let CFURL sort it out. */
|
||||
return __PHYSFS_platformRealPath("."); /* let CFURL sort it out. */
|
||||
} /* __PHYSFS_platformCurrentDir */
|
||||
|
||||
|
||||
|
@ -308,7 +308,7 @@ static int macosxAllocatorInit(void)
|
|||
retval = (cfallocdef != NULL);
|
||||
if (retval)
|
||||
CFRetain(cfallocdef);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* macosxAllocatorInit */
|
||||
|
||||
|
||||
|
@ -325,14 +325,14 @@ static void macosxAllocatorDeinit(void)
|
|||
static void *macosxAllocatorMalloc(PHYSFS_uint64 s)
|
||||
{
|
||||
BAIL_IF_MACRO(__PHYSFS_ui64FitsAddressSpace(s), ERR_OUT_OF_MEMORY, NULL);
|
||||
return(CFAllocatorAllocate(cfallocdef, (CFIndex) s, 0));
|
||||
return CFAllocatorAllocate(cfallocdef, (CFIndex) s, 0);
|
||||
} /* macosxAllocatorMalloc */
|
||||
|
||||
|
||||
static void *macosxAllocatorRealloc(void *ptr, PHYSFS_uint64 s)
|
||||
{
|
||||
BAIL_IF_MACRO(__PHYSFS_ui64FitsAddressSpace(s), ERR_OUT_OF_MEMORY, NULL);
|
||||
return(CFAllocatorReallocate(cfallocdef, ptr, (CFIndex) s, 0));
|
||||
return CFAllocatorReallocate(cfallocdef, ptr, (CFIndex) s, 0);
|
||||
} /* macosxAllocatorRealloc */
|
||||
|
||||
|
||||
|
@ -349,13 +349,13 @@ int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a)
|
|||
allocator.Malloc = macosxAllocatorMalloc;
|
||||
allocator.Realloc = macosxAllocatorRealloc;
|
||||
allocator.Free = macosxAllocatorFree;
|
||||
return(1); /* return non-zero: we're supplying custom allocator. */
|
||||
return 1; /* return non-zero: we're supplying custom allocator. */
|
||||
} /* __PHYSFS_platformSetDefaultAllocator */
|
||||
|
||||
|
||||
void *__PHYSFS_platformGetThreadID(void)
|
||||
{
|
||||
return( (void *) ((size_t) MPCurrentTaskID()) );
|
||||
return ( (void *) ((size_t) MPCurrentTaskID()) );
|
||||
} /* __PHYSFS_platformGetThreadID */
|
||||
|
||||
|
||||
|
@ -379,8 +379,8 @@ int __PHYSFS_platformGrabMutex(void *mutex)
|
|||
{
|
||||
MPCriticalRegionID m = (MPCriticalRegionID) mutex;
|
||||
if (MPEnterCriticalRegion(m, kDurationForever) != noErr)
|
||||
return(0);
|
||||
return(1);
|
||||
return 0;
|
||||
return 1;
|
||||
} /* __PHYSFS_platformGrabMutex */
|
||||
|
||||
|
||||
|
|
|
@ -38,36 +38,36 @@ static const char *get_os2_error_string(APIRET rc)
|
|||
{
|
||||
switch (rc)
|
||||
{
|
||||
case NO_ERROR: return(NULL); /* not an error. */
|
||||
case ERROR_INTERRUPT: return(NULL); /* not an error. */
|
||||
case ERROR_TIMEOUT: return(NULL); /* not an error. */
|
||||
case ERROR_NOT_ENOUGH_MEMORY: return(ERR_OUT_OF_MEMORY);
|
||||
case ERROR_FILE_NOT_FOUND: return(ERR_NO_SUCH_FILE);
|
||||
case ERROR_PATH_NOT_FOUND: return(ERR_NO_SUCH_PATH);
|
||||
case ERROR_ACCESS_DENIED: return(ERR_ACCESS_DENIED);
|
||||
case ERROR_NOT_DOS_DISK: return(ERR_NOT_A_DOS_DISK);
|
||||
case ERROR_SHARING_VIOLATION: return(ERR_SHARING_VIOLATION);
|
||||
case ERROR_CANNOT_MAKE: return(ERR_CANNOT_MAKE);
|
||||
case ERROR_DEVICE_IN_USE: return(ERR_DEV_IN_USE);
|
||||
case ERROR_OPEN_FAILED: return(ERR_OPEN_FAILED);
|
||||
case ERROR_DISK_FULL: return(ERR_DISK_FULL);
|
||||
case ERROR_PIPE_BUSY: return(ERR_PIPE_BUSY);
|
||||
case ERROR_SHARING_BUFFER_EXCEEDED: return(ERR_SHARING_BUF_EXCEEDED);
|
||||
case ERROR_FILENAME_EXCED_RANGE: return(ERR_BAD_FILENAME);
|
||||
case ERROR_META_EXPANSION_TOO_LONG: return(ERR_BAD_FILENAME);
|
||||
case ERROR_TOO_MANY_HANDLES: return(ERR_TOO_MANY_HANDLES);
|
||||
case ERROR_TOO_MANY_OPEN_FILES: return(ERR_TOO_MANY_HANDLES);
|
||||
case ERROR_NO_MORE_SEARCH_HANDLES: return(ERR_TOO_MANY_HANDLES);
|
||||
case ERROR_SEEK_ON_DEVICE: return(ERR_SEEK_ERROR);
|
||||
case ERROR_NEGATIVE_SEEK: return(ERR_SEEK_OUT_OF_RANGE);
|
||||
/*!!! FIXME: Where did this go? case ERROR_DEL_CURRENT_DIRECTORY: return(ERR_DEL_CWD);*/
|
||||
case ERROR_WRITE_PROTECT: return(ERR_WRITE_PROTECT_ERROR);
|
||||
case ERROR_WRITE_FAULT: return(ERR_WRITE_FAULT);
|
||||
case ERROR_LOCK_VIOLATION: return(ERR_LOCK_VIOLATION);
|
||||
case ERROR_GEN_FAILURE: return(ERR_GEN_FAILURE);
|
||||
case ERROR_UNCERTAIN_MEDIA: return(ERR_UNCERTAIN_MEDIA);
|
||||
case ERROR_PROTECTION_VIOLATION: return(ERR_PROT_VIOLATION);
|
||||
case ERROR_BROKEN_PIPE: return(ERR_BROKEN_PIPE);
|
||||
case NO_ERROR: return NULL; /* not an error. */
|
||||
case ERROR_INTERRUPT: return NULL; /* not an error. */
|
||||
case ERROR_TIMEOUT: return NULL; /* not an error. */
|
||||
case ERROR_NOT_ENOUGH_MEMORY: return ERR_OUT_OF_MEMORY;
|
||||
case ERROR_FILE_NOT_FOUND: return ERR_NO_SUCH_FILE;
|
||||
case ERROR_PATH_NOT_FOUND: return ERR_NO_SUCH_PATH;
|
||||
case ERROR_ACCESS_DENIED: return ERR_ACCESS_DENIED;
|
||||
case ERROR_NOT_DOS_DISK: return ERR_NOT_A_DOS_DISK;
|
||||
case ERROR_SHARING_VIOLATION: return ERR_SHARING_VIOLATION;
|
||||
case ERROR_CANNOT_MAKE: return ERR_CANNOT_MAKE;
|
||||
case ERROR_DEVICE_IN_USE: return ERR_DEV_IN_USE;
|
||||
case ERROR_OPEN_FAILED: return ERR_OPEN_FAILED;
|
||||
case ERROR_DISK_FULL: return ERR_DISK_FULL;
|
||||
case ERROR_PIPE_BUSY: return ERR_PIPE_BUSY;
|
||||
case ERROR_SHARING_BUFFER_EXCEEDED: return ERR_SHARING_BUF_EXCEEDED;
|
||||
case ERROR_FILENAME_EXCED_RANGE: return ERR_BAD_FILENAME;
|
||||
case ERROR_META_EXPANSION_TOO_LONG: return ERR_BAD_FILENAME;
|
||||
case ERROR_TOO_MANY_HANDLES: return ERR_TOO_MANY_HANDLES;
|
||||
case ERROR_TOO_MANY_OPEN_FILES: return ERR_TOO_MANY_HANDLES;
|
||||
case ERROR_NO_MORE_SEARCH_HANDLES: return ERR_TOO_MANY_HANDLES;
|
||||
case ERROR_SEEK_ON_DEVICE: return ERR_SEEK_ERROR;
|
||||
case ERROR_NEGATIVE_SEEK: return ERR_SEEK_OUT_OF_RANGE;
|
||||
/*!!! FIXME: Where did this go? case ERROR_DEL_CURRENT_DIRECTORY: return ERR_DEL_CWD;*/
|
||||
case ERROR_WRITE_PROTECT: return ERR_WRITE_PROTECT_ERROR;
|
||||
case ERROR_WRITE_FAULT: return ERR_WRITE_FAULT;
|
||||
case ERROR_LOCK_VIOLATION: return ERR_LOCK_VIOLATION;
|
||||
case ERROR_GEN_FAILURE: return ERR_GEN_FAILURE;
|
||||
case ERROR_UNCERTAIN_MEDIA: return ERR_UNCERTAIN_MEDIA;
|
||||
case ERROR_PROTECTION_VIOLATION: return ERR_PROT_VIOLATION;
|
||||
case ERROR_BROKEN_PIPE: return ERR_BROKEN_PIPE;
|
||||
|
||||
case ERROR_INVALID_PARAMETER:
|
||||
case ERROR_INVALID_NAME:
|
||||
|
@ -82,12 +82,12 @@ static const char *get_os2_error_string(APIRET rc)
|
|||
case ERROR_BAD_DRIVER_LEVEL:
|
||||
case ERROR_DIRECT_ACCESS_HANDLE:
|
||||
case ERROR_NOT_OWNER:
|
||||
return(ERR_PHYSFS_BAD_OS_CALL);
|
||||
return ERR_PHYSFS_BAD_OS_CALL;
|
||||
|
||||
default: return(ERR_OS2_GENERIC);
|
||||
default: return ERR_OS2_GENERIC;
|
||||
} /* switch */
|
||||
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* get_os2_error_string */
|
||||
|
||||
|
||||
|
@ -104,7 +104,7 @@ static APIRET os2err(APIRET retval)
|
|||
if (err != NULL)
|
||||
__PHYSFS_setError(err);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* os2err */
|
||||
|
||||
|
||||
|
@ -200,7 +200,7 @@ int __PHYSFS_platformInit(void)
|
|||
baseDir = (char *) allocator.Malloc(len + 1);
|
||||
BAIL_IF_MACRO(baseDir == NULL, ERR_OUT_OF_MEMORY, 0);
|
||||
strcpy(baseDir, buf);
|
||||
return(1); /* success. */
|
||||
return 1; /* success. */
|
||||
} /* __PHYSFS_platformInit */
|
||||
|
||||
|
||||
|
@ -209,7 +209,7 @@ int __PHYSFS_platformDeinit(void)
|
|||
assert(baseDir != NULL);
|
||||
allocator.Free(baseDir);
|
||||
baseDir = NULL;
|
||||
return(1); /* success. */
|
||||
return 1; /* success. */
|
||||
} /* __PHYSFS_platformDeinit */
|
||||
|
||||
|
||||
|
@ -220,7 +220,7 @@ static int disc_is_inserted(ULONG drive)
|
|||
DosError(FERR_DISABLEHARDERR | FERR_DISABLEEXCEPTION);
|
||||
rc = DosQueryFSInfo(drive + 1, FSIL_VOLSER, buf, sizeof (buf));
|
||||
DosError(FERR_ENABLEHARDERR | FERR_ENABLEEXCEPTION);
|
||||
return(rc == NO_ERROR);
|
||||
return (rc == NO_ERROR);
|
||||
} /* is_cdrom_inserted */
|
||||
|
||||
|
||||
|
@ -248,7 +248,7 @@ static int is_cdrom_drive(ULONG drive)
|
|||
¶m, sizeof (param), &ul1, &data, sizeof (data), &ul2);
|
||||
|
||||
DosClose(hfile);
|
||||
return((rc == NO_ERROR) && (PHYSFS_swapULE32(data) == CD01));
|
||||
return ((rc == NO_ERROR) && (PHYSFS_swapULE32(data) == CD01));
|
||||
} /* is_cdrom_drive */
|
||||
|
||||
|
||||
|
@ -281,19 +281,19 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0)
|
|||
char *retval = (char *) allocator.Malloc(strlen(baseDir) + 1);
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
strcpy(retval, baseDir); /* calculated at init time. */
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformCalcBaseDir */
|
||||
|
||||
|
||||
char *__PHYSFS_platformGetUserName(void)
|
||||
{
|
||||
return(NULL); /* (*shrug*) */
|
||||
return NULL; /* (*shrug*) */
|
||||
} /* __PHYSFS_platformGetUserName */
|
||||
|
||||
|
||||
char *__PHYSFS_platformGetUserDir(void)
|
||||
{
|
||||
return(__PHYSFS_platformCalcBaseDir(NULL));
|
||||
return __PHYSFS_platformCalcBaseDir(NULL);
|
||||
} /* __PHYSFS_platformGetUserDir */
|
||||
|
||||
|
||||
|
@ -302,13 +302,13 @@ int __PHYSFS_platformExists(const char *_fname)
|
|||
const unsigned char *fname = (const unsigned char *) _fname;
|
||||
FILESTATUS3 fs;
|
||||
APIRET rc = DosQueryPathInfo(fname, FIL_STANDARD, &fs, sizeof (fs));
|
||||
return(os2err(rc) == NO_ERROR);
|
||||
return (os2err(rc) == NO_ERROR);
|
||||
} /* __PHYSFS_platformExists */
|
||||
|
||||
|
||||
int __PHYSFS_platformIsSymLink(const char *fname)
|
||||
{
|
||||
return(0); /* no symlinks in OS/2. */
|
||||
return 0; /* no symlinks in OS/2. */
|
||||
} /* __PHYSFS_platformIsSymlink */
|
||||
|
||||
|
||||
|
@ -318,7 +318,7 @@ int __PHYSFS_platformIsDirectory(const char *_fname)
|
|||
FILESTATUS3 fs;
|
||||
APIRET rc = DosQueryPathInfo(fname, FIL_STANDARD, &fs, sizeof (fs));
|
||||
BAIL_IF_MACRO(os2err(rc) != NO_ERROR, NULL, 0)
|
||||
return((fs.attrFile & FILE_DIRECTORY) != 0);
|
||||
return ((fs.attrFile & FILE_DIRECTORY) != 0);
|
||||
} /* __PHYSFS_platformIsDirectory */
|
||||
|
||||
|
||||
|
@ -348,7 +348,7 @@ char *__PHYSFS_platformCvtToDependent(const char *prepend,
|
|||
for (p = strchr(retval, '/'); p != NULL; p = strchr(p + 1, '/'))
|
||||
*p = '\\';
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformCvtToDependent */
|
||||
|
||||
|
||||
|
@ -416,13 +416,13 @@ char *__PHYSFS_platformCurrentDir(void)
|
|||
if (os2err(rc) != NO_ERROR)
|
||||
{
|
||||
allocator.Free(retval);
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* if */
|
||||
|
||||
retval[0] = ('A' + (currentDisk - 1));
|
||||
retval[1] = ':';
|
||||
retval[2] = '\\';
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformCurrentDir */
|
||||
|
||||
|
||||
|
@ -436,14 +436,14 @@ char *__PHYSFS_platformRealPath(const char *_path)
|
|||
retval = (char *) allocator.Malloc(strlen(buf) + 1);
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
strcpy(retval, buf);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformRealPath */
|
||||
|
||||
|
||||
int __PHYSFS_platformMkDir(const char *_filename)
|
||||
{
|
||||
const unsigned char *filename = (const unsigned char *) _filename;
|
||||
return(os2err(DosCreateDir(filename, NULL)) == NO_ERROR);
|
||||
return (os2err(DosCreateDir(filename, NULL)) == NO_ERROR);
|
||||
} /* __PHYSFS_platformMkDir */
|
||||
|
||||
|
||||
|
@ -463,7 +463,7 @@ void *__PHYSFS_platformOpenRead(const char *_filename)
|
|||
OPEN_FLAGS_NOINHERIT | OPEN_SHARE_DENYWRITE |
|
||||
OPEN_ACCESS_READONLY, NULL));
|
||||
|
||||
return((void *) hfile);
|
||||
return ((void *) hfile);
|
||||
} /* __PHYSFS_platformOpenRead */
|
||||
|
||||
|
||||
|
@ -483,7 +483,7 @@ void *__PHYSFS_platformOpenWrite(const char *_filename)
|
|||
OPEN_FLAGS_NOINHERIT | OPEN_SHARE_DENYWRITE |
|
||||
OPEN_ACCESS_READWRITE, NULL));
|
||||
|
||||
return((void *) hfile);
|
||||
return ((void *) hfile);
|
||||
} /* __PHYSFS_platformOpenWrite */
|
||||
|
||||
|
||||
|
@ -513,7 +513,7 @@ void *__PHYSFS_platformOpenAppend(const char *_filename)
|
|||
} /* if */
|
||||
} /* if */
|
||||
|
||||
return((void *) hfile);
|
||||
return ((void *) hfile);
|
||||
} /* __PHYSFS_platformOpenAppend */
|
||||
|
||||
|
||||
|
@ -530,13 +530,13 @@ PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer,
|
|||
if (br < size)
|
||||
{
|
||||
DosSetFilePtr(hfile, -br, FILE_CURRENT, &br); /* try to cleanup. */
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* if */
|
||||
|
||||
buffer = (void *) ( ((char *) buffer) + size );
|
||||
} /* for */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformRead */
|
||||
|
||||
|
||||
|
@ -553,13 +553,13 @@ PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer,
|
|||
if (bw < size)
|
||||
{
|
||||
DosSetFilePtr(hfile, -bw, FILE_CURRENT, &bw); /* try to cleanup. */
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* if */
|
||||
|
||||
buffer = (void *) ( ((char *) buffer) + size );
|
||||
} /* for */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformWrite */
|
||||
|
||||
|
||||
|
@ -572,7 +572,7 @@ int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos)
|
|||
/* hooray for 32-bit filesystem limits! :) */
|
||||
BAIL_IF_MACRO((PHYSFS_uint64) dist != pos, ERR_SEEK_OUT_OF_RANGE, 0);
|
||||
|
||||
return(os2err(DosSetFilePtr(hfile, dist, FILE_BEGIN, &dummy)) == NO_ERROR);
|
||||
return (os2err(DosSetFilePtr(hfile, dist, FILE_BEGIN, &dummy)) == NO_ERROR);
|
||||
} /* __PHYSFS_platformSeek */
|
||||
|
||||
|
||||
|
@ -582,7 +582,7 @@ PHYSFS_sint64 __PHYSFS_platformTell(void *opaque)
|
|||
HFILE hfile = (HFILE) opaque;
|
||||
APIRET rc = os2err(DosSetFilePtr(hfile, 0, FILE_CURRENT, &pos));
|
||||
BAIL_IF_MACRO(rc != NO_ERROR, NULL, -1);
|
||||
return((PHYSFS_sint64) pos);
|
||||
return ((PHYSFS_sint64) pos);
|
||||
} /* __PHYSFS_platformTell */
|
||||
|
||||
|
||||
|
@ -592,7 +592,7 @@ PHYSFS_sint64 __PHYSFS_platformFileLength(void *opaque)
|
|||
HFILE hfile = (HFILE) opaque;
|
||||
APIRET rc = DosQueryFileInfo(hfile, FIL_STANDARD, &fs, sizeof (fs));
|
||||
BAIL_IF_MACRO(os2err(rc) != NO_ERROR, NULL, -1);
|
||||
return((PHYSFS_sint64) fs.cbFile);
|
||||
return ((PHYSFS_sint64) fs.cbFile);
|
||||
} /* __PHYSFS_platformFileLength */
|
||||
|
||||
|
||||
|
@ -605,19 +605,19 @@ int __PHYSFS_platformEOF(void *opaque)
|
|||
pos = __PHYSFS_platformTell(opaque);
|
||||
BAIL_IF_MACRO(pos == -1, NULL, 1); /* (*shrug*) */
|
||||
|
||||
return(pos >= len);
|
||||
return (pos >= len);
|
||||
} /* __PHYSFS_platformEOF */
|
||||
|
||||
|
||||
int __PHYSFS_platformFlush(void *opaque)
|
||||
{
|
||||
return(os2err(DosResetBuffer((HFILE) opaque) == NO_ERROR));
|
||||
return (os2err(DosResetBuffer((HFILE) opaque)) == NO_ERROR);
|
||||
} /* __PHYSFS_platformFlush */
|
||||
|
||||
|
||||
int __PHYSFS_platformClose(void *opaque)
|
||||
{
|
||||
return(os2err(DosClose((HFILE) opaque) == NO_ERROR));
|
||||
return (os2err(DosClose((HFILE) opaque)) == NO_ERROR);
|
||||
} /* __PHYSFS_platformClose */
|
||||
|
||||
|
||||
|
@ -625,9 +625,9 @@ int __PHYSFS_platformDelete(const char *_path)
|
|||
{
|
||||
const unsigned char *path = (const unsigned char *) _path;
|
||||
if (__PHYSFS_platformIsDirectory(_path))
|
||||
return(os2err(DosDeleteDir(path)) == NO_ERROR);
|
||||
return (os2err(DosDeleteDir(path)) == NO_ERROR);
|
||||
|
||||
return(os2err(DosDelete(path) == NO_ERROR));
|
||||
return (os2err(DosDelete(path)) == NO_ERROR);
|
||||
} /* __PHYSFS_platformDelete */
|
||||
|
||||
|
||||
|
@ -654,7 +654,7 @@ PHYSFS_sint64 __PHYSFS_platformGetLastModTime(const char *_fname)
|
|||
/* Convert to a format PhysicsFS can grok... */
|
||||
retval = (PHYSFS_sint64) mktime(&tm);
|
||||
BAIL_IF_MACRO(retval == -1, strerror(errno), -1);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformGetLastModTime */
|
||||
|
||||
|
||||
|
@ -668,7 +668,7 @@ void *__PHYSFS_platformGetThreadID(void)
|
|||
* default value (zero might as well do) if it does.
|
||||
*/
|
||||
BAIL_IF_MACRO(os2err(DosGetInfoBlocks(&ptib, &ppib)) != NO_ERROR, 0, 0);
|
||||
return((void *) ptib->tib_ordinal);
|
||||
return ((void *) ptib->tib_ordinal);
|
||||
} /* __PHYSFS_platformGetThreadID */
|
||||
|
||||
|
||||
|
@ -676,7 +676,7 @@ void *__PHYSFS_platformCreateMutex(void)
|
|||
{
|
||||
HMTX hmtx = NULLHANDLE;
|
||||
os2err(DosCreateMutexSem(NULL, &hmtx, 0, 0));
|
||||
return((void *) hmtx);
|
||||
return ((void *) hmtx);
|
||||
} /* __PHYSFS_platformCreateMutex */
|
||||
|
||||
|
||||
|
@ -689,7 +689,7 @@ void __PHYSFS_platformDestroyMutex(void *mutex)
|
|||
int __PHYSFS_platformGrabMutex(void *mutex)
|
||||
{
|
||||
/* Do _NOT_ call os2err() (which sets the physfs error msg) in here! */
|
||||
return(DosRequestMutexSem((HMTX) mutex, SEM_INDEFINITE_WAIT) == NO_ERROR);
|
||||
return (DosRequestMutexSem((HMTX) mutex, SEM_INDEFINITE_WAIT) == NO_ERROR);
|
||||
} /* __PHYSFS_platformGrabMutex */
|
||||
|
||||
|
||||
|
@ -702,7 +702,7 @@ void __PHYSFS_platformReleaseMutex(void *mutex)
|
|||
/* !!! FIXME: Don't use C runtime for allocators? */
|
||||
int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a)
|
||||
{
|
||||
return(0); /* just use malloc() and friends. */
|
||||
return 0; /* just use malloc() and friends. */
|
||||
} /* __PHYSFS_platformSetDefaultAllocator */
|
||||
|
||||
#endif /* PHYSFS_PLATFORM_OS2 */
|
||||
|
|
|
@ -61,7 +61,7 @@ static const char *win32strerror(void)
|
|||
} /* if */
|
||||
} /* for */
|
||||
|
||||
return((const char *) msgbuf);
|
||||
return ((const char *) msgbuf);
|
||||
} /* win32strerror */
|
||||
|
||||
|
||||
|
@ -109,7 +109,7 @@ static char *getExePath()
|
|||
if (!success)
|
||||
{
|
||||
allocator.Free(retval);
|
||||
return(NULL); /* physfs error message will be set, above. */
|
||||
return NULL; /* physfs error message will be set, above. */
|
||||
} /* if */
|
||||
|
||||
buflen = (buflen * 4) + 1;
|
||||
|
@ -117,7 +117,7 @@ static char *getExePath()
|
|||
if (charretval != NULL)
|
||||
PHYSFS_utf8fromucs2((const PHYSFS_uint16 *) retval, charretval, buflen);
|
||||
allocator.Free(retval);
|
||||
return(charretval); /* w00t. */
|
||||
return charretval; /* w00t. */
|
||||
} /* getExePath */
|
||||
|
||||
|
||||
|
@ -125,14 +125,14 @@ int __PHYSFS_platformInit(void)
|
|||
{
|
||||
userDir = getExePath();
|
||||
BAIL_IF_MACRO(userDir == NULL, NULL, 0); /* failed? */
|
||||
return(1); /* always succeed. */
|
||||
return 1; /* always succeed. */
|
||||
} /* __PHYSFS_platformInit */
|
||||
|
||||
|
||||
int __PHYSFS_platformDeinit(void)
|
||||
{
|
||||
allocator.Free(userDir);
|
||||
return(1); /* always succeed. */
|
||||
return 1; /* always succeed. */
|
||||
} /* __PHYSFS_platformDeinit */
|
||||
|
||||
|
||||
|
@ -144,7 +144,7 @@ void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
|
|||
|
||||
char *__PHYSFS_platformCalcBaseDir(const char *argv0)
|
||||
{
|
||||
return(getExePath());
|
||||
return getExePath();
|
||||
} /* __PHYSFS_platformCalcBaseDir */
|
||||
|
||||
|
||||
|
@ -163,7 +163,7 @@ char *__PHYSFS_platformGetUserDir(void)
|
|||
|
||||
void *__PHYSFS_platformGetThreadID(void)
|
||||
{
|
||||
return((void *)1); /* single threaded. */ /* !!! FIXME: is this true? */
|
||||
return ((void *)1); /* single threaded. */ /* !!! FIXME: is this true? */
|
||||
} /* __PHYSFS_platformGetThreadID */
|
||||
|
||||
|
||||
|
@ -177,7 +177,7 @@ int __PHYSFS_platformExists(const char *fname)
|
|||
retval = (GetFileAttributes(w_fname) != INVALID_FILE_ATTRIBUTES);
|
||||
__PHYSFS_smallFree(w_fname);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformExists */
|
||||
|
||||
|
||||
|
@ -197,7 +197,7 @@ int __PHYSFS_platformIsDirectory(const char *fname)
|
|||
retval = ((GetFileAttributes(w_fname) & FILE_ATTRIBUTE_DIRECTORY) != 0);
|
||||
__PHYSFS_smallFree(w_fname);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformIsDirectory */
|
||||
|
||||
|
||||
|
@ -226,7 +226,7 @@ char *__PHYSFS_platformCvtToDependent(const char *prepend,
|
|||
for (p = strchr(retval, '/'); p != NULL; p = strchr(p + 1, '/'))
|
||||
*p = '\\';
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformCvtToDependent */
|
||||
|
||||
|
||||
|
@ -298,7 +298,7 @@ void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
|||
|
||||
char *__PHYSFS_platformCurrentDir(void)
|
||||
{
|
||||
return("\\");
|
||||
return "\\";
|
||||
} /* __PHYSFS_platformCurrentDir */
|
||||
|
||||
|
||||
|
@ -306,7 +306,7 @@ char *__PHYSFS_platformRealPath(const char *path)
|
|||
{
|
||||
char *retval = (char *) allocator.Malloc(strlen(path) + 1);
|
||||
strcpy(retval,path);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformRealPath */
|
||||
|
||||
|
||||
|
@ -320,7 +320,7 @@ int __PHYSFS_platformMkDir(const char *path)
|
|||
retval = CreateDirectory(w_path, NULL);
|
||||
__PHYSFS_smallFree(w_fname);
|
||||
} /* if */
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformMkDir */
|
||||
|
||||
|
||||
|
@ -346,19 +346,19 @@ static void *doOpen(const char *fname, DWORD mode, DWORD creation, int rdonly)
|
|||
|
||||
retval->readonly = rdonly;
|
||||
retval->handle = fileHandle;
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* doOpen */
|
||||
|
||||
|
||||
void *__PHYSFS_platformOpenRead(const char *filename)
|
||||
{
|
||||
return(doOpen(filename, GENERIC_READ, OPEN_EXISTING, 1));
|
||||
return doOpen(filename, GENERIC_READ, OPEN_EXISTING, 1);
|
||||
} /* __PHYSFS_platformOpenRead */
|
||||
|
||||
|
||||
void *__PHYSFS_platformOpenWrite(const char *filename)
|
||||
{
|
||||
return(doOpen(filename, GENERIC_WRITE, CREATE_ALWAYS, 0));
|
||||
return doOpen(filename, GENERIC_WRITE, CREATE_ALWAYS, 0);
|
||||
} /* __PHYSFS_platformOpenWrite */
|
||||
|
||||
|
||||
|
@ -377,7 +377,7 @@ void *__PHYSFS_platformOpenAppend(const char *filename)
|
|||
} /* if */
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
|
||||
} /* __PHYSFS_platformOpenAppend */
|
||||
|
||||
|
@ -402,7 +402,7 @@ PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer,
|
|||
retval = CountOfBytesRead / size;
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
|
||||
} /* __PHYSFS_platformRead */
|
||||
|
||||
|
@ -427,7 +427,7 @@ PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer,
|
|||
retval = CountOfBytesWritten / size;
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
|
||||
} /* __PHYSFS_platformWrite */
|
||||
|
||||
|
@ -452,7 +452,7 @@ int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos)
|
|||
BAIL_MACRO(win32strerror(), 0);
|
||||
}
|
||||
|
||||
return(1); /* No error occured */
|
||||
return 1; /* No error occured */
|
||||
} /* __PHYSFS_platformSeek */
|
||||
|
||||
|
||||
|
@ -476,7 +476,7 @@ PHYSFS_sint64 __PHYSFS_platformTell(void *opaque)
|
|||
//assert(retval >= 0);
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformTell */
|
||||
|
||||
|
||||
|
@ -499,7 +499,7 @@ PHYSFS_sint64 __PHYSFS_platformFileLength(void *opaque)
|
|||
//assert(retval >= 0);
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformFileLength */
|
||||
|
||||
|
||||
|
@ -515,7 +515,7 @@ int __PHYSFS_platformEOF(void *opaque)
|
|||
retval = FilePosition == __PHYSFS_platformFileLength(opaque);
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformEOF */
|
||||
|
||||
|
||||
|
@ -525,7 +525,7 @@ int __PHYSFS_platformFlush(void *opaque)
|
|||
if (!fh->readonly)
|
||||
BAIL_IF_MACRO(!FlushFileBuffers(fh->handle), win32strerror(), 0);
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* __PHYSFS_platformFlush */
|
||||
|
||||
|
||||
|
@ -534,7 +534,7 @@ int __PHYSFS_platformClose(void *opaque)
|
|||
HANDLE Handle = ((winCEfile *) opaque)->handle;
|
||||
BAIL_IF_MACRO(!CloseHandle(Handle), win32strerror(), 0);
|
||||
allocator.Free(opaque);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* __PHYSFS_platformClose */
|
||||
|
||||
|
||||
|
@ -557,7 +557,7 @@ int __PHYSFS_platformDelete(const char *path)
|
|||
BAIL_IF_MACRO(retval, win32strerror(), 0);
|
||||
} /* else */
|
||||
|
||||
return(1); /* if you got here, it worked. */
|
||||
return 1; /* if you got here, it worked. */
|
||||
} /* __PHYSFS_platformDelete */
|
||||
|
||||
|
||||
|
@ -568,7 +568,7 @@ int __PHYSFS_platformDelete(const char *path)
|
|||
*/
|
||||
void *__PHYSFS_platformCreateMutex(void)
|
||||
{
|
||||
return((void *) CreateMutex(NULL, FALSE, NULL));
|
||||
return (void * CreateMutex(NULL, FALSE, NULL));
|
||||
} /* __PHYSFS_platformCreateMutex */
|
||||
|
||||
|
||||
|
@ -580,7 +580,7 @@ void __PHYSFS_platformDestroyMutex(void *mutex)
|
|||
|
||||
int __PHYSFS_platformGrabMutex(void *mutex)
|
||||
{
|
||||
return(WaitForSingleObject((HANDLE) mutex, INFINITE) != WAIT_FAILED);
|
||||
return (WaitForSingleObject((HANDLE) mutex, INFINITE) != WAIT_FAILED);
|
||||
} /* __PHYSFS_platformGrabMutex */
|
||||
|
||||
|
||||
|
@ -599,7 +599,7 @@ PHYSFS_sint64 __PHYSFS_platformGetLastModTime(const char *fname)
|
|||
/* !!! FIXME: Don't use C runtime for allocators? */
|
||||
int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a)
|
||||
{
|
||||
return(0); /* just use malloc() and friends. */
|
||||
return 0; /* just use malloc() and friends. */
|
||||
} /* __PHYSFS_platformSetDefaultAllocator */
|
||||
|
||||
#endif /* PHYSFS_PLATFORM_POCKETPC */
|
||||
|
|
|
@ -45,7 +45,7 @@ char *__PHYSFS_platformCopyEnvironmentVariable(const char *varname)
|
|||
strcpy(retval, envr);
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformCopyEnvironmentVariable */
|
||||
|
||||
|
||||
|
@ -63,7 +63,7 @@ static char *getUserNameByUID(void)
|
|||
strcpy(retval, pw->pw_name);
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* getUserNameByUID */
|
||||
|
||||
|
||||
|
@ -81,7 +81,7 @@ static char *getUserDirByUID(void)
|
|||
strcpy(retval, pw->pw_dir);
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* getUserDirByUID */
|
||||
|
||||
|
||||
|
@ -90,7 +90,7 @@ char *__PHYSFS_platformGetUserName(void)
|
|||
char *retval = getUserNameByUID();
|
||||
if (retval == NULL)
|
||||
retval = __PHYSFS_platformCopyEnvironmentVariable("USER");
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformGetUserName */
|
||||
|
||||
|
||||
|
@ -99,7 +99,7 @@ char *__PHYSFS_platformGetUserDir(void)
|
|||
char *retval = __PHYSFS_platformCopyEnvironmentVariable("HOME");
|
||||
if (retval == NULL)
|
||||
retval = getUserDirByUID();
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformGetUserDir */
|
||||
|
||||
|
||||
|
@ -107,7 +107,7 @@ int __PHYSFS_platformExists(const char *fname)
|
|||
{
|
||||
struct stat statbuf;
|
||||
BAIL_IF_MACRO(lstat(fname, &statbuf) == -1, strerror(errno), 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* __PHYSFS_platformExists */
|
||||
|
||||
|
||||
|
@ -115,7 +115,7 @@ int __PHYSFS_platformIsSymLink(const char *fname)
|
|||
{
|
||||
struct stat statbuf;
|
||||
BAIL_IF_MACRO(lstat(fname, &statbuf) == -1, strerror(errno), 0);
|
||||
return( (S_ISLNK(statbuf.st_mode)) ? 1 : 0 );
|
||||
return ( (S_ISLNK(statbuf.st_mode)) ? 1 : 0 );
|
||||
} /* __PHYSFS_platformIsSymlink */
|
||||
|
||||
|
||||
|
@ -123,7 +123,7 @@ int __PHYSFS_platformIsDirectory(const char *fname)
|
|||
{
|
||||
struct stat statbuf;
|
||||
BAIL_IF_MACRO(stat(fname, &statbuf) == -1, strerror(errno), 0);
|
||||
return( (S_ISDIR(statbuf.st_mode)) ? 1 : 0 );
|
||||
return ( (S_ISDIR(statbuf.st_mode)) ? 1 : 0 );
|
||||
} /* __PHYSFS_platformIsDirectory */
|
||||
|
||||
|
||||
|
@ -150,7 +150,7 @@ char *__PHYSFS_platformCvtToDependent(const char *prepend,
|
|||
if (append)
|
||||
strcat(retval, append);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformCvtToDependent */
|
||||
|
||||
|
||||
|
@ -230,7 +230,7 @@ int __PHYSFS_platformMkDir(const char *path)
|
|||
errno = 0;
|
||||
rc = mkdir(path, S_IRWXU);
|
||||
BAIL_IF_MACRO(rc == -1, strerror(errno), 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* __PHYSFS_platformMkDir */
|
||||
|
||||
|
||||
|
@ -264,25 +264,25 @@ static void *doOpen(const char *filename, int mode)
|
|||
} /* if */
|
||||
|
||||
*retval = fd;
|
||||
return((void *) retval);
|
||||
return ((void *) retval);
|
||||
} /* doOpen */
|
||||
|
||||
|
||||
void *__PHYSFS_platformOpenRead(const char *filename)
|
||||
{
|
||||
return(doOpen(filename, O_RDONLY));
|
||||
return doOpen(filename, O_RDONLY);
|
||||
} /* __PHYSFS_platformOpenRead */
|
||||
|
||||
|
||||
void *__PHYSFS_platformOpenWrite(const char *filename)
|
||||
{
|
||||
return(doOpen(filename, O_WRONLY | O_CREAT | O_TRUNC));
|
||||
return doOpen(filename, O_WRONLY | O_CREAT | O_TRUNC);
|
||||
} /* __PHYSFS_platformOpenWrite */
|
||||
|
||||
|
||||
void *__PHYSFS_platformOpenAppend(const char *filename)
|
||||
{
|
||||
return(doOpen(filename, O_WRONLY | O_CREAT | O_APPEND));
|
||||
return doOpen(filename, O_WRONLY | O_CREAT | O_APPEND);
|
||||
} /* __PHYSFS_platformOpenAppend */
|
||||
|
||||
|
||||
|
@ -299,7 +299,7 @@ PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer,
|
|||
if ((rc < max) && (size > 1))
|
||||
lseek(fd, -(rc % size), SEEK_CUR); /* rollback to object boundary. */
|
||||
|
||||
return(rc / size);
|
||||
return (rc / size);
|
||||
} /* __PHYSFS_platformRead */
|
||||
|
||||
|
||||
|
@ -316,7 +316,7 @@ PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer,
|
|||
if ((rc < max) && (size > 1))
|
||||
lseek(fd, -(rc % size), SEEK_CUR); /* rollback to object boundary. */
|
||||
|
||||
return(rc / size);
|
||||
return (rc / size);
|
||||
} /* __PHYSFS_platformWrite */
|
||||
|
||||
|
||||
|
@ -334,7 +334,7 @@ int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos)
|
|||
BAIL_IF_MACRO(lseek(fd, (int) pos, SEEK_SET) == -1, strerror(errno), 0);
|
||||
#endif
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* __PHYSFS_platformSeek */
|
||||
|
||||
|
||||
|
@ -353,7 +353,7 @@ PHYSFS_sint64 __PHYSFS_platformTell(void *opaque)
|
|||
BAIL_IF_MACRO(retval == -1, strerror(errno), -1);
|
||||
#endif
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformTell */
|
||||
|
||||
|
||||
|
@ -362,7 +362,7 @@ PHYSFS_sint64 __PHYSFS_platformFileLength(void *opaque)
|
|||
int fd = *((int *) opaque);
|
||||
struct stat statbuf;
|
||||
BAIL_IF_MACRO(fstat(fd, &statbuf) == -1, strerror(errno), -1);
|
||||
return((PHYSFS_sint64) statbuf.st_size);
|
||||
return ((PHYSFS_sint64) statbuf.st_size);
|
||||
} /* __PHYSFS_platformFileLength */
|
||||
|
||||
|
||||
|
@ -370,7 +370,7 @@ int __PHYSFS_platformEOF(void *opaque)
|
|||
{
|
||||
PHYSFS_sint64 pos = __PHYSFS_platformTell(opaque);
|
||||
PHYSFS_sint64 len = __PHYSFS_platformFileLength(opaque);
|
||||
return(pos >= len);
|
||||
return (pos >= len);
|
||||
} /* __PHYSFS_platformEOF */
|
||||
|
||||
|
||||
|
@ -378,7 +378,7 @@ int __PHYSFS_platformFlush(void *opaque)
|
|||
{
|
||||
int fd = *((int *) opaque);
|
||||
BAIL_IF_MACRO(fsync(fd) == -1, strerror(errno), 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* __PHYSFS_platformFlush */
|
||||
|
||||
|
||||
|
@ -387,14 +387,14 @@ int __PHYSFS_platformClose(void *opaque)
|
|||
int fd = *((int *) opaque);
|
||||
BAIL_IF_MACRO(close(fd) == -1, strerror(errno), 0);
|
||||
allocator.Free(opaque);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* __PHYSFS_platformClose */
|
||||
|
||||
|
||||
int __PHYSFS_platformDelete(const char *path)
|
||||
{
|
||||
BAIL_IF_MACRO(remove(path) == -1, strerror(errno), 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* __PHYSFS_platformDelete */
|
||||
|
||||
|
||||
|
|
|
@ -49,13 +49,13 @@
|
|||
|
||||
int __PHYSFS_platformInit(void)
|
||||
{
|
||||
return(1); /* always succeed. */
|
||||
return 1; /* always succeed. */
|
||||
} /* __PHYSFS_platformInit */
|
||||
|
||||
|
||||
int __PHYSFS_platformDeinit(void)
|
||||
{
|
||||
return(1); /* always succeed. */
|
||||
return 1; /* always succeed. */
|
||||
} /* __PHYSFS_platformDeinit */
|
||||
|
||||
|
||||
|
@ -185,7 +185,7 @@ static char *findBinaryInPath(const char *bin, char *envr)
|
|||
if (access(exe, X_OK) == 0) /* Exists as executable? We're done. */
|
||||
{
|
||||
strcpy(exe, start); /* i'm lazy. piss off. */
|
||||
return(exe);
|
||||
return exe;
|
||||
} /* if */
|
||||
|
||||
start = ptr + 1; /* start points to beginning of next element. */
|
||||
|
@ -194,7 +194,7 @@ static char *findBinaryInPath(const char *bin, char *envr)
|
|||
if (exe != NULL)
|
||||
allocator.Free(exe);
|
||||
|
||||
return(NULL); /* doesn't exist in path. */
|
||||
return NULL; /* doesn't exist in path. */
|
||||
} /* findBinaryInPath */
|
||||
|
||||
|
||||
|
@ -237,7 +237,7 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0)
|
|||
|
||||
/* fast path: default behaviour can handle this. */
|
||||
if ( (argv0 != NULL) && (strchr(argv0, '/') != NULL) )
|
||||
return(NULL); /* higher level will parse out real path from argv0. */
|
||||
return NULL; /* higher level will parse out real path from argv0. */
|
||||
|
||||
/*
|
||||
* Try to avoid using argv0 unless forced to. If there's a Linux-like
|
||||
|
@ -279,7 +279,7 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0)
|
|||
retval = ptr; /* oh well if it failed. */
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformCalcBaseDir */
|
||||
|
||||
|
||||
|
@ -294,7 +294,7 @@ char *__PHYSFS_platformRealPath(const char *path)
|
|||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
strcpy(retval, resolved_path);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformRealPath */
|
||||
|
||||
|
||||
|
@ -335,22 +335,22 @@ char *__PHYSFS_platformCurrentDir(void)
|
|||
BAIL_MACRO(ERR_NO_SUCH_FILE, NULL);
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformCurrentDir */
|
||||
|
||||
|
||||
int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a)
|
||||
{
|
||||
return(0); /* just use malloc() and friends. */
|
||||
return 0; /* just use malloc() and friends. */
|
||||
} /* __PHYSFS_platformSetDefaultAllocator */
|
||||
|
||||
|
||||
#if (defined PHYSFS_NO_PTHREADS_SUPPORT)
|
||||
|
||||
void *__PHYSFS_platformGetThreadID(void) { return((void *) 0x0001); }
|
||||
void *__PHYSFS_platformCreateMutex(void) { return((void *) 0x0001); }
|
||||
void *__PHYSFS_platformGetThreadID(void) { return ((void *) 0x0001); }
|
||||
void *__PHYSFS_platformCreateMutex(void) { return ((void *) 0x0001); }
|
||||
void __PHYSFS_platformDestroyMutex(void *mutex) {}
|
||||
int __PHYSFS_platformGrabMutex(void *mutex) { return(1); }
|
||||
int __PHYSFS_platformGrabMutex(void *mutex) { return 1; }
|
||||
void __PHYSFS_platformReleaseMutex(void *mutex) {}
|
||||
|
||||
#else
|
||||
|
@ -365,7 +365,7 @@ typedef struct
|
|||
|
||||
void *__PHYSFS_platformGetThreadID(void)
|
||||
{
|
||||
return( (void *) ((size_t) pthread_self()) );
|
||||
return ( (void *) ((size_t) pthread_self()) );
|
||||
} /* __PHYSFS_platformGetThreadID */
|
||||
|
||||
|
||||
|
@ -383,7 +383,7 @@ void *__PHYSFS_platformCreateMutex(void)
|
|||
|
||||
m->count = 0;
|
||||
m->owner = (pthread_t) 0xDEADBEEF;
|
||||
return((void *) m);
|
||||
return ((void *) m);
|
||||
} /* __PHYSFS_platformCreateMutex */
|
||||
|
||||
|
||||
|
@ -407,12 +407,12 @@ int __PHYSFS_platformGrabMutex(void *mutex)
|
|||
if (m->owner != tid)
|
||||
{
|
||||
if (pthread_mutex_lock(&m->mutex) != 0)
|
||||
return(0);
|
||||
return 0;
|
||||
m->owner = tid;
|
||||
} /* if */
|
||||
|
||||
m->count++;
|
||||
return(1);
|
||||
return 1;
|
||||
} /* __PHYSFS_platformGrabMutex */
|
||||
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ static PHYSFS_uint64 wStrLen(const WCHAR *wstr)
|
|||
PHYSFS_uint64 len = 0;
|
||||
while (*(wstr++))
|
||||
len++;
|
||||
return(len);
|
||||
return len;
|
||||
} /* wStrLen */
|
||||
|
||||
static char *unicodeToUtf8Heap(const WCHAR *w_str)
|
||||
|
@ -76,7 +76,7 @@ static char *unicodeToUtf8Heap(const WCHAR *w_str)
|
|||
if (ptr != NULL)
|
||||
retval = (char *) ptr;
|
||||
} /* if */
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* unicodeToUtf8Heap */
|
||||
|
||||
|
||||
|
@ -96,7 +96,7 @@ static char *codepageToUtf8Heap(const char *cpstr)
|
|||
PHYSFS_utf8FromUcs2(wbuf, retval, len * 4);
|
||||
__PHYSFS_smallFree(wbuf);
|
||||
} /* if */
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* codepageToUtf8Heap */
|
||||
|
||||
|
||||
|
@ -151,7 +151,7 @@ static BOOL WINAPI fallbackGetUserNameW(LPWSTR buf, LPDWORD len)
|
|||
if (buf != NULL)
|
||||
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, cpstr, cplen, buf, *len);
|
||||
__PHYSFS_smallFree(cpstr);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* fallbackGetUserNameW */
|
||||
|
||||
static DWORD WINAPI fallbackFormatMessageW(DWORD dwFlags, LPCVOID lpSource,
|
||||
|
@ -165,7 +165,7 @@ static DWORD WINAPI fallbackFormatMessageW(DWORD dwFlags, LPCVOID lpSource,
|
|||
if (retval > 0)
|
||||
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,cpbuf,retval,lpBuf,nSize);
|
||||
__PHYSFS_smallFree(cpbuf);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* fallbackFormatMessageW */
|
||||
|
||||
static DWORD WINAPI fallbackGetModuleFileNameW(HMODULE hMod, LPWCH lpBuf,
|
||||
|
@ -176,7 +176,7 @@ static DWORD WINAPI fallbackGetModuleFileNameW(HMODULE hMod, LPWCH lpBuf,
|
|||
if (retval > 0)
|
||||
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,cpbuf,retval,lpBuf,nSize);
|
||||
__PHYSFS_smallFree(cpbuf);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* fallbackGetModuleFileNameW */
|
||||
|
||||
static DWORD WINAPI fallbackGetFileAttributesW(LPCWSTR fname)
|
||||
|
@ -187,7 +187,7 @@ static DWORD WINAPI fallbackGetFileAttributesW(LPCWSTR fname)
|
|||
WideCharToMultiByte(CP_ACP, 0, fname, buflen, cpstr, buflen, NULL, NULL);
|
||||
retval = GetFileAttributesA(cpstr);
|
||||
__PHYSFS_smallFree(cpstr);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* fallbackGetFileAttributesW */
|
||||
|
||||
static DWORD WINAPI fallbackGetCurrentDirectoryW(DWORD buflen, LPWSTR buf)
|
||||
|
@ -202,7 +202,7 @@ static DWORD WINAPI fallbackGetCurrentDirectoryW(DWORD buflen, LPWSTR buf)
|
|||
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,cpbuf,retval,buf,buflen);
|
||||
__PHYSFS_smallFree(cpbuf);
|
||||
} /* if */
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* fallbackGetCurrentDirectoryW */
|
||||
|
||||
static BOOL WINAPI fallbackRemoveDirectoryW(LPCWSTR dname)
|
||||
|
@ -213,7 +213,7 @@ static BOOL WINAPI fallbackRemoveDirectoryW(LPCWSTR dname)
|
|||
WideCharToMultiByte(CP_ACP, 0, dname, buflen, cpstr, buflen, NULL, NULL);
|
||||
retval = RemoveDirectoryA(cpstr);
|
||||
__PHYSFS_smallFree(cpstr);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* fallbackRemoveDirectoryW */
|
||||
|
||||
static BOOL WINAPI fallbackCreateDirectoryW(LPCWSTR dname,
|
||||
|
@ -225,7 +225,7 @@ static BOOL WINAPI fallbackCreateDirectoryW(LPCWSTR dname,
|
|||
WideCharToMultiByte(CP_ACP, 0, dname, buflen, cpstr, buflen, NULL, NULL);
|
||||
retval = CreateDirectoryA(cpstr, attr);
|
||||
__PHYSFS_smallFree(cpstr);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* fallbackCreateDirectoryW */
|
||||
|
||||
static BOOL WINAPI fallbackDeleteFileW(LPCWSTR fname)
|
||||
|
@ -236,7 +236,7 @@ static BOOL WINAPI fallbackDeleteFileW(LPCWSTR fname)
|
|||
WideCharToMultiByte(CP_ACP, 0, fname, buflen, cpstr, buflen, NULL, NULL);
|
||||
retval = DeleteFileA(cpstr);
|
||||
__PHYSFS_smallFree(cpstr);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* fallbackDeleteFileW */
|
||||
|
||||
static HANDLE WINAPI fallbackCreateFileW(LPCWSTR fname,
|
||||
|
@ -252,7 +252,7 @@ static HANDLE WINAPI fallbackCreateFileW(LPCWSTR fname,
|
|||
retval = CreateFileA(cpstr, dwDesiredAccess, dwShareMode, lpSecurityAttrs,
|
||||
dwCreationDisposition, dwFlagsAndAttrs, hTemplFile);
|
||||
__PHYSFS_smallFree(cpstr);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* fallbackCreateFileW */
|
||||
|
||||
|
||||
|
@ -318,7 +318,7 @@ static int findApiSymbols(void)
|
|||
#undef LOOKUP_NOFALLBACK
|
||||
#undef LOOKUP
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* findApiSymbols */
|
||||
|
||||
|
||||
|
@ -360,7 +360,7 @@ static const char *winApiStrError(void)
|
|||
|
||||
/* may truncate, but oh well. */
|
||||
PHYSFS_utf8FromUcs2((PHYSFS_uint16 *) msgbuf, utf8buf, sizeof (utf8buf));
|
||||
return((const char *) utf8buf);
|
||||
return ((const char *) utf8buf);
|
||||
} /* winApiStrError */
|
||||
|
||||
|
||||
|
@ -418,7 +418,7 @@ static char *getExePath(void)
|
|||
} /* else */
|
||||
allocator.Free(modpath);
|
||||
|
||||
return(retval); /* w00t. */
|
||||
return retval; /* w00t. */
|
||||
} /* getExePath */
|
||||
|
||||
|
||||
|
@ -435,7 +435,7 @@ static char *getExePath(void)
|
|||
static int determineUserDir(void)
|
||||
{
|
||||
if (userDir != NULL)
|
||||
return(1); /* already good to go. */
|
||||
return 1; /* already good to go. */
|
||||
|
||||
/*
|
||||
* GetUserProfileDirectoryW() is only available on NT 4.0 and later.
|
||||
|
@ -483,7 +483,7 @@ static int determineUserDir(void)
|
|||
BAIL_IF_MACRO(userDir == NULL, NULL, 0); /* STILL failed?! */
|
||||
} /* if */
|
||||
|
||||
return(1); /* We made it: hit the showers. */
|
||||
return 1; /* We made it: hit the showers. */
|
||||
} /* determineUserDir */
|
||||
|
||||
|
||||
|
@ -502,7 +502,7 @@ static BOOL mediaInDrive(const char *drive)
|
|||
/* Revert back to old windows error handler */
|
||||
SetErrorMode(oldErrorMode);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* mediaInDrive */
|
||||
|
||||
|
||||
|
@ -524,9 +524,9 @@ void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
|
|||
char *__PHYSFS_platformCalcBaseDir(const char *argv0)
|
||||
{
|
||||
if ((argv0 != NULL) && (strchr(argv0, '\\') != NULL))
|
||||
return(NULL); /* default behaviour can handle this. */
|
||||
return NULL; /* default behaviour can handle this. */
|
||||
|
||||
return(getExePath());
|
||||
return getExePath();
|
||||
} /* __PHYSFS_platformCalcBaseDir */
|
||||
|
||||
|
||||
|
@ -546,7 +546,7 @@ char *__PHYSFS_platformGetUserName(void)
|
|||
__PHYSFS_smallFree(wbuf);
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformGetUserName */
|
||||
|
||||
|
||||
|
@ -555,13 +555,13 @@ char *__PHYSFS_platformGetUserDir(void)
|
|||
char *retval = (char *) allocator.Malloc(strlen(userDir) + 1);
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
strcpy(retval, userDir); /* calculated at init time. */
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformGetUserDir */
|
||||
|
||||
|
||||
void *__PHYSFS_platformGetThreadID(void)
|
||||
{
|
||||
return( (void *) ((size_t) GetCurrentThreadId()) );
|
||||
return ( (void *) ((size_t) GetCurrentThreadId()) );
|
||||
} /* __PHYSFS_platformGetThreadID */
|
||||
|
||||
|
||||
|
@ -572,7 +572,7 @@ static int doPlatformExists(LPWSTR wpath)
|
|||
pGetFileAttributesW(wpath) == PHYSFS_INVALID_FILE_ATTRIBUTES,
|
||||
winApiStrError(), 0
|
||||
);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* doPlatformExists */
|
||||
|
||||
|
||||
|
@ -584,7 +584,7 @@ int __PHYSFS_platformExists(const char *fname)
|
|||
BAIL_IF_MACRO(wpath == NULL, ERR_OUT_OF_MEMORY, 0);
|
||||
retval = doPlatformExists(wpath);
|
||||
__PHYSFS_smallFree(wpath);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformExists */
|
||||
|
||||
|
||||
|
@ -624,7 +624,7 @@ int __PHYSFS_platformIsSymLink(const char *fname)
|
|||
} /* if */
|
||||
|
||||
__PHYSFS_smallFree(wpath);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformIsSymlink */
|
||||
|
||||
|
||||
|
@ -636,7 +636,7 @@ int __PHYSFS_platformIsDirectory(const char *fname)
|
|||
BAIL_IF_MACRO(wpath == NULL, ERR_OUT_OF_MEMORY, 0);
|
||||
retval = ((pGetFileAttributesW(wpath) & FILE_ATTRIBUTE_DIRECTORY) != 0);
|
||||
__PHYSFS_smallFree(wpath);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformIsDirectory */
|
||||
|
||||
|
||||
|
@ -665,7 +665,7 @@ char *__PHYSFS_platformCvtToDependent(const char *prepend,
|
|||
for (p = strchr(retval, '/'); p != NULL; p = strchr(p + 1, '/'))
|
||||
*p = '\\';
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformCvtToDependent */
|
||||
|
||||
|
||||
|
@ -796,7 +796,7 @@ char *__PHYSFS_platformCurrentDir(void)
|
|||
|
||||
retval = unicodeToUtf8Heap(wbuf);
|
||||
__PHYSFS_smallFree(wbuf);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformCurrentDir */
|
||||
|
||||
|
||||
|
@ -921,7 +921,7 @@ char *__PHYSFS_platformRealPath(const char *path)
|
|||
if (p != NULL)
|
||||
retval = p;
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformRealPath */
|
||||
|
||||
|
||||
|
@ -933,7 +933,7 @@ int __PHYSFS_platformMkDir(const char *path)
|
|||
rc = pCreateDirectoryW(wpath, NULL);
|
||||
__PHYSFS_smallFree(wpath);
|
||||
BAIL_IF_MACRO(rc == 0, winApiStrError(), 0);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* __PHYSFS_platformMkDir */
|
||||
|
||||
|
||||
|
@ -948,7 +948,7 @@ static int getOSInfo(void)
|
|||
osVerInfo.dwOSVersionInfoSize = sizeof(osVerInfo);
|
||||
BAIL_IF_MACRO(!GetVersionEx(&osVerInfo), winApiStrError(), 0);
|
||||
osHasUnicode = (osVerInfo.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* getOSInfo */
|
||||
|
||||
|
||||
|
@ -957,7 +957,7 @@ int __PHYSFS_platformInit(void)
|
|||
BAIL_IF_MACRO(!getOSInfo(), NULL, 0);
|
||||
BAIL_IF_MACRO(!findApiSymbols(), NULL, 0);
|
||||
BAIL_IF_MACRO(!determineUserDir(), NULL, 0);
|
||||
return(1); /* It's all good */
|
||||
return 1; /* It's all good */
|
||||
} /* __PHYSFS_platformInit */
|
||||
|
||||
|
||||
|
@ -977,7 +977,7 @@ int __PHYSFS_platformDeinit(void)
|
|||
*(libs[i]) = NULL;
|
||||
} /* for */
|
||||
|
||||
return(1); /* It's all good */
|
||||
return 1; /* It's all good */
|
||||
} /* __PHYSFS_platformDeinit */
|
||||
|
||||
|
||||
|
@ -1008,19 +1008,19 @@ static void *doOpen(const char *fname, DWORD mode, DWORD creation, int rdonly)
|
|||
|
||||
retval->readonly = rdonly;
|
||||
retval->handle = fileHandle;
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* doOpen */
|
||||
|
||||
|
||||
void *__PHYSFS_platformOpenRead(const char *filename)
|
||||
{
|
||||
return(doOpen(filename, GENERIC_READ, OPEN_EXISTING, 1));
|
||||
return doOpen(filename, GENERIC_READ, OPEN_EXISTING, 1);
|
||||
} /* __PHYSFS_platformOpenRead */
|
||||
|
||||
|
||||
void *__PHYSFS_platformOpenWrite(const char *filename)
|
||||
{
|
||||
return(doOpen(filename, GENERIC_WRITE, CREATE_ALWAYS, 0));
|
||||
return doOpen(filename, GENERIC_WRITE, CREATE_ALWAYS, 0);
|
||||
} /* __PHYSFS_platformOpenWrite */
|
||||
|
||||
|
||||
|
@ -1040,7 +1040,7 @@ void *__PHYSFS_platformOpenAppend(const char *filename)
|
|||
} /* if */
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformOpenAppend */
|
||||
|
||||
|
||||
|
@ -1064,7 +1064,7 @@ PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer,
|
|||
retval = CountOfBytesRead / size;
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformRead */
|
||||
|
||||
|
||||
|
@ -1088,7 +1088,7 @@ PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer,
|
|||
retval = CountOfBytesWritten / size;
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformWrite */
|
||||
|
||||
|
||||
|
@ -1126,7 +1126,7 @@ int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos)
|
|||
BAIL_MACRO(winApiStrError(), 0);
|
||||
} /* if */
|
||||
|
||||
return(1); /* No error occured */
|
||||
return 1; /* No error occured */
|
||||
} /* __PHYSFS_platformSeek */
|
||||
|
||||
|
||||
|
@ -1151,7 +1151,7 @@ PHYSFS_sint64 __PHYSFS_platformTell(void *opaque)
|
|||
assert(retval >= 0);
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformTell */
|
||||
|
||||
|
||||
|
@ -1175,7 +1175,7 @@ PHYSFS_sint64 __PHYSFS_platformFileLength(void *opaque)
|
|||
assert(retval >= 0);
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformFileLength */
|
||||
|
||||
|
||||
|
@ -1191,7 +1191,7 @@ int __PHYSFS_platformEOF(void *opaque)
|
|||
retval = FilePosition == __PHYSFS_platformFileLength(opaque);
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformEOF */
|
||||
|
||||
|
||||
|
@ -1201,7 +1201,7 @@ int __PHYSFS_platformFlush(void *opaque)
|
|||
if (!fh->readonly)
|
||||
BAIL_IF_MACRO(!FlushFileBuffers(fh->handle), winApiStrError(), 0);
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* __PHYSFS_platformFlush */
|
||||
|
||||
|
||||
|
@ -1210,7 +1210,7 @@ int __PHYSFS_platformClose(void *opaque)
|
|||
HANDLE Handle = ((WinApiFile *) opaque)->handle;
|
||||
BAIL_IF_MACRO(!CloseHandle(Handle), winApiStrError(), 0);
|
||||
allocator.Free(opaque);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* __PHYSFS_platformClose */
|
||||
|
||||
|
||||
|
@ -1226,7 +1226,7 @@ static int doPlatformDelete(LPWSTR wpath)
|
|||
BAIL_IF_MACRO(!pDeleteFileW(wpath), winApiStrError(), 0);
|
||||
} /* else */
|
||||
|
||||
return(1); /* if you made it here, it worked. */
|
||||
return 1; /* if you made it here, it worked. */
|
||||
} /* doPlatformDelete */
|
||||
|
||||
|
||||
|
@ -1238,7 +1238,7 @@ int __PHYSFS_platformDelete(const char *path)
|
|||
BAIL_IF_MACRO(wpath == NULL, ERR_OUT_OF_MEMORY, 0);
|
||||
retval = doPlatformDelete(wpath);
|
||||
__PHYSFS_smallFree(wpath);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformDelete */
|
||||
|
||||
|
||||
|
@ -1249,7 +1249,7 @@ int __PHYSFS_platformDelete(const char *path)
|
|||
*/
|
||||
void *__PHYSFS_platformCreateMutex(void)
|
||||
{
|
||||
return((void *) CreateMutex(NULL, FALSE, NULL));
|
||||
return ((void *) CreateMutex(NULL, FALSE, NULL));
|
||||
} /* __PHYSFS_platformCreateMutex */
|
||||
|
||||
|
||||
|
@ -1261,7 +1261,7 @@ void __PHYSFS_platformDestroyMutex(void *mutex)
|
|||
|
||||
int __PHYSFS_platformGrabMutex(void *mutex)
|
||||
{
|
||||
return(WaitForSingleObject((HANDLE) mutex, INFINITE) != WAIT_FAILED);
|
||||
return (WaitForSingleObject((HANDLE) mutex, INFINITE) != WAIT_FAILED);
|
||||
} /* __PHYSFS_platformGrabMutex */
|
||||
|
||||
|
||||
|
@ -1324,7 +1324,7 @@ static PHYSFS_sint64 FileTimeToPhysfsTime(const FILETIME *ft)
|
|||
/* Convert to a format PhysicsFS can grok... */
|
||||
retval = (PHYSFS_sint64) mktime(&tm);
|
||||
BAIL_IF_MACRO(retval == -1, strerror(errno), -1);
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* FileTimeToPhysfsTime */
|
||||
|
||||
|
||||
|
@ -1386,14 +1386,14 @@ PHYSFS_sint64 __PHYSFS_platformGetLastModTime(const char *fname)
|
|||
retval = FileTimeToPhysfsTime(&ft);
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* __PHYSFS_platformGetLastModTime */
|
||||
|
||||
|
||||
/* !!! FIXME: Don't use C runtime for allocators? */
|
||||
int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a)
|
||||
{
|
||||
return(0); /* just use malloc() and friends. */
|
||||
return 0; /* just use malloc() and friends. */
|
||||
} /* __PHYSFS_platformSetDefaultAllocator */
|
||||
|
||||
#endif /* PHYSFS_PLATFORM_WINDOWS */
|
||||
|
|
|
@ -73,7 +73,7 @@ static void output_archivers(void)
|
|||
|
||||
static int cmd_quit(char *args)
|
||||
{
|
||||
return(0);
|
||||
return 0;
|
||||
} /* cmd_quit */
|
||||
|
||||
|
||||
|
@ -90,7 +90,7 @@ static int cmd_init(char *args)
|
|||
else
|
||||
printf("Failure. reason: %s.\n", PHYSFS_getLastError());
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_init */
|
||||
|
||||
|
||||
|
@ -101,7 +101,7 @@ static int cmd_deinit(char *args)
|
|||
else
|
||||
printf("Failure. reason: %s.\n", PHYSFS_getLastError());
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_deinit */
|
||||
|
||||
|
||||
|
@ -124,7 +124,7 @@ static int cmd_addarchive(char *args)
|
|||
else
|
||||
printf("Failure. reason: %s.\n", PHYSFS_getLastError());
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_addarchive */
|
||||
|
||||
|
||||
|
@ -141,7 +141,7 @@ static int cmd_mount(char *args)
|
|||
if (ptr == NULL)
|
||||
{
|
||||
printf("missing string terminator in argument.\n");
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
*(ptr) = '\0';
|
||||
} /* if */
|
||||
|
@ -159,7 +159,7 @@ static int cmd_mount(char *args)
|
|||
if (ptr == NULL)
|
||||
{
|
||||
printf("missing string terminator in argument.\n");
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
*(ptr) = '\0';
|
||||
} /* if */
|
||||
|
@ -177,7 +177,7 @@ static int cmd_mount(char *args)
|
|||
else
|
||||
printf("Failure. reason: %s.\n", PHYSFS_getLastError());
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_mount */
|
||||
|
||||
|
||||
|
@ -194,7 +194,7 @@ static int cmd_removearchive(char *args)
|
|||
else
|
||||
printf("Failure. reason: %s.\n", PHYSFS_getLastError());
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_removearchive */
|
||||
|
||||
|
||||
|
@ -223,21 +223,21 @@ static int cmd_enumerate(char *args)
|
|||
PHYSFS_freeList(rc);
|
||||
} /* else */
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_enumerate */
|
||||
|
||||
|
||||
static int cmd_getdirsep(char *args)
|
||||
{
|
||||
printf("Directory separator is [%s].\n", PHYSFS_getDirSeparator());
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_getdirsep */
|
||||
|
||||
|
||||
static int cmd_getlasterror(char *args)
|
||||
{
|
||||
printf("last error is [%s].\n", PHYSFS_getLastError());
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_getlasterror */
|
||||
|
||||
|
||||
|
@ -258,7 +258,7 @@ static int cmd_getcdromdirs(char *args)
|
|||
PHYSFS_freeList(rc);
|
||||
} /* else */
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_getcdromdirs */
|
||||
|
||||
|
||||
|
@ -279,28 +279,28 @@ static int cmd_getsearchpath(char *args)
|
|||
PHYSFS_freeList(rc);
|
||||
} /* else */
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_getcdromdirs */
|
||||
|
||||
|
||||
static int cmd_getbasedir(char *args)
|
||||
{
|
||||
printf("Base dir is [%s].\n", PHYSFS_getBaseDir());
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_getbasedir */
|
||||
|
||||
|
||||
static int cmd_getuserdir(char *args)
|
||||
{
|
||||
printf("User dir is [%s].\n", PHYSFS_getUserDir());
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_getuserdir */
|
||||
|
||||
|
||||
static int cmd_getwritedir(char *args)
|
||||
{
|
||||
printf("Write dir is [%s].\n", PHYSFS_getWriteDir());
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_getwritedir */
|
||||
|
||||
|
||||
|
@ -317,7 +317,7 @@ static int cmd_setwritedir(char *args)
|
|||
else
|
||||
printf("Failure. reason: %s.\n", PHYSFS_getLastError());
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_setwritedir */
|
||||
|
||||
|
||||
|
@ -334,7 +334,7 @@ static int cmd_permitsyms(char *args)
|
|||
num = atoi(args);
|
||||
PHYSFS_permitSymbolicLinks(num);
|
||||
printf("Symlinks are now %s.\n", num ? "permitted" : "forbidden");
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_permitsyms */
|
||||
|
||||
|
||||
|
@ -358,7 +358,7 @@ static int cmd_setbuffer(char *args)
|
|||
printf("Further tests will NOT use a buffer.\n");
|
||||
} /* else */
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_setbuffer */
|
||||
|
||||
|
||||
|
@ -395,7 +395,7 @@ static int cmd_stressbuffer(char *args)
|
|||
printf("PHYSFS_setBuffer() failed: %s.\n", PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
PHYSFS_delete("test.txt");
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
strcpy(buf, "abcdefghijklmnopqrstuvwxyz0123456789");
|
||||
|
@ -411,7 +411,7 @@ static int cmd_stressbuffer(char *args)
|
|||
{
|
||||
printf("PHYSFS_write() failed: %s.\n", PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
rndnum = 1 + (int) (1000.0 * rand() / (RAND_MAX + 1.0));
|
||||
|
@ -421,7 +421,7 @@ static int cmd_stressbuffer(char *args)
|
|||
{
|
||||
printf("PHYSFS_flush() failed: %s.\n", PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
} /* if */
|
||||
|
||||
|
@ -429,7 +429,7 @@ static int cmd_stressbuffer(char *args)
|
|||
{
|
||||
printf("PHYSFS_write() failed: %s.\n", PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
rndnum = 1 + (int) (1000.0 * rand() / (RAND_MAX + 1.0));
|
||||
|
@ -439,7 +439,7 @@ static int cmd_stressbuffer(char *args)
|
|||
{
|
||||
printf("PHYSFS_flush() failed: %s.\n", PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
} /* if */
|
||||
} /* for */
|
||||
|
@ -448,7 +448,7 @@ static int cmd_stressbuffer(char *args)
|
|||
{
|
||||
printf("PHYSFS_flush() failed: %s.\n", PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
} /* for */
|
||||
|
@ -456,7 +456,7 @@ static int cmd_stressbuffer(char *args)
|
|||
if (!PHYSFS_close(f))
|
||||
{
|
||||
printf("PHYSFS_close() failed: %s.\n", PHYSFS_getLastError());
|
||||
return(1); /* oh well. */
|
||||
return 1; /* oh well. */
|
||||
} /* if */
|
||||
|
||||
printf(" ... test file written ...\n");
|
||||
|
@ -464,14 +464,14 @@ static int cmd_stressbuffer(char *args)
|
|||
if (f == NULL)
|
||||
{
|
||||
printf("Failed to reopen stress file for reading: %s.\n", PHYSFS_getLastError());
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_setBuffer(f, num))
|
||||
{
|
||||
printf("PHYSFS_setBuffer() failed: %s.\n", PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
|
@ -484,7 +484,7 @@ static int cmd_stressbuffer(char *args)
|
|||
{
|
||||
printf("PHYSFS_read() failed: %s.\n", PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
rndnum = 1 + (int) (1000.0 * rand() / (RAND_MAX + 1.0));
|
||||
|
@ -494,7 +494,7 @@ static int cmd_stressbuffer(char *args)
|
|||
{
|
||||
printf("PHYSFS_flush() failed: %s.\n", PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
} /* if */
|
||||
|
||||
|
@ -502,7 +502,7 @@ static int cmd_stressbuffer(char *args)
|
|||
{
|
||||
printf("PHYSFS_read() failed: %s.\n", PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
rndnum = 1 + (int) (1000.0 * rand() / (RAND_MAX + 1.0));
|
||||
|
@ -512,7 +512,7 @@ static int cmd_stressbuffer(char *args)
|
|||
{
|
||||
printf("PHYSFS_flush() failed: %s.\n", PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
} /* if */
|
||||
|
||||
|
@ -529,7 +529,7 @@ static int cmd_stressbuffer(char *args)
|
|||
printf("%c", buf2[i]);
|
||||
printf("]\n");
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
} /* for */
|
||||
|
||||
|
@ -537,7 +537,7 @@ static int cmd_stressbuffer(char *args)
|
|||
{
|
||||
printf("PHYSFS_flush() failed: %s.\n", PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
} /* for */
|
||||
|
@ -550,7 +550,7 @@ static int cmd_stressbuffer(char *args)
|
|||
if (!PHYSFS_close(f))
|
||||
{
|
||||
printf("PHYSFS_close() failed: %s.\n", PHYSFS_getLastError());
|
||||
return(1); /* oh well. */
|
||||
return 1; /* oh well. */
|
||||
} /* if */
|
||||
|
||||
PHYSFS_delete("test.txt");
|
||||
|
@ -558,7 +558,7 @@ static int cmd_stressbuffer(char *args)
|
|||
} /* else */
|
||||
} /* else */
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_stressbuffer */
|
||||
|
||||
|
||||
|
@ -586,7 +586,7 @@ static int cmd_setsaneconfig(char *args)
|
|||
else
|
||||
printf("Failure. reason: %s.\n", PHYSFS_getLastError());
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_setsaneconfig */
|
||||
|
||||
|
||||
|
@ -603,7 +603,7 @@ static int cmd_mkdir(char *args)
|
|||
else
|
||||
printf("Failure. reason: %s.\n", PHYSFS_getLastError());
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_mkdir */
|
||||
|
||||
|
||||
|
@ -620,7 +620,7 @@ static int cmd_delete(char *args)
|
|||
else
|
||||
printf("Failure. reason: %s.\n", PHYSFS_getLastError());
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_delete */
|
||||
|
||||
|
||||
|
@ -640,7 +640,7 @@ static int cmd_getrealdir(char *args)
|
|||
else
|
||||
printf("Not found.\n");
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_getrealdir */
|
||||
|
||||
|
||||
|
@ -656,7 +656,7 @@ static int cmd_exists(char *args)
|
|||
|
||||
rc = PHYSFS_exists(args);
|
||||
printf("File %sexists.\n", rc ? "" : "does not ");
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_exists */
|
||||
|
||||
|
||||
|
@ -672,7 +672,7 @@ static int cmd_isdir(char *args)
|
|||
|
||||
rc = PHYSFS_isDirectory(args);
|
||||
printf("File %s a directory.\n", rc ? "is" : "is NOT");
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_isdir */
|
||||
|
||||
|
||||
|
@ -688,7 +688,7 @@ static int cmd_issymlink(char *args)
|
|||
|
||||
rc = PHYSFS_isSymbolicLink(args);
|
||||
printf("File %s a symlink.\n", rc ? "is" : "is NOT");
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_issymlink */
|
||||
|
||||
|
||||
|
@ -714,7 +714,7 @@ static int cmd_cat(char *args)
|
|||
printf("failed to set file buffer. Reason: [%s].\n",
|
||||
PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
} /* if */
|
||||
|
||||
|
@ -737,12 +737,12 @@ static int cmd_cat(char *args)
|
|||
PHYSFS_getLastError());
|
||||
} /* if */
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
} /* while */
|
||||
} /* else */
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_cat */
|
||||
|
||||
|
||||
|
@ -770,7 +770,7 @@ static int cmd_filelength(char *args)
|
|||
PHYSFS_close(f);
|
||||
} /* else */
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_filelength */
|
||||
|
||||
|
||||
|
@ -801,7 +801,7 @@ static int cmd_append(char *args)
|
|||
printf("failed to set file buffer. Reason: [%s].\n",
|
||||
PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
} /* if */
|
||||
|
||||
|
@ -820,7 +820,7 @@ static int cmd_append(char *args)
|
|||
PHYSFS_close(f);
|
||||
} /* else */
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_append */
|
||||
|
||||
|
||||
|
@ -849,7 +849,7 @@ static int cmd_write(char *args)
|
|||
printf("failed to set file buffer. Reason: [%s].\n",
|
||||
PHYSFS_getLastError());
|
||||
PHYSFS_close(f);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
} /* if */
|
||||
|
||||
|
@ -868,7 +868,7 @@ static int cmd_write(char *args)
|
|||
PHYSFS_close(f);
|
||||
} /* else */
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_write */
|
||||
|
||||
|
||||
|
@ -893,7 +893,7 @@ static int cmd_getlastmodtime(char *args)
|
|||
printf("Last modified: %s (%ld).\n", modstr, (long) rc);
|
||||
} /* else */
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* cmd_getLastModTime */
|
||||
|
||||
|
||||
|
@ -915,7 +915,7 @@ static int count_args(const char *str)
|
|||
retval++;
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* count_args */
|
||||
|
||||
|
||||
|
@ -985,7 +985,7 @@ static int cmd_help(char *args)
|
|||
for (i = commands; i->cmd != NULL; i++)
|
||||
output_usage(" -", i);
|
||||
|
||||
return(1);
|
||||
return 1;
|
||||
} /* output_cmd_help */
|
||||
|
||||
|
||||
|
@ -1037,14 +1037,14 @@ static int process_command(char *complete_cmd)
|
|||
if (complete_cmd == NULL) /* can happen if user hits CTRL-D, etc. */
|
||||
{
|
||||
printf("\n");
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
cmd_copy = (char *) malloc(strlen(complete_cmd) + 1);
|
||||
if (cmd_copy == NULL)
|
||||
{
|
||||
printf("\n\n\nOUT OF MEMORY!\n\n\n");
|
||||
return(0);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
trim_command(complete_cmd, cmd_copy);
|
||||
|
@ -1084,7 +1084,7 @@ static int process_command(char *complete_cmd)
|
|||
} /* if */
|
||||
|
||||
free(cmd_copy);
|
||||
return(rc);
|
||||
return rc;
|
||||
} /* process_command */
|
||||
|
||||
|
||||
|
@ -1155,7 +1155,7 @@ int main(int argc, char **argv)
|
|||
if (!PHYSFS_init(argv[0]))
|
||||
{
|
||||
printf("PHYSFS_init() failed!\n reason: %s.\n", PHYSFS_getLastError());
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
output_versions();
|
||||
|
@ -1215,7 +1215,7 @@ int main(int argc, char **argv)
|
|||
printf(" it makes you shoot teh railgun bettar.\n");
|
||||
*/
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
} /* main */
|
||||
|
||||
/* end of test_physfs.c ... */
|
||||
|
|
Loading…
Reference in New Issue