From 959a15e27fb30d4cb755e3908b7948510638af45 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 11 Jul 2002 21:37:30 +0000 Subject: [PATCH] FIXME cleanups. --- archivers/grp.c | 1 - archivers/zip.c | 6 +++--- extras/physfshttpd.c | 4 ++-- platform/macclassic.c | 12 +++++++----- platform/win32.c | 10 +++++----- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/archivers/grp.c b/archivers/grp.c index e05d76bc..5cf2a1a9 100644 --- a/archivers/grp.c +++ b/archivers/grp.c @@ -300,7 +300,6 @@ static LinkedStringList *GRP_enumerateFiles(DirHandle *h, LinkedStringList *l = NULL; LinkedStringList *prev = NULL; - /* !!! FIXME: Does this consider "/" ? */ if (*dirname != '\0') /* no directories in GRP files. */ return(NULL); diff --git a/archivers/zip.c b/archivers/zip.c index 9e112c53..5bede36d 100644 --- a/archivers/zip.c +++ b/archivers/zip.c @@ -409,7 +409,7 @@ static DirHandle *ZIP_openArchive(const char *name, int forWriting) } /* ZIP_openArchive */ -/* !!! This is seriously ugly. */ +/* !!! FIXME: This is seriously ugly. */ static LinkedStringList *ZIP_enumerateFiles(DirHandle *h, const char *dirname, int omitSymLinks) @@ -515,7 +515,7 @@ static LinkedStringList *ZIP_enumerateFiles(DirHandle *h, } /* ZIP_enumerateFiles */ -/* !!! This is seriously ugly. */ +/* !!! FIXME: This is seriously ugly. */ static int ZIP_exists_symcheck(DirHandle *h, const char *name, int follow) { char buf[MAXZIPENTRYSIZE]; @@ -623,7 +623,7 @@ static int ZIP_isDirectory(DirHandle *h, const char *name) BAIL_IF_MACRO(is_sym, ERR_TOO_MANY_SYMLINKS, 0); dlen = strlen(name); - /* !!! yikes. Better way to check? */ + /* !!! FIXME: yikes. Better way to check? */ retval = (((ZIPinfo *)(h->opaque))->entries[retval].name[dlen] == '/'); return(retval); } /* ZIP_isDirectory */ diff --git a/extras/physfshttpd.c b/extras/physfshttpd.c index d8a2864e..b9487a25 100644 --- a/extras/physfshttpd.c +++ b/extras/physfshttpd.c @@ -81,7 +81,7 @@ static void feed_file_http(const char *ipstr, int sock, const char *fname) { printf("%s: Can't open [%s]: %s.\n", ipstr, fname, PHYSFS_getLastError()); - write(sock, txt404, strlen(txt404)); /* !!! Check retval */ + write(sock, txt404, strlen(txt404)); /* !!! FIXME: Check retval */ } /* if */ else { @@ -94,7 +94,7 @@ static void feed_file_http(const char *ipstr, int sock, const char *fname) break; } /* if */ - write(sock, buffer, (int) br); /* !!! CHECK THIS RETVAL! */ + write(sock, buffer, (int) br); /* !!! FIXME: CHECK THIS RETVAL! */ } while (!PHYSFS_eof(in)); PHYSFS_close(in); diff --git a/platform/macclassic.c b/platform/macclassic.c index e6644de6..fbce9a8f 100644 --- a/platform/macclassic.c +++ b/platform/macclassic.c @@ -266,7 +266,7 @@ static OSErr fnameToFSSpecNoAlias(const char *fname, FSSpec *spec) { OSErr err; Str255 str255; - int needColon = (strchr(fname, ':') == NULL); + int needColon = (strchr(fname, ':') == NULL); int len = strlen(fname) + ((needColon) ? 1 : 0); if (len > 255) return(bdNamErr); @@ -285,7 +285,6 @@ static OSErr fnameToFSSpecNoAlias(const char *fname, FSSpec *spec) } /* fnameToFSSpecNoAlias */ -/* !!! FIXME: This code is pretty heinous. */ static OSErr fnameToFSSpec(const char *fname, FSSpec *spec) { Boolean alias = 0; @@ -313,6 +312,7 @@ static OSErr fnameToFSSpec(const char *fname, FSSpec *spec) start = ptr; ptr = strchr(start + 1, ':'); + /* Now check each element of the path for aliases... */ do { CInfoPBRec infoPB; @@ -322,14 +322,15 @@ static OSErr fnameToFSSpec(const char *fname, FSSpec *spec) infoPB.dirInfo.ioDrDirID = spec->parID; infoPB.dirInfo.ioFDirIndex = 0; err = PBGetCatInfoSync(&infoPB); - if (err != noErr) /* not an alias, really a bogus path. */ + if (err != noErr) /* not an alias, really just a bogus path. */ return(fnameToFSSpecNoAlias(fname, spec)); /* reset */ if ((infoPB.dirInfo.ioFlAttrib & kioFlAttribDirMask) != 0) spec->parID = infoPB.dirInfo.ioDrDirID; - if (ptr != NULL) + if (ptr != NULL) /* terminate string after next element. */ *ptr = '\0'; + *start = strlen(start + 1); /* make it a pstring. */ err = FSMakeFSSpec(spec->vRefNum, spec->parID, (const unsigned char *) start, spec); @@ -339,7 +340,8 @@ static OSErr fnameToFSSpec(const char *fname, FSSpec *spec) err = ResolveAliasFileWithMountFlags(spec, 1, &folder, &alias, 0); if (err != noErr) /* not an alias, really a bogus path. */ return(fnameToFSSpecNoAlias(fname, spec)); /* reset */ - start = ptr; + + start = ptr; /* move to the next element. */ if (ptr != NULL) ptr = strchr(start + 1, ':'); } while (start != NULL); diff --git a/platform/win32.c b/platform/win32.c index 5392cecc..99639640 100644 --- a/platform/win32.c +++ b/platform/win32.c @@ -785,7 +785,7 @@ PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer, PHYSFS_sint64 retval; /* Read data from the file */ - /*!!! - uint32 might be a greater # than DWORD */ + /* !!! FIXME: uint32 might be a greater # than DWORD */ if(!ReadFile(FileHandle, buffer, count * size, &CountOfBytesRead, NULL)) { BAIL_MACRO(win32strerror(), -1); @@ -793,7 +793,7 @@ PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer, else { /* Return the number of "objects" read. */ - /* !!! - What if not the right amount of bytes was read to make an object? */ + /* !!! FIXME: What if not the right amount of bytes was read to make an object? */ retval = CountOfBytesRead / size; } /* else */ @@ -809,7 +809,7 @@ PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer, PHYSFS_sint64 retval; /* Read data from the file */ - /*!!! - uint32 might be a greater # than DWORD */ + /* !!! FIXME: uint32 might be a greater # than DWORD */ if(!WriteFile(FileHandle, buffer, count * size, &CountOfBytesWritten, NULL)) { BAIL_MACRO(win32strerror(), -1); @@ -817,7 +817,7 @@ PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer, else { /* Return the number of "objects" read. */ - /*!!! - What if not the right number of bytes was written? */ + /* !!! FIXME: What if not the right number of bytes was written? */ retval = CountOfBytesWritten / size; } /* else */ @@ -834,7 +834,7 @@ int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos) /* Get the high order 32-bits of the position */ HighOrderPos = HIGHORDER_UINT64(pos); - /*!!! SetFilePointer needs a signed 64-bit value. */ + /* !!! FIXME: SetFilePointer needs a signed 64-bit value. */ /* Move pointer "pos" count from start of file */ rc = SetFilePointer(FileHandle, LOWORDER_UINT64(pos), &HighOrderPos, FILE_BEGIN);