* Fix some new GCC 4.3 warnings

* Fix many many strict aliasing warnings, now that it's re-enabled
This commit is contained in:
Tim Angus 2008-11-10 23:55:22 +00:00
parent 7c19978aaa
commit 72dea0a184
19 changed files with 220 additions and 152 deletions

View file

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