Browse Source

engine: try to fix -Wmaybe-uninitialized that may be enabled with -Wuninitialized. Diagnostic is prone to false-positives, as compiler don't have enough data for this

pull/2/head
Alibek Omarov 4 years ago
parent
commit
0db1a7743d
  1. 2
      engine/client/cl_scrn.c
  2. 4
      engine/client/console.c
  3. 2
      engine/common/imagelib/img_png.c
  4. 2
      ref_gl/gl_sprite.c
  5. 2
      ref_soft/r_beams.c

2
engine/client/cl_scrn.c

@ -342,7 +342,7 @@ SCR_BeginLoadingPlaque @@ -342,7 +342,7 @@ SCR_BeginLoadingPlaque
*/
void SCR_BeginLoadingPlaque( qboolean is_background )
{
float oldclear;
float oldclear = 0;;
S_StopAllSounds( true );
cl.audio_prepped = false; // don't play ambients
cl.video_prepped = false;

4
engine/client/console.c

@ -1915,7 +1915,7 @@ int Con_DrawDebugLines( void ) @@ -1915,7 +1915,7 @@ int Con_DrawDebugLines( void )
if( host.realtime < con.notify[i].expire && con.notify[i].key_dest == cls.key_dest )
{
int x, len;
int fontTall;
int fontTall = 0;
Con_DrawStringLen( con.notify[i].szNotify, &len, &fontTall );
x = refState.width - Q_max( defaultX, len ) - 10;
@ -2238,7 +2238,7 @@ void Con_DrawVersion( void ) @@ -2238,7 +2238,7 @@ void Con_DrawVersion( void )
{
// draws the current build
byte *color = g_color_table[7];
int i, stringLen, width = 0, charH;
int i, stringLen, width = 0, charH = 0;
int start, height = refState.height;
qboolean draw_version = false;
string curbuild;

2
engine/common/imagelib/img_png.c

@ -41,7 +41,7 @@ qboolean Image_LoadPNG( const char *name, const byte *buffer, fs_offset_t filesi @@ -41,7 +41,7 @@ qboolean Image_LoadPNG( const char *name, const byte *buffer, fs_offset_t filesi
int ret;
short p, a, b, c, pa, pb, pc;
byte *buf_p, *pixbuf, *raw, *prior, *idat_buf = NULL, *uncompressed_buffer = NULL, *rowend;
uint chunk_len, crc32, crc32_check, oldsize = 0, newsize, rowsize;
uint chunk_len, crc32, crc32_check, oldsize = 0, newsize = 0, rowsize;
uint uncompressed_size, pixel_size, i, y, filter_type, chunk_sign;
qboolean has_iend_chunk = false;
z_stream stream = {0};

2
ref_gl/gl_sprite.c

@ -815,7 +815,7 @@ void R_DrawSpriteModel( cl_entity_t *e ) @@ -815,7 +815,7 @@ void R_DrawSpriteModel( cl_entity_t *e )
float angle, dot, sr, cr;
float lerp = 1.0f, ilerp, scale;
vec3_t v_forward, v_right, v_up;
vec3_t origin, color, color2;
vec3_t origin, color, color2 = { 0.0f };
if( RI.params & RP_ENVVIEW )
return;

2
ref_soft/r_beams.c

@ -198,7 +198,7 @@ static void R_DrawSegs( vec3_t source, vec3_t delta, float width, float scale, f @@ -198,7 +198,7 @@ static void R_DrawSegs( vec3_t source, vec3_t delta, float width, float scale, f
int i, total_segs, segs_drawn;
float div, length, fraction, factor;
float flMaxWidth, vLast, vStep, brightness;
vec3_t perp1, vLastNormal;
vec3_t perp1, vLastNormal = { 0.0f };
beamseg_t curSeg;
if( segments < 2 ) return;

Loading…
Cancel
Save