--- a/src/physfs_byteorder.c Mon Nov 16 12:26:28 2009 -0500
+++ b/src/physfs_byteorder.c Thu Jan 28 02:27:45 2010 -0500
@@ -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 @@
val = PHYSFS_Swap32(lo);
val <<= 32;
val |= PHYSFS_Swap32(hi);
- return(val);
+ return val;
}
#endif
#else
@@ -62,33 +62,33 @@
/* 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
{
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 @@
{
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 @@
{
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 @@
{
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 @@
{
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 @@
{
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 @@
{
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 @@
{
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 @@
{
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 @@
{
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 @@
{
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 @@
{
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 ... */