engine: fix -Wmaybe-uninitialized
This commit is contained in:
parent
d0dbd185ad
commit
0fe18ae6dc
11 changed files with 38 additions and 30 deletions
|
@ -217,6 +217,10 @@ qboolean Image_LoadPNG( const char *name, const byte *buffer, fs_offset_t filesi
|
|||
case PNG_CT_RGBA:
|
||||
pixel_size = 4;
|
||||
break;
|
||||
default:
|
||||
pixel_size = 0; // make compiler happy
|
||||
ASSERT( false );
|
||||
break;
|
||||
}
|
||||
|
||||
image.type = PF_RGBA_32; // always exctracted to 32-bit buffer
|
||||
|
|
|
@ -1975,7 +1975,7 @@ static void Mod_LoadTextures( dbspmodel_t *bmod )
|
|||
if( mt->offsets[0] > 0 )
|
||||
{
|
||||
int size = (int)sizeof( mip_t ) + ((mt->width * mt->height * 85)>>6);
|
||||
int next_dataofs, remaining;
|
||||
int next_dataofs = 0, remaining;
|
||||
|
||||
// compute next dataofset to determine allocated miptex space
|
||||
for( j = i + 1; j < loadmodel->numtextures; j++ )
|
||||
|
|
|
@ -80,7 +80,7 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui
|
|||
mod->mins[2] = -pinq1->bounds[1] * 0.5f;
|
||||
mod->maxs[2] = pinq1->bounds[1] * 0.5f;
|
||||
}
|
||||
else if( i == SPRITE_VERSION_HL )
|
||||
else // if( i == SPRITE_VERSION_HL )
|
||||
{
|
||||
pinhl = (dsprite_hl_t *)buffer;
|
||||
size = sizeof( msprite_t ) + ( pinhl->numframes - 1 ) * sizeof( psprite->frames );
|
||||
|
@ -104,7 +104,6 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui
|
|||
if( Host_IsDedicated() )
|
||||
{
|
||||
// skip frames loading
|
||||
|
||||
psprite->numframes = 0;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -320,19 +320,19 @@ static void Mod_StudioCalcBoneAdj( float *adj, const byte *pcontroller )
|
|||
if( i == STUDIO_MOUTH )
|
||||
continue; // ignore mouth
|
||||
|
||||
if( i <= MAXSTUDIOCONTROLLERS )
|
||||
if( i >= MAXSTUDIOCONTROLLERS )
|
||||
continue;
|
||||
|
||||
// check for 360% wrapping
|
||||
if( pbonecontroller[j].type & STUDIO_RLOOP )
|
||||
{
|
||||
// check for 360% wrapping
|
||||
if( pbonecontroller[j].type & STUDIO_RLOOP )
|
||||
{
|
||||
value = pcontroller[i] * (360.0f / 256.0f) + pbonecontroller[j].start;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = pcontroller[i] / 255.0f;
|
||||
value = bound( 0.0f, value, 1.0f );
|
||||
value = (1.0f - value) * pbonecontroller[j].start + value * pbonecontroller[j].end;
|
||||
}
|
||||
value = pcontroller[i] * (360.0f / 256.0f) + pbonecontroller[j].start;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = pcontroller[i] / 255.0f;
|
||||
value = bound( 0.0f, value, 1.0f );
|
||||
value = (1.0f - value) * pbonecontroller[j].start + value * pbonecontroller[j].end;
|
||||
}
|
||||
|
||||
switch( pbonecontroller[j].type & STUDIO_TYPES )
|
||||
|
|
|
@ -68,7 +68,7 @@ void Sys_Print( const char *pMsg );
|
|||
void Sys_PrintLog( const char *pMsg );
|
||||
void Sys_InitLog( void );
|
||||
void Sys_CloseLog( void );
|
||||
void Sys_Quit( void );
|
||||
void Sys_Quit( void ) NORETURN;
|
||||
|
||||
//
|
||||
// sys_con.c
|
||||
|
|
|
@ -1296,7 +1296,7 @@ void pfnSetModel( edict_t *e, const char *m )
|
|||
char name[MAX_QPATH];
|
||||
qboolean found = false;
|
||||
model_t *mod;
|
||||
int i;
|
||||
int i = 1;
|
||||
|
||||
if( !SV_IsValidEdict( e ))
|
||||
return;
|
||||
|
@ -1308,7 +1308,7 @@ void pfnSetModel( edict_t *e, const char *m )
|
|||
if( COM_CheckString( name ))
|
||||
{
|
||||
// check to see if model was properly precached
|
||||
for( i = 1; i < MAX_MODELS && sv.model_precache[i][0]; i++ )
|
||||
for( ; i < MAX_MODELS && sv.model_precache[i][0]; i++ )
|
||||
{
|
||||
if( !Q_stricmp( sv.model_precache[i], name ))
|
||||
{
|
||||
|
|
2
mainui
2
mainui
|
@ -1 +1 @@
|
|||
Subproject commit 095661b44b5ef3bff4fe887de92bbe8cfc2fc6fd
|
||||
Subproject commit f197117dacd1938fe3afca34716e4b7b60b6f837
|
|
@ -21,8 +21,10 @@ GNU General Public License for more details.
|
|||
|
||||
#ifdef __GNUC__
|
||||
#define _format(x) __attribute__((format(printf, x, x+1)))
|
||||
#define NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
#define _format(x)
|
||||
#define NORETURN
|
||||
#endif
|
||||
|
||||
// timestamp modes
|
||||
|
|
|
@ -227,7 +227,7 @@ for the model, which holds for all frames
|
|||
*/
|
||||
void BuildTris( void )
|
||||
{
|
||||
int len, bestlen, besttype;
|
||||
int len, bestlen, besttype = 0;
|
||||
int bestverts[1024];
|
||||
int besttris[1024];
|
||||
int type, startv;
|
||||
|
|
|
@ -514,7 +514,7 @@ GL_SetTextureDimensions
|
|||
*/
|
||||
static void GL_SetTextureDimensions( gl_texture_t *tex, int width, int height, int depth )
|
||||
{
|
||||
int maxTextureSize;
|
||||
int maxTextureSize = 0;
|
||||
int maxDepthSize = 1;
|
||||
|
||||
Assert( tex != NULL );
|
||||
|
@ -539,6 +539,8 @@ static void GL_SetTextureDimensions( gl_texture_t *tex, int width, int height, i
|
|||
maxDepthSize = glConfig.max_3d_texture_size;
|
||||
maxTextureSize = glConfig.max_3d_texture_size;
|
||||
break;
|
||||
default:
|
||||
Assert( false );
|
||||
}
|
||||
|
||||
// store original sizes
|
||||
|
|
1
wscript
1
wscript
|
@ -237,6 +237,7 @@ def configure(conf):
|
|||
'-Werror=bool-compare',
|
||||
'-Werror=bool-operation',
|
||||
'-Werror=uninitialized',
|
||||
'-Werror=init-self',
|
||||
'-Werror=implicit-fallthrough=2', # clang incompatible without "=2"
|
||||
# '-Wdouble-promotion', # disable warning flood
|
||||
'-Wstrict-aliasing',
|
||||
|
|
Loading…
Add table
Reference in a new issue