]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/shaders.c
Merge commit 'e744bb6dadcd57fff460b7e6409ecd61bfe272c7' into master-merge
[xonotic/netradiant.git] / tools / quake3 / q3map2 / shaders.c
index 208dec4829782a28963df225bc309fd0addcdc12..bedeccfc1edc47a02f4cec5babe53fb19be4551a 100644 (file)
@@ -1275,8 +1275,7 @@ static void ParseShaderFile( const char *filename ){
                        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" ) ) {
@@ -1284,8 +1283,7 @@ static void ParseShaderFile( const char *filename ){
                                }
 
                                /* allocate sun */
-                               sun = safe_malloc( sizeof( *sun ) );
-                               memset( sun, 0, sizeof( *sun ) );
+                               sun = safe_malloc0( sizeof( *sun ) );
 
                                /* set style */
                                sun->style = si->lightStyle;
@@ -1385,8 +1383,7 @@ static void ParseShaderFile( const char *filename ){
                                        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;
 
@@ -1419,8 +1416,7 @@ static void ParseShaderFile( const char *filename ){
 
 
                                        /* 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;
 
@@ -1750,8 +1746,7 @@ static void ParseShaderFile( const char *filename ){
                                        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 ) {