else if ( !Q_stricmp( token, "sun" ) /* sof2 */ || !Q_stricmp( token, "q3map_sun" ) || !Q_stricmp( token, "q3map_sunExt" ) ) {
float a, b;
sun_t *sun;
- qboolean ext;
-
+ qboolean ext = qfalse;
/* ydnar: extended sun directive? */
if ( !Q_stricmp( token, "q3map_sunext" ) ) {
}
/* allocate sun */
- sun = safe_malloc( sizeof( *sun ) );
- memset( sun, 0, sizeof( *sun ) );
+ sun = safe_malloc0( sizeof( *sun ) );
/* set style */
sun->style = si->lightStyle;
surfaceModel_t *model;
/* allocate new model and attach it */
- model = safe_malloc( sizeof( *model ) );
- memset( model, 0, sizeof( *model ) );
+ model = safe_malloc0( sizeof( *model ) );
model->next = si->surfaceModel;
si->surfaceModel = model;
/* allocate new foliage struct and attach it */
- foliage = safe_malloc( sizeof( *foliage ) );
- memset( foliage, 0, sizeof( *foliage ) );
+ foliage = safe_malloc0( sizeof( *foliage ) );
foliage->next = si->foliage;
si->foliage = foliage;
alpha = ( !Q_stricmp( token, "q3map_alphaGen" ) || !Q_stricmp( token, "q3map_alphaMod" ) ) ? 1 : 0;
/* allocate new colormod */
- cm = safe_malloc( sizeof( *cm ) );
- memset( cm, 0, sizeof( *cm ) );
+ cm = safe_malloc0( sizeof( *cm ) );
/* attach to shader */
if ( si->colorMod == NULL ) {
custSurfaceParms[ numCustSurfaceParms ].name = safe_malloc( MAX_OS_PATH );
strcpy( custSurfaceParms[ numCustSurfaceParms ].name, token );
GetToken( qfalse );
- sscanf( token, "%x", &custSurfaceParms[ numCustSurfaceParms ].contentFlags );
+ sscanf( token, "%x", (unsigned int *) &custSurfaceParms[ numCustSurfaceParms ].contentFlags );
numCustSurfaceParms++;
}
custSurfaceParms[ numCustSurfaceParms ].name = safe_malloc( MAX_OS_PATH );
strcpy( custSurfaceParms[ numCustSurfaceParms ].name, token );
GetToken( qfalse );
- sscanf( token, "%x", &custSurfaceParms[ numCustSurfaceParms ].surfaceFlags );
+ sscanf( token, "%x", (unsigned int *) &custSurfaceParms[ numCustSurfaceParms ].surfaceFlags );
numCustSurfaceParms++;
}