diff --git a/engine/client/cl_efx.c b/engine/client/cl_efx.c index 17f3fbfb..363ae289 100644 --- a/engine/client/cl_efx.c +++ b/engine/client/cl_efx.c @@ -2152,6 +2152,7 @@ void CL_ThinkParticle( double frametime, particle_t *p ) p->vel[2] -= grav; break; } + // intentionally fallthrough case pt_blob2: if( p->packedColor == 255 ) { diff --git a/engine/client/s_mix.c b/engine/client/s_mix.c index 16b53468..263af5cc 100644 --- a/engine/client/s_mix.c +++ b/engine/client/s_mix.c @@ -408,13 +408,13 @@ void S_MixChannel( channel_t *pChannel, void *pData, int outputOffset, int input if( pSource->channels == 1 ) { if( pSource->width == 1 ) - S_Mix8Mono( pbuf, pvol, (char *)pData, inputOffset, fracRate, outCount, timecompress ); + S_Mix8Mono( pbuf, pvol, pData, inputOffset, fracRate, outCount, timecompress ); else S_Mix16Mono( pbuf, pvol, (short *)pData, inputOffset, fracRate, outCount ); } else { if( pSource->width == 1 ) - S_Mix8Stereo( pbuf, pvol, (char *)pData, inputOffset, fracRate, outCount ); + S_Mix8Stereo( pbuf, pvol, pData, inputOffset, fracRate, outCount ); else S_Mix16Stereo( pbuf, pvol, (short *)pData, inputOffset, fracRate, outCount ); } } diff --git a/engine/common/imagelib/img_dds.c b/engine/common/imagelib/img_dds.c index 468a2003..bac77452 100644 --- a/engine/common/imagelib/img_dds.c +++ b/engine/common/imagelib/img_dds.c @@ -106,11 +106,13 @@ void Image_DXTGetPixelFormat( dds_t *hdr ) break; case TYPE_DXT2: image.flags &= ~IMAGE_HAS_ALPHA; // alpha is already premultiplied by color + // intentionally fallthrough case TYPE_DXT3: image.type = PF_DXT3; break; case TYPE_DXT4: image.flags &= ~IMAGE_HAS_ALPHA; // alpha is already premultiplied by color + // intentionally fallthrough case TYPE_DXT5: image.type = PF_DXT5; break; diff --git a/engine/common/imagelib/img_main.c b/engine/common/imagelib/img_main.c index e55a77a4..f86a0a22 100644 --- a/engine/common/imagelib/img_main.c +++ b/engine/common/imagelib/img_main.c @@ -275,7 +275,7 @@ rgbdata_t *FS_LoadImage( const char *filename, const byte *buffer, size_t size ) if( anyformat || !Q_stricmp( ext, format->ext )) { Q_sprintf( path, format->formatstring, loadname, cmap->type[i].suf, format->ext ); - image.hint = cmap->type[i].hint; // side hint + image.hint = (image_hint_t)cmap->type[i].hint; // side hint f = FS_LoadFile( path, &filesize, false ); if( f && filesize > 0 ) diff --git a/engine/common/imagelib/img_utils.c b/engine/common/imagelib/img_utils.c index d99f327d..0f39c0fd 100644 --- a/engine/common/imagelib/img_utils.c +++ b/engine/common/imagelib/img_utils.c @@ -1246,7 +1246,7 @@ qboolean Image_Decompress( const byte *data ) else Image_GetPaletteLMP( image.palette, LUMP_MASKED ); } else Image_GetPaletteLMP( image.palette, LUMP_NORMAL ); - // intentional falltrough + // intentionally fallthrough case PF_INDEXED_32: if( !image.d_currentpal ) image.d_currentpal = (uint *)image.palette; if( !Image_Copy8bitRGBA( fin, fout, image.width * image.height )) diff --git a/engine/common/imagelib/img_wad.c b/engine/common/imagelib/img_wad.c index f541191d..8a19d8bc 100644 --- a/engine/common/imagelib/img_wad.c +++ b/engine/common/imagelib/img_wad.c @@ -237,6 +237,7 @@ qboolean Image_LoadSPR( const char *name, const byte *buffer, fs_offset_t filesi { case LUMP_MASKED: SetBits( image.flags, IMAGE_ONEBIT_ALPHA ); + // intentionally fallthrough case LUMP_GRADIENT: case LUMP_QUAKE1: SetBits( image.flags, IMAGE_HAS_ALPHA ); diff --git a/engine/common/net_ws.c b/engine/common/net_ws.c index 39e51fa4..9df6544b 100644 --- a/engine/common/net_ws.c +++ b/engine/common/net_ws.c @@ -1246,7 +1246,7 @@ void NET_SendPacketEx( netsrc_t sock, size_t length, const void *data, netadr_t { int ret; struct sockaddr addr; - SOCKET net_socket; + SOCKET net_socket = 0; if( !net.initialized || to.type == NA_LOOPBACK ) { diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index 9143d207..f69e934c 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -409,7 +409,8 @@ float SV_Submerged( edict_t *ent ) svs.groupmask = ent->v.groupinfo; if( SV_PointContents( point ) == CONTENTS_WATER ) return (ent->v.maxs[2] - ent->v.mins[2]); - case 2: // intentionally fallthrough + // intentionally fallthrough + case 2: bottom = SV_RecursiveWaterLevel( center, ent->v.absmax[2] - center[2], 0.0f, 0 ); return bottom - start; } diff --git a/mainui b/mainui index 26d67118..095661b4 160000 --- a/mainui +++ b/mainui @@ -1 +1 @@ -Subproject commit 26d671182590086e91cdad6f121a1ebf6e6f6b8e +Subproject commit 095661b44b5ef3bff4fe887de92bbe8cfc2fc6fd diff --git a/ref_gl/gl_sprite.c b/ref_gl/gl_sprite.c index 36e9a08e..3a933458 100644 --- a/ref_gl/gl_sprite.c +++ b/ref_gl/gl_sprite.c @@ -206,7 +206,7 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui for( i = 0; i < mod->numframes; i++ ) { frametype_t frametype = pframetype->type; - psprite->frames[i].type = frametype; + psprite->frames[i].type = (spriteframetype_t)frametype; switch( frametype ) { @@ -858,6 +858,7 @@ void R_DrawSpriteModel( cl_entity_t *e ) { case kRenderTransAlpha: pglDepthMask( GL_FALSE ); + // fallthrough case kRenderTransColor: case kRenderTransTexture: pglEnable( GL_BLEND ); @@ -865,6 +866,7 @@ void R_DrawSpriteModel( cl_entity_t *e ) break; case kRenderGlow: pglDisable( GL_DEPTH_TEST ); + // fallthrough case kRenderTransAdd: pglEnable( GL_BLEND ); pglBlendFunc( GL_SRC_ALPHA, GL_ONE ); diff --git a/wscript b/wscript index 189fc64d..d67357d9 100644 --- a/wscript +++ b/wscript @@ -236,6 +236,8 @@ def configure(conf): '-Werror=duplicated-branches', # BEWARE: buggy '-Werror=bool-compare', '-Werror=bool-operation', + '-Werror=uninitialized', + '-Werror=implicit-fallthrough=2', # clang incompatible without "=2" # '-Wdouble-promotion', # disable warning flood '-Wstrict-aliasing', ] @@ -248,7 +250,8 @@ def configure(conf): '-Werror=strict-prototypes', '-Werror=old-style-declaration', '-Werror=old-style-definition', - '-Werror=declaration-after-statement' + '-Werror=declaration-after-statement', + '-Werror=enum-conversion' ] linkflags = conf.get_flags_by_type(linker_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC, conf.env.CC_VERSION[0])