From f0eb5c0db984e0480b445ac9e7a5e863b622955a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 6 Aug 2017 15:54:44 -0400 Subject: [PATCH] Marked a bunch of things as "FIXME-3.0" that I want resolved before 3.0 ships. --- extras/ignorecase.c | 2 +- src/physfs.c | 11 ++++++----- src/physfs.h | 12 ++++++------ src/physfs_archiver_7z.c | 2 +- src/physfs_archiver_iso9660.c | 2 +- src/physfs_archiver_vdf.c | 2 +- src/physfs_internal.h | 4 ++-- src/physfs_platform_macos.c | 2 +- src/physfs_platform_os2.c | 6 +++--- src/physfs_platforms.h | 2 +- src/physfs_unicode.c | 4 ++++ 11 files changed, 27 insertions(+), 22 deletions(-) diff --git a/extras/ignorecase.c b/extras/ignorecase.c index 95d993f0..b2322841 100644 --- a/extras/ignorecase.c +++ b/extras/ignorecase.c @@ -28,7 +28,7 @@ */ /* I'm not screwing around with stricmp vs. strcasecmp... */ -/* !!! FIXME: this will NOT work with UTF-8 strings in physfs2.0 */ +/* !!! FIXME-3.0: this will NOT work with UTF-8 strings in physfs2.0 */ static int caseInsensitiveStringCompare(const char *x, const char *y) { int ux, uy; diff --git a/src/physfs.c b/src/physfs.c index d1db10c8..3f7efe1f 100644 --- a/src/physfs.c +++ b/src/physfs.c @@ -974,7 +974,7 @@ static int sanitizePlatformIndependentPath(const char *src, char *dst) */ static int partOfMountPoint(DirHandle *h, char *fname) { - /* !!! FIXME: This code feels gross. */ + /* !!! FIXME-3.0: This code feels gross. */ int rc; size_t len, mntpntlen; @@ -1661,7 +1661,7 @@ int PHYSFS_setWriteDir(const char *newDir) if (newDir != NULL) { - /* !!! FIXME: PHYSFS_Io shouldn't be NULL */ + /* !!! FIXME-3.0: PHYSFS_Io shouldn't be NULL */ writeDir = createDirHandle(NULL, newDir, NULL, 1); retval = (writeDir != NULL); } /* if */ @@ -2295,7 +2295,7 @@ typedef struct SymlinkFilterData DirHandle *dirhandle; } SymlinkFilterData; -/* !!! FIXME: broken if in a virtual mountpoint (stat call fails). */ +/* !!! FIXME-3.0: broken if in a virtual mountpoint (stat call fails). */ static void enumCallbackFilterSymLinks(void *_data, const char *origdir, const char *fname) { @@ -2322,7 +2322,7 @@ static void enumCallbackFilterSymLinks(void *_data, const char *origdir, } /* enumCallbackFilterSymLinks */ -/* !!! FIXME: this should report error conditions. */ +/* !!! FIXME-3.0: this should report error conditions. */ void PHYSFS_enumerateFilesCallback(const char *_fname, PHYSFS_EnumFilesCallback callback, void *data) @@ -2695,6 +2695,7 @@ static PHYSFS_sint64 doBufferedWrite(PHYSFS_File *handle, const void *buffer, } /* if */ /* would overflow buffer. Flush and then write the new objects, too. */ + /* !!! FIXME-3.0: this should refill the buffer, not flush everything down. */ BAIL_IF_ERRPASS(!PHYSFS_flush(handle), -1); return fh->io->write(fh->io, buffer, len); } /* doBufferedWrite */ @@ -2909,7 +2910,7 @@ int PHYSFS_stat(const char *_fname, PHYSFS_Stat *stat) } /* if */ else if (verifyPath(i, &arcfname, 0)) { - /* !!! FIXME: this test is wrong and should be elsewhere. */ + /* !!! FIXME-3.0: this test is wrong and should be elsewhere. */ stat->readonly = !(writeDir && (strcmp(writeDir->dirName, i->dirName) == 0)); retval = i->funcs->stat(i->opaque, arcfname, stat); diff --git a/src/physfs.h b/src/physfs.h index 4a8f6f05..650cd05f 100644 --- a/src/physfs.h +++ b/src/physfs.h @@ -2364,7 +2364,7 @@ PHYSFS_DECL void PHYSFS_getSearchPathCallback(PHYSFS_StringCallback c, void *d); * PHYSFS_enumerateFilesCallback("/some/path", printDir, NULL); * \endcode * - * !!! FIXME: enumerateFiles() does not promise alphabetical sorting by + * !!! FIXME-3.0: enumerateFiles() does not promise alphabetical sorting by * !!! FIXME: case-sensitivity in the code, and doesn't promise sorting at * !!! FIXME: all in the above docs. * @@ -2900,7 +2900,7 @@ typedef struct PHYSFS_Io /** * \brief Duplicate this i/o instance. * - * // !!! FIXME: write me. + * // !!! FIXME-3.0: write me. * * \param io The i/o instance to duplicate. * \return A new value for a stream's (opaque) field, or NULL on error. @@ -3372,7 +3372,7 @@ typedef struct PHYSFS_Archiver */ PHYSFS_ArchiveInfo info; -// !!! FIXME: documentation: \brief? +// !!! FIXME-3.0: documentation: \brief? /** * \brief * @@ -3385,7 +3385,7 @@ typedef struct PHYSFS_Archiver * element of the search path. * Return NULL on failure. We ignore any error code you set here; * when PHYSFS_mount() returns, the error will be PHYSFS_ERR_UNSUPPORTED - * (no Archivers could handle this data). // !!! FIXME: yeah? + * (no Archivers could handle this data). // !!! FIXME-3.0: yeah? * Returns non-NULL on success. The pointer returned will be * passed as the "opaque" parameter for later calls. */ @@ -3482,7 +3482,7 @@ typedef struct PHYSFS_Archiver * \fn int PHYSFS_registerArchiver(const PHYSFS_Archiver *archiver) * \brief Add a new archiver to the system. * - * !!! FIXME: write me. + * !!! FIXME-3.0: write me. * * You may not have two archivers that handle the same extension. If you are * going to have a clash, you can deregister the other archiver (including @@ -3503,7 +3503,7 @@ PHYSFS_DECL int PHYSFS_registerArchiver(const PHYSFS_Archiver *archiver); * \fn int PHYSFS_deregisterArchiver(const char *ext) * \brief Remove an archiver from the system. * - * !!! FIXME: write me. + * !!! FIXME-3.0: write me. * * This fails if there are any archives still open that use this archiver. * diff --git a/src/physfs_archiver_7z.c b/src/physfs_archiver_7z.c index 4cd80c21..57e6df42 100644 --- a/src/physfs_archiver_7z.c +++ b/src/physfs_archiver_7z.c @@ -217,7 +217,7 @@ static void *SZIP_openArchive(PHYSFS_Io *io, const char *name, int forWriting) SZIPinfo *info = NULL; SRes rc; - /* !!! FIXME: this is a race condition; we need a global init method that gets called when registering new archivers. */ + /* !!! FIXME-3.0: this is a race condition; we need a global init method that gets called when registering new archivers. */ static int generatedTable = 0; if (!generatedTable) { diff --git a/src/physfs_archiver_iso9660.c b/src/physfs_archiver_iso9660.c index 4d6a7ecf..7c0413bc 100644 --- a/src/physfs_archiver_iso9660.c +++ b/src/physfs_archiver_iso9660.c @@ -88,7 +88,7 @@ static int iso9660AddEntry(PHYSFS_Io *io, const int joliet, const int isdir, } /* if */ else { - /* !!! FIXME: we assume the filenames are low-ASCII; if they use + /* !!! FIXME-3.0: we assume the filenames are low-ASCII; if they use any high-ASCII chars, they will be invalid UTF-8. */ memcpy(fnamecpy, fname, fnamelen); fnamecpy[fnamelen] = '\0'; diff --git a/src/physfs_archiver_vdf.c b/src/physfs_archiver_vdf.c index 373a9bf8..1889de53 100644 --- a/src/physfs_archiver_vdf.c +++ b/src/physfs_archiver_vdf.c @@ -78,7 +78,7 @@ static int vdfLoadEntries(PHYSFS_Io *io, const PHYSFS_uint32 count, BAIL_IF(!name[0], PHYSFS_ERR_CORRUPT, 0); - /* !!! FIXME: we assume the filenames are low-ASCII; if they use + /* !!! FIXME-3.0: 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, ts, ts, jump, size), 0); diff --git a/src/physfs_internal.h b/src/physfs_internal.h index 583d649c..f8928fa5 100644 --- a/src/physfs_internal.h +++ b/src/physfs_internal.h @@ -384,7 +384,7 @@ int UNPK_stat(void *opaque, const char *fn, PHYSFS_Stat *st); /* Optional API many archivers use this to manage their directory tree. */ -/* !!! FIXME: document this better. */ +/* !!! FIXME-3.0: document this better. */ typedef struct __PHYSFS_DirTreeEntry { @@ -572,7 +572,7 @@ PHYSFS_sint64 __PHYSFS_platformFileLength(void *handle); /* - * !!! FIXME: comment me. + * !!! FIXME-3.0: comment me. */ int __PHYSFS_platformStat(const char *fn, PHYSFS_Stat *stat); diff --git a/src/physfs_platform_macos.c b/src/physfs_platform_macos.c index 20f9e322..64f8ecd1 100644 --- a/src/physfs_platform_macos.c +++ b/src/physfs_platform_macos.c @@ -202,7 +202,7 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0) char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app) { - /* !!! FIXME: there's a real API to determine this */ + /* !!! FIXME-3.0: there's a real API to determine this */ const char *userdir = __PHYSFS_getUserDir(); const char *append = "Library/Application Support/"; const size_t len = strlen(userdir) + strlen(append) + strlen(app) + 2; diff --git a/src/physfs_platform_os2.c b/src/physfs_platform_os2.c index d97ea71a..6e2a5c38 100644 --- a/src/physfs_platform_os2.c +++ b/src/physfs_platform_os2.c @@ -382,13 +382,13 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0) char *__PHYSFS_platformCalcUserDir(void) { - return __PHYSFS_platformCalcBaseDir(NULL); /* !!! FIXME: ? */ + return __PHYSFS_platformCalcBaseDir(NULL); /* !!! FIXME-3.0: ? */ } /* __PHYSFS_platformCalcUserDir */ char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app) { - return __PHYSFS_platformCalcBaseDir(NULL); /* !!! FIXME: ? */ -} + return __PHYSFS_platformCalcBaseDir(NULL); /* !!! FIXME-3.0: ? */ +} /* __PHYSFS_platformCalcPrefDir */ void __PHYSFS_platformEnumerateFiles(const char *dirname, PHYSFS_EnumFilesCallback callback, diff --git a/src/physfs_platforms.h b/src/physfs_platforms.h index ed4af291..7c7d94a7 100644 --- a/src/physfs_platforms.h +++ b/src/physfs_platforms.h @@ -69,7 +69,7 @@ # define PHYSFS_PLATFORM_UNIX 1 # define PHYSFS_PLATFORM_POSIX 1 #elif defined(__QNX__) -# define PHYSFS_NO_CDROM_SUPPORT 1 /* !!! FIXME? */ +# define PHYSFS_NO_CDROM_SUPPORT 1 /* !!! FIXME-3.0? */ # define PHYSFS_PLATFORM_QNX 1 # define PHYSFS_PLATFORM_UNIX 1 # define PHYSFS_PLATFORM_POSIX 1 diff --git a/src/physfs_unicode.c b/src/physfs_unicode.c index 87b399c1..b06ceebc 100644 --- a/src/physfs_unicode.c +++ b/src/physfs_unicode.c @@ -444,6 +444,10 @@ static void locate_case_fold_mapping(const PHYSFS_uint32 from, } /* locate_case_fold_mapping */ +/* !!! FIXME-3.0: this doesn't actually work (for example, it folds the German Eszett + into 's' 's', but if you have two 'S' chars in a row, it'll fail on the first one, + since it'll fold into a single 's'. This needs to be able to lurch along with a + variable number of codepoints at a time. */ static int utf8codepointcmp(const PHYSFS_uint32 cp1, const PHYSFS_uint32 cp2) { PHYSFS_uint32 folded1[3], folded2[3];