qbsp: change LoadFile spec so we don't need to cast when calling

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-02-17 11:03:09 +10:30
parent 31a9bf78c7
commit fda99aac20
5 changed files with 6 additions and 5 deletions

View File

@ -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);

View File

@ -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;

View File

@ -24,6 +24,6 @@
#include <stdbool.h>
size_t LoadFile(const char *filename, void **buf, bool nofail);
size_t LoadFile(const char *filename, void *bufptr, bool nofail);
#endif

View File

@ -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);

View File

@ -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);