From fda99aac208ad79305933763ff8894f5127ef5a0 Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Sun, 17 Feb 2013 11:03:09 +1030 Subject: [PATCH] qbsp: change LoadFile spec so we don't need to cast when calling Signed-off-by: Kevin Shanahan --- qbsp/bspfile.c | 2 +- qbsp/file.c | 3 ++- qbsp/file.h | 2 +- qbsp/map.c | 2 +- qbsp/qbsp.c | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/qbsp/bspfile.c b/qbsp/bspfile.c index 925a846e..4adaf2f8 100644 --- a/qbsp/bspfile.c +++ b/qbsp/bspfile.c @@ -41,7 +41,7 @@ LoadBSPFile(void) // Load the file header StripExtension(options.szBSPName); strcat(options.szBSPName, ".bsp"); - cFileSize = LoadFile(options.szBSPName, (void *)&header, true); + cFileSize = LoadFile(options.szBSPName, &header, true); if (header->version != BSPVERSION) Error(errBadVersion, options.szBSPName, header->version, BSPVERSION); diff --git a/qbsp/file.c b/qbsp/file.c index 66650d15..f24d5882 100644 --- a/qbsp/file.c +++ b/qbsp/file.c @@ -31,8 +31,9 @@ LoadFile ============== */ size_t -LoadFile(const char *filename, void **buf, bool nofail) +LoadFile(const char *filename, void *bufptr, bool nofail) { + char **buf = bufptr; size_t len; FILE *f; diff --git a/qbsp/file.h b/qbsp/file.h index d036c3bd..f7182aff 100644 --- a/qbsp/file.h +++ b/qbsp/file.h @@ -24,6 +24,6 @@ #include -size_t LoadFile(const char *filename, void **buf, bool nofail); +size_t LoadFile(const char *filename, void *bufptr, bool nofail); #endif diff --git a/qbsp/map.c b/qbsp/map.c index 1c73627d..73b29e85 100644 --- a/qbsp/map.c +++ b/qbsp/map.c @@ -538,7 +538,7 @@ LoadMapFile(void) Message(msgProgress, "LoadMapFile"); - length = LoadFile(options.szMapName, (void *)&buf, true); + length = LoadFile(options.szMapName, &buf, true); PreParseFile(buf); ParserInit(buf); diff --git a/qbsp/qbsp.c b/qbsp/qbsp.c index a6500f1f..fe5bd04e 100644 --- a/qbsp/qbsp.c +++ b/qbsp/qbsp.c @@ -466,7 +466,7 @@ InitQBSP(int argc, char **argv) options.fVerbose = true; options.szMapName[0] = options.szBSPName[0] = options.wadPath[0] = 0; - length = LoadFile("qbsp.ini", (void *)&szBuf, false); + length = LoadFile("qbsp.ini", &szBuf, false); if (length) { Message(msgLiteral, "Loading options from qbsp.ini\n"); ParseOptions(szBuf);