Minor code cleanups: whitespace fixes, 80-column overflows, wrong comments.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 22 Jul 2017 12:47:32 -0400
changeset 1504 803282f78987
parent 1503 5e0afac26199
child 1505 d06a6a0454a0
Minor code cleanups: whitespace fixes, 80-column overflows, wrong comments.
src/archiver_grp.c
src/archiver_hog.c
src/archiver_iso9660.c
src/archiver_mvl.c
src/archiver_qpak.c
src/archiver_slb.c
src/archiver_vdf.c
src/archiver_wad.c
src/platform_beos.cpp
src/platform_macosx.c
src/platform_os2.c
src/platform_posix.c
src/platform_unix.c
src/platform_windows.c
--- a/src/archiver_grp.c	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/archiver_grp.c	Sat Jul 22 12:47:32 2017 -0400
@@ -31,7 +31,7 @@
 
 static int grpLoadEntries(PHYSFS_Io *io, const PHYSFS_uint32 count, void *arc)
 {
-    PHYSFS_uint32 location = 16 + (16 * count);  /* past sig+metadata. */
+    PHYSFS_uint32 pos = 16 + (16 * count);  /* past sig+metadata. */
     PHYSFS_uint32 i;
 
     for (i = 0; i < count; i++)
@@ -47,9 +47,9 @@
             *ptr = '\0';  /* trim extra spaces. */
 
         size = PHYSFS_swapULE32(size);
-        BAIL_IF_ERRPASS(!UNPK_addEntry(arc, name, 0, -1, -1, location, size), 0);
+        BAIL_IF_ERRPASS(!UNPK_addEntry(arc, name, 0, -1, -1, pos, size), 0);
 
-        location += size;
+        pos += size;
     } /* for */
 
     return 1;
--- a/src/archiver_hog.c	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/archiver_hog.c	Sat Jul 22 12:47:32 2017 -0400
@@ -34,7 +34,7 @@
 
 #if PHYSFS_SUPPORTS_HOG
 
-static int hogLoadEntries(PHYSFS_Io *io, void *unpkarc)
+static int hogLoadEntries(PHYSFS_Io *io, void *arc)
 {
     const PHYSFS_uint64 iolen = io->length(io);
     PHYSFS_uint32 pos = 3;
@@ -50,7 +50,7 @@
         pos += 13 + 4;
 
         size = PHYSFS_swapULE32(size);
-        BAIL_IF_ERRPASS(!UNPK_addEntry(unpkarc, name, 0, -1, -1, pos, size), 0);
+        BAIL_IF_ERRPASS(!UNPK_addEntry(arc, name, 0, -1, -1, pos, size), 0);
         pos += size;
 
         /* skip over entry */
--- a/src/archiver_iso9660.c	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/archiver_iso9660.c	Sat Jul 22 12:47:32 2017 -0400
@@ -45,7 +45,7 @@
 
 static int iso9660AddEntry(PHYSFS_Io *io, const int joliet, const int isdir,
                            const char *base, PHYSFS_uint8 *fname,
-                           const int fnamelen, const PHYSFS_sint64 timestamp,
+                           const int fnamelen, const PHYSFS_sint64 ts,
                            const PHYSFS_uint64 pos, const PHYSFS_uint64 len,
                            void *unpkarc)
 {
@@ -107,9 +107,7 @@
         } /* if */
     } /* else */
 
-    entry = UNPK_addEntry(unpkarc, fullpath, isdir,
-                          timestamp, timestamp, pos, len);
-
+    entry = UNPK_addEntry(unpkarc, fullpath, isdir, ts, ts, pos, len);
     if ((entry) && (isdir))
     {
         if (!iso9660LoadEntries(io, joliet, fullpath, pos, pos + len, unpkarc))
--- a/src/archiver_mvl.c	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/archiver_mvl.c	Sat Jul 22 12:47:32 2017 -0400
@@ -34,7 +34,7 @@
 
 static int mvlLoadEntries(PHYSFS_Io *io, const PHYSFS_uint32 count, void *arc)
 {
-    PHYSFS_uint32 location = 8 + (17 * count);   /* past sig+metadata. */
+    PHYSFS_uint32 pos = 8 + (17 * count);   /* past sig+metadata. */
     PHYSFS_uint32 i;
 
     for (i = 0; i < count; i++)
@@ -45,8 +45,8 @@
         BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, &size, 4), 0);
         name[12] = '\0';  /* just in case. */
         size = PHYSFS_swapULE32(size);
-        BAIL_IF_ERRPASS(!UNPK_addEntry(arc, name, 0,  -1, -1, location, size), 0);
-        location += size;
+        BAIL_IF_ERRPASS(!UNPK_addEntry(arc, name, 0, -1, -1, pos, size), 0);
+        pos += size;
     } /* for */
 
     return 1;
--- a/src/archiver_qpak.c	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/archiver_qpak.c	Sat Jul 22 12:47:32 2017 -0400
@@ -42,14 +42,14 @@
     for (i = 0; i < count; i++)
     {
         PHYSFS_uint32 size;
-        PHYSFS_uint32 location;
+        PHYSFS_uint32 pos;
         char name[56];
         BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, name, 56), 0);
-        BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, &location, 4), 0);
+        BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, &pos, 4), 0);
         BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, &size, 4), 0);
         size = PHYSFS_swapULE32(size);
-        location = PHYSFS_swapULE32(location);
-        BAIL_IF_ERRPASS(!UNPK_addEntry(arc, name, 0,  -1, -1, location, size), 0);
+        pos = PHYSFS_swapULE32(pos);
+        BAIL_IF_ERRPASS(!UNPK_addEntry(arc, name, 0, -1, -1, pos, size), 0);
     } /* for */
 
     return 1;
--- a/src/archiver_slb.c	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/archiver_slb.c	Sat Jul 22 12:47:32 2017 -0400
@@ -25,7 +25,7 @@
     PHYSFS_uint32 i;
     for (i = 0; i < count; i++)
     {
-        PHYSFS_uint32 location;
+        PHYSFS_uint32 pos;
         PHYSFS_uint32 size;
         char name[64];
         char backslash;
@@ -46,13 +46,13 @@
                 *ptr = '/';
         } /* for */
 
-        BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, &location, 4), 0);
-        location = PHYSFS_swapULE32(location);
+        BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, &pos, 4), 0);
+        pos = PHYSFS_swapULE32(pos);
 
         BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, &size, 4), 0);
         size = PHYSFS_swapULE32(size);
 
-        BAIL_IF_ERRPASS(!UNPK_addEntry(arc, name, 0,  -1, -1, location, size), 0);
+        BAIL_IF_ERRPASS(!UNPK_addEntry(arc, name, 0, -1, -1, pos, size), 0);
     } /* for */
 
     return 1;
--- a/src/archiver_vdf.c	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/archiver_vdf.c	Sat Jul 22 12:47:32 2017 -0400
@@ -50,7 +50,7 @@
 
 
 static int vdfLoadEntries(PHYSFS_Io *io, const PHYSFS_uint32 count,
-                          const PHYSFS_sint64 t, void *arc)
+                          const PHYSFS_sint64 ts, void *arc)
 {
     PHYSFS_uint32 i;
 
@@ -81,7 +81,7 @@
         /* !!! FIXME: we assume the filenames are low-ASCII; if they use
            any high-ASCII chars, they will be invalid UTF-8. */
 
-        BAIL_IF_ERRPASS(!UNPK_addEntry(arc, name, 0, t, t, jump, size), 0);
+        BAIL_IF_ERRPASS(!UNPK_addEntry(arc, name, 0, ts, ts, jump, size), 0);
     } /* for */
 
     return 1;
--- a/src/archiver_wad.c	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/archiver_wad.c	Sat Jul 22 12:47:32 2017 -0400
@@ -52,18 +52,18 @@
     PHYSFS_uint32 i;
     for (i = 0; i < count; i++)
     {
-        PHYSFS_uint32 location;
+        PHYSFS_uint32 pos;
         PHYSFS_uint32 size;
         char name[9];
 
-        BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, &location, 4), 0);
+        BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, &pos, 4), 0);
         BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, &size, 4), 0);
         BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, name, 8), 0);
 
         name[8] = '\0'; /* name might not be null-terminated in file. */
         size = PHYSFS_swapULE32(size);
-        location = PHYSFS_swapULE32(location);
-        BAIL_IF_ERRPASS(!UNPK_addEntry(arc, name, 0,  -1, -1, location, size), 0);
+        pos = PHYSFS_swapULE32(pos);
+        BAIL_IF_ERRPASS(!UNPK_addEntry(arc, name, 0, -1, -1, pos, size), 0);
     } /* for */
 
     return 1;
--- a/src/platform_beos.cpp	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/platform_beos.cpp	Sat Jul 22 12:47:32 2017 -0400
@@ -185,5 +185,5 @@
 
 #endif  /* PHYSFS_PLATFORM_HAIKU */
 
-/* end of beos.cpp ... */
+/* end of platform_beos.cpp ... */
 
--- a/src/platform_macosx.c	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/platform_macosx.c	Sat Jul 22 12:47:32 2017 -0400
@@ -214,5 +214,5 @@
 
 #endif /* PHYSFS_PLATFORM_MACOSX */
 
-/* end of macosx.c ... */
+/* end of platform_macosx.c ... */
 
--- a/src/platform_os2.c	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/platform_os2.c	Sat Jul 22 12:47:32 2017 -0400
@@ -775,4 +775,4 @@
 
 #endif  /* PHYSFS_PLATFORM_OS2 */
 
-/* end of os2.c ... */
+/* end of platform_os2.c ... */
--- a/src/platform_posix.c	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/platform_posix.c	Sat Jul 22 12:47:32 2017 -0400
@@ -415,5 +415,5 @@
 
 #endif  /* PHYSFS_PLATFORM_POSIX */
 
-/* end of posix.c ... */
+/* end of platform_posix.c ... */
 
--- a/src/platform_unix.c	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/platform_unix.c	Sat Jul 22 12:47:32 2017 -0400
@@ -365,5 +365,5 @@
 
 #endif /* PHYSFS_PLATFORM_UNIX */
 
-/* end of unix.c ... */
+/* end of platform_unix.c ... */
 
--- a/src/platform_windows.c	Sat Jul 22 12:42:34 2017 -0400
+++ b/src/platform_windows.c	Sat Jul 22 12:47:32 2017 -0400
@@ -954,6 +954,6 @@
 #endif  /* PHYSFS_PLATFORM_WINDOWS */
 #endif  /* PHYSFS_PLATFORM_WINRT */
 
-/* end of windows.c ... */
+/* end of platform_windows.c ... */