FIXME cleanups.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 11 Jul 2002 21:37:30 +0000
changeset 335 1d4720c018c3
parent 334 ad36d8a58b2b
child 336 d23b47ee0d82
FIXME cleanups.
archivers/grp.c
archivers/zip.c
extras/physfshttpd.c
platform/macclassic.c
platform/win32.c
--- a/archivers/grp.c	Thu Jul 11 21:37:14 2002 +0000
+++ b/archivers/grp.c	Thu Jul 11 21:37:30 2002 +0000
@@ -300,7 +300,6 @@
     LinkedStringList *l = NULL;
     LinkedStringList *prev = NULL;
 
-    /* !!! FIXME: Does this consider "/" ? */
     if (*dirname != '\0')   /* no directories in GRP files. */
         return(NULL);
 
--- a/archivers/zip.c	Thu Jul 11 21:37:14 2002 +0000
+++ b/archivers/zip.c	Thu Jul 11 21:37:30 2002 +0000
@@ -409,7 +409,7 @@
 } /* 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 @@
 } /* 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 @@
     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 */
--- a/extras/physfshttpd.c	Thu Jul 11 21:37:14 2002 +0000
+++ b/extras/physfshttpd.c	Thu Jul 11 21:37:30 2002 +0000
@@ -81,7 +81,7 @@
     {
         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 @@
                 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);
--- a/platform/macclassic.c	Thu Jul 11 21:37:14 2002 +0000
+++ b/platform/macclassic.c	Thu Jul 11 21:37:30 2002 +0000
@@ -266,7 +266,7 @@
 {
     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 @@
 } /* fnameToFSSpecNoAlias */
 
 
-/* !!! FIXME: This code is pretty heinous. */
 static OSErr fnameToFSSpec(const char *fname, FSSpec *spec)
 {
     Boolean alias = 0;
@@ -313,6 +312,7 @@
         start = ptr;
         ptr = strchr(start + 1, ':');
 
+        /* Now check each element of the path for aliases... */
         do
         {
             CInfoPBRec infoPB;
@@ -322,14 +322,15 @@
             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 @@
             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);
--- a/platform/win32.c	Thu Jul 11 21:37:14 2002 +0000
+++ b/platform/win32.c	Thu Jul 11 21:37:30 2002 +0000
@@ -785,7 +785,7 @@
     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 @@
     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 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 @@
     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 @@
     /* 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);