Skip to content
Permalink
Browse files
FIXME cleanups.
  • Loading branch information
icculus committed Jul 11, 2002
1 parent aac5682 commit 959a15e27fb30d4cb755e3908b7948510638af45
Showing with 17 additions and 16 deletions.
  1. +0 −1 archivers/grp.c
  2. +3 −3 archivers/zip.c
  3. +2 −2 extras/physfshttpd.c
  4. +7 −5 platform/macclassic.c
  5. +5 −5 platform/win32.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);

@@ -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 */
@@ -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);
@@ -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);
@@ -785,15 +785,15 @@ 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);
} /* if */
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,15 +809,15 @@ 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);
} /* if */
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);

0 comments on commit 959a15e

Please sign in to comment.