From ace324cdc8d50434deedf91125aa9f03c2275e70 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 22 Jul 2017 12:47:32 -0400 Subject: [PATCH] Minor code cleanups: whitespace fixes, 80-column overflows, wrong comments. --- src/archiver_grp.c | 6 +++--- src/archiver_hog.c | 4 ++-- src/archiver_iso9660.c | 6 ++---- src/archiver_mvl.c | 6 +++--- src/archiver_qpak.c | 8 ++++---- src/archiver_slb.c | 8 ++++---- src/archiver_vdf.c | 4 ++-- src/archiver_wad.c | 8 ++++---- src/platform_beos.cpp | 2 +- src/platform_macosx.c | 2 +- src/platform_os2.c | 2 +- src/platform_posix.c | 2 +- src/platform_unix.c | 2 +- src/platform_windows.c | 2 +- 14 files changed, 30 insertions(+), 32 deletions(-) diff --git a/src/archiver_grp.c b/src/archiver_grp.c index cc3a6007..54923171 100644 --- a/src/archiver_grp.c +++ b/src/archiver_grp.c @@ -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 @@ static int grpLoadEntries(PHYSFS_Io *io, const PHYSFS_uint32 count, void *arc) *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; diff --git a/src/archiver_hog.c b/src/archiver_hog.c index f3d5bfac..677d4b6a 100644 --- a/src/archiver_hog.c +++ b/src/archiver_hog.c @@ -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 @@ static int hogLoadEntries(PHYSFS_Io *io, void *unpkarc) 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 */ diff --git a/src/archiver_iso9660.c b/src/archiver_iso9660.c index 8bc2e134..a824e065 100644 --- a/src/archiver_iso9660.c +++ b/src/archiver_iso9660.c @@ -45,7 +45,7 @@ static int iso9660LoadEntries(PHYSFS_Io *io, const int joliet, 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 @@ static int iso9660AddEntry(PHYSFS_Io *io, const int joliet, const int isdir, } /* 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)) diff --git a/src/archiver_mvl.c b/src/archiver_mvl.c index c6bb1087..ba3e736b 100644 --- a/src/archiver_mvl.c +++ b/src/archiver_mvl.c @@ -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 @@ static int mvlLoadEntries(PHYSFS_Io *io, const PHYSFS_uint32 count, void *arc) 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; diff --git a/src/archiver_qpak.c b/src/archiver_qpak.c index 4b036025..aa43421a 100644 --- a/src/archiver_qpak.c +++ b/src/archiver_qpak.c @@ -42,14 +42,14 @@ static int qpakLoadEntries(PHYSFS_Io *io, const PHYSFS_uint32 count, void *arc) 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; diff --git a/src/archiver_slb.c b/src/archiver_slb.c index 0d9c6310..92d64a5e 100644 --- a/src/archiver_slb.c +++ b/src/archiver_slb.c @@ -25,7 +25,7 @@ static int slbLoadEntries(PHYSFS_Io *io, const PHYSFS_uint32 count, void *arc) 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 @@ static int slbLoadEntries(PHYSFS_Io *io, const PHYSFS_uint32 count, void *arc) *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; diff --git a/src/archiver_vdf.c b/src/archiver_vdf.c index b6644b69..1c54ee18 100644 --- a/src/archiver_vdf.c +++ b/src/archiver_vdf.c @@ -50,7 +50,7 @@ static PHYSFS_sint64 vdfDosTimeToEpoch(const PHYSFS_uint32 dostime) 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 @@ static int vdfLoadEntries(PHYSFS_Io *io, const PHYSFS_uint32 count, /* !!! 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; diff --git a/src/archiver_wad.c b/src/archiver_wad.c index c47af818..712ebbc5 100644 --- a/src/archiver_wad.c +++ b/src/archiver_wad.c @@ -52,18 +52,18 @@ static int wadLoadEntries(PHYSFS_Io *io, const PHYSFS_uint32 count, void *arc) 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; diff --git a/src/platform_beos.cpp b/src/platform_beos.cpp index dd3b94b9..ac5aefba 100644 --- a/src/platform_beos.cpp +++ b/src/platform_beos.cpp @@ -185,5 +185,5 @@ char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app) #endif /* PHYSFS_PLATFORM_HAIKU */ -/* end of beos.cpp ... */ +/* end of platform_beos.cpp ... */ diff --git a/src/platform_macosx.c b/src/platform_macosx.c index e6b27399..7a288707 100644 --- a/src/platform_macosx.c +++ b/src/platform_macosx.c @@ -214,5 +214,5 @@ char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app) #endif /* PHYSFS_PLATFORM_MACOSX */ -/* end of macosx.c ... */ +/* end of platform_macosx.c ... */ diff --git a/src/platform_os2.c b/src/platform_os2.c index 3719346d..a3036336 100644 --- a/src/platform_os2.c +++ b/src/platform_os2.c @@ -775,4 +775,4 @@ void __PHYSFS_platformReleaseMutex(void *mutex) #endif /* PHYSFS_PLATFORM_OS2 */ -/* end of os2.c ... */ +/* end of platform_os2.c ... */ diff --git a/src/platform_posix.c b/src/platform_posix.c index 5c9da003..67ec2548 100644 --- a/src/platform_posix.c +++ b/src/platform_posix.c @@ -415,5 +415,5 @@ void __PHYSFS_platformReleaseMutex(void *mutex) #endif /* PHYSFS_PLATFORM_POSIX */ -/* end of posix.c ... */ +/* end of platform_posix.c ... */ diff --git a/src/platform_unix.c b/src/platform_unix.c index 80fd7a51..c32afbc6 100644 --- a/src/platform_unix.c +++ b/src/platform_unix.c @@ -365,5 +365,5 @@ char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app) #endif /* PHYSFS_PLATFORM_UNIX */ -/* end of unix.c ... */ +/* end of platform_unix.c ... */ diff --git a/src/platform_windows.c b/src/platform_windows.c index e1fa2d73..4e202577 100644 --- a/src/platform_windows.c +++ b/src/platform_windows.c @@ -954,6 +954,6 @@ int __PHYSFS_platformStat(const char *filename, PHYSFS_Stat *st) #endif /* PHYSFS_PLATFORM_WINDOWS */ #endif /* PHYSFS_PLATFORM_WINRT */ -/* end of windows.c ... */ +/* end of platform_windows.c ... */