Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tabs-to-spaces patch by James Turk.
  • Loading branch information
icculus committed Jul 20, 2003
1 parent db279de commit f4309f5
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 123 deletions.
6 changes: 3 additions & 3 deletions archivers/zip.c
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions extras/abs-file.h
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down
46 changes: 23 additions & 23 deletions physfs.c
Expand Up @@ -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 */


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

/*
Expand Down Expand Up @@ -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);
Expand Down
26 changes: 13 additions & 13 deletions physfs_byteorder.c
Expand Up @@ -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
Expand All @@ -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 */

Expand Down
8 changes: 4 additions & 4 deletions physfs_internal.h
Expand Up @@ -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);

/*
Expand Down

0 comments on commit f4309f5

Please sign in to comment.