Skip to content
Permalink
Browse files
Tabs-to-spaces patch by James Turk.
  • Loading branch information
icculus committed Jul 20, 2003
1 parent db279de commit f4309f51e80c51c7e41c94f351330127b94cdd70
Showing with 123 additions and 123 deletions.
  1. +3 −3 archivers/zip.c
  2. +5 −5 extras/abs-file.h
  3. +23 −23 physfs.c
  4. +13 −13 physfs_byteorder.c
  5. +4 −4 physfs_internal.h
  6. +75 −75 platform/pocketpc.c
@@ -899,9 +899,9 @@ static int zip_has_symlink_attr(ZIPentry *entry, PHYSFS_uint32 extern_attr)
static PHYSFS_sint64 zip_dos_time_to_physfs_time(PHYSFS_uint32 dostime)
{
#ifdef _WIN32_WCE
/* We have no struct tm and no mktime right now.
FIXME: This should probably be fixed at some point.
*/
/* We have no struct tm and no mktime right now.
FIXME: This should probably be fixed at some point.
*/
return -1;
#else
PHYSFS_uint32 dosdate;
@@ -118,8 +118,8 @@ static int MY_GETC(MY_FILETYPE *const fp) {
}
return c;
}
static char * MY_GETS(char * const str, const int size,
MY_FILETYPE *const fp) {
static char * MY_GETS(char * const str, const int size,
MY_FILETYPE *const fp) {
int i = 0;
int c;
do {
@@ -131,9 +131,9 @@ static char * MY_GETS(char * const str, const int size,
break;
}
str[i++] = c;
} while (c != '\0' &&
c != -1 &&
c != '\n');
} while (c != '\0' &&
c != -1 &&
c != '\n');
str[i] = '\0';
if (i == 0) {
return NULL;
@@ -165,32 +165,32 @@ static void __PHYSFS_quick_sort(void *a, PHYSFS_uint32 lo, PHYSFS_uint32 hi,
PHYSFS_uint32 j;
PHYSFS_uint32 v;

if ((hi - lo) <= PHYSFS_QUICKSORT_THRESHOLD)
if ((hi - lo) <= PHYSFS_QUICKSORT_THRESHOLD)
__PHYSFS_bubble_sort(a, lo, hi, cmpfn, swapfn);
else
{
i = (hi + lo) / 2;
{
i = (hi + lo) / 2;

if (cmpfn(a, lo, i) > 0) swapfn(a, lo, i);
if (cmpfn(a, lo, hi) > 0) swapfn(a, lo, hi);
if (cmpfn(a, i, hi) > 0) swapfn(a, i, hi);

j = hi - 1;
swapfn(a, i, j);
i = lo;
v = j;
while (1)
{
while(cmpfn(a, ++i, v) < 0) { /* do nothing */ }
while(cmpfn(a, --j, v) > 0) { /* do nothing */ }
if (j < i)
if (cmpfn(a, lo, hi) > 0) swapfn(a, lo, hi);
if (cmpfn(a, i, hi) > 0) swapfn(a, i, hi);

j = hi - 1;
swapfn(a, i, j);
i = lo;
v = j;
while (1)
{
while(cmpfn(a, ++i, v) < 0) { /* do nothing */ }
while(cmpfn(a, --j, v) > 0) { /* do nothing */ }
if (j < i)
break;
swapfn(a, i, j);
} /* while */
swapfn(a, i, hi-1);
__PHYSFS_quick_sort(a, lo, j, cmpfn, swapfn);
__PHYSFS_quick_sort(a, i+1, hi, cmpfn, swapfn);
} /* else */
swapfn(a, i, j);
} /* while */
swapfn(a, i, hi-1);
__PHYSFS_quick_sort(a, lo, j, cmpfn, swapfn);
__PHYSFS_quick_sort(a, i+1, hi, cmpfn, swapfn);
} /* else */
} /* __PHYSFS_quick_sort */


@@ -675,7 +675,7 @@ static char *calculateBaseDir(const char *argv0)
*/
retval = __PHYSFS_platformCurrentDir();
if(retval != NULL) {
return(retval);
return(retval);
}

/*
@@ -1851,7 +1851,7 @@ PHYSFS_sint64 PHYSFS_fileLength(PHYSFS_file *handle)
int PHYSFS_setBuffer(PHYSFS_file *handle, PHYSFS_uint64 _bufsize)
{
FileHandle *h = (FileHandle *) handle->opaque;
PHYSFS_uint32 bufsize = (PHYSFS_uint32) _bufsize;
PHYSFS_uint32 bufsize = (PHYSFS_uint32) _bufsize;

BAIL_IF_MACRO(_bufsize > 0xFFFFFFFF, "buffer must fit in 32-bits", 0);
BAIL_IF_MACRO(!PHYSFS_flush(handle), NULL, 0);
@@ -54,28 +54,28 @@
#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
#ifndef PHYSFS_Swap64
static __inline__ PHYSFS_uint64 PHYSFS_Swap64(PHYSFS_uint64 val) {
PHYSFS_uint32 hi, lo;

/* Separate into high and low 32-bit values and swap them */
lo = (PHYSFS_uint32)(val&0xFFFFFFFF);
val >>= 32;
hi = (PHYSFS_uint32)(val&0xFFFFFFFF);
val = PHYSFS_Swap32(lo);
val <<= 32;
val |= PHYSFS_Swap32(hi);
return(val);
PHYSFS_uint32 hi, lo;

/* Separate into high and low 32-bit values and swap them */
lo = (PHYSFS_uint32)(val&0xFFFFFFFF);
val >>= 32;
hi = (PHYSFS_uint32)(val&0xFFFFFFFF);
val = PHYSFS_Swap32(lo);
val <<= 32;
val |= PHYSFS_Swap32(hi);
return(val);
}
#endif
#else
@@ -84,7 +84,7 @@ static __inline__ PHYSFS_uint64 PHYSFS_Swap64(PHYSFS_uint64 val) {
If there is no real 64-bit datatype, then compilers will complain about
the fake 64-bit datatype that PHYSFS provides when it compiles user code.
*/
#define PHYSFS_Swap64(X) (X)
#define PHYSFS_Swap64(X) (X)
#endif
#endif /* PHYSFS_NO_64BIT_SUPPORT */

@@ -622,15 +622,15 @@ typedef struct __PHYSFS_DIRFUNCTIONS__
int (*isSymLink)(DirHandle *r, const char *name, int *fileExists);

/*
* Retrieve the last modification time (mtime) of a file.
* Returns -1 on failure, or the file's mtime in seconds since
* the epoch (Jan 1, 1970) on success.
* Retrieve the last modification time (mtime) of a file.
* Returns -1 on failure, or the file's mtime in seconds since
* the epoch (Jan 1, 1970) on success.
* This filename is in platform-independent notation.
*
* Regardless of success or failure, please set *exists to
* non-zero if the file existed (even if it's a broken symlink!),
* zero if it did not.
*/
*/
PHYSFS_sint64 (*getLastModTime)(DirHandle *r, const char *fnm, int *exist);

/*

0 comments on commit f4309f5

Please sign in to comment.