From 8ba546241137c6c1c43751b25e40bbaf610658a1 Mon Sep 17 00:00:00 2001 From: tma Date: Mon, 10 Nov 2008 23:55:22 +0000 Subject: * Fix some new GCC 4.3 warnings * Fix many many strict aliasing warnings, now that it's re-enabled git-svn-id: svn://svn.icculus.org/quake3/trunk@1487 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/cm_load.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'code/qcommon/cm_load.c') diff --git a/code/qcommon/cm_load.c b/code/qcommon/cm_load.c index 175f138..a06358b 100644 --- a/code/qcommon/cm_load.c +++ b/code/qcommon/cm_load.c @@ -567,7 +567,10 @@ Loads in the map and all submodels ================== */ void CM_LoadMap( const char *name, qboolean clientload, int *checksum ) { - int *buf; + union { + int *i; + void *v; + } buf; int i; dheader_t header; int length; @@ -606,19 +609,19 @@ void CM_LoadMap( const char *name, qboolean clientload, int *checksum ) { // load the file // #ifndef BSPC - length = FS_ReadFile( name, (void **)&buf ); + length = FS_ReadFile( name, &buf.v ); #else - length = LoadQuakeFile((quakefile_t *) name, (void **)&buf); + length = LoadQuakeFile((quakefile_t *) name, &buf.v); #endif - if ( !buf ) { + if ( !buf.i ) { Com_Error (ERR_DROP, "Couldn't load %s", name); } - last_checksum = LittleLong (Com_BlockChecksum (buf, length)); + last_checksum = LittleLong (Com_BlockChecksum (buf.i, length)); *checksum = last_checksum; - header = *(dheader_t *)buf; + header = *(dheader_t *)buf.i; for (i=0 ; i