Skip to content

Commit

Permalink
FIXME cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 11, 2002
1 parent aac5682 commit 959a15e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
1 change: 0 additions & 1 deletion archivers/grp.c
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions archivers/zip.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions extras/physfshttpd.c
Expand Up @@ -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
{
Expand All @@ -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);
Expand Down
12 changes: 7 additions & 5 deletions platform/macclassic.c
Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions platform/win32.c
Expand Up @@ -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 */

Expand All @@ -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 */

Expand All @@ -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);
Expand Down

0 comments on commit 959a15e

Please sign in to comment.