aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon/cm_load.c
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-11-10 23:55:22 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-11-10 23:55:22 +0000
commit8ba546241137c6c1c43751b25e40bbaf610658a1 (patch)
treea677c3ad74326acc217842a2d927328597cfe3c8 /code/qcommon/cm_load.c
parentb1613ef65246cc89a1e40e35c6e07080c56ea00b (diff)
downloadioquake3-aero-8ba546241137c6c1c43751b25e40bbaf610658a1.tar.gz
ioquake3-aero-8ba546241137c6c1c43751b25e40bbaf610658a1.zip
* 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
Diffstat (limited to 'code/qcommon/cm_load.c')
-rw-r--r--code/qcommon/cm_load.c19
1 files changed, 11 insertions, 8 deletions
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<sizeof(dheader_t)/4 ; i++) {
((int *)&header)[i] = LittleLong ( ((int *)&header)[i]);
}
@@ -628,7 +631,7 @@ void CM_LoadMap( const char *name, qboolean clientload, int *checksum ) {
, name, header.version, BSP_VERSION );
}
- cmod_base = (byte *)buf;
+ cmod_base = (byte *)buf.i;
// load into heap
CMod_LoadShaders( &header.lumps[LUMP_SHADERS] );
@@ -645,7 +648,7 @@ void CM_LoadMap( const char *name, qboolean clientload, int *checksum ) {
CMod_LoadPatches( &header.lumps[LUMP_SURFACES], &header.lumps[LUMP_DRAWVERTS] );
// we are NOT freeing the file, because it is cached for the ref
- FS_FreeFile (buf);
+ FS_FreeFile (buf.v);
CM_InitBoxHull ();