Fixed: Switch not handled warnings

This commit is contained in:
kervala 2014-03-27 15:53:19 +01:00
parent 9455917025
commit 85ab0dba81
9 changed files with 71 additions and 51 deletions

View file

@ -70,13 +70,16 @@ CPixelProgamDrvInfosGL::CPixelProgamDrvInfosGL (CDriverGL *drv, ItGPUPrgDrvInfoP
bool CDriverGL::supportPixelProgram(CPixelProgram::TProfile profile) const bool CDriverGL::supportPixelProgram(CPixelProgram::TProfile profile) const
{ {
H_AUTO_OGL(CPixelProgamDrvInfosGL_supportPixelProgram_profile) H_AUTO_OGL(CPixelProgamDrvInfosGL_supportPixelProgram_profile);
switch (profile) switch (profile)
{ {
case CPixelProgram::arbfp1: case CPixelProgram::arbfp1:
return _Extensions.ARBFragmentProgram; return _Extensions.ARBFragmentProgram;
case CPixelProgram::fp40: case CPixelProgram::fp40:
return _Extensions.NVFragmentProgram2; return _Extensions.NVFragmentProgram2;
default:
break;
} }
return false; return false;
} }

View file

@ -60,6 +60,8 @@ inline void CDriverGL::setUniform4fInl(TProgram program, uint index, float f0, f
nglProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, index, f0, f1, f2, f3); nglProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, index, f0, f1, f2, f3);
} }
break; break;
default:
break;
} }
#endif #endif
} }
@ -100,6 +102,8 @@ inline void CDriverGL::setUniform4fvInl(TProgram program, uint index, size_t num
} }
} }
break; break;
default:
break;
} }
#endif #endif
} }

View file

@ -78,6 +78,9 @@ namespace NLGUI
case TTSpecialWindow: case TTSpecialWindow:
return "special"; return "special";
break; break;
default:
break;
} }
return ""; return "";

View file

@ -801,7 +801,10 @@ namespace NLGUI
return "radio_button"; return "radio_button";
break; break;
default:
break;
} }
return ""; return "";
} }

View file

@ -208,6 +208,9 @@ namespace NLGUI
case PlayerName: case PlayerName:
return "playername"; return "playername";
break; break;
default:
break;
} }
return "text"; return "text";
@ -497,6 +500,9 @@ namespace NLGUI
case PlayerName: case PlayerName:
e = "playername"; e = "playername";
break; break;
default:
break;
} }
xmlSetProp( node, BAD_CAST "enter_type", BAD_CAST e.c_str() ); xmlSetProp( node, BAD_CAST "enter_type", BAD_CAST e.c_str() );

View file

@ -199,77 +199,77 @@ namespace NLGUI
{ {
return toString( _MaxElements ); return toString( _MaxElements );
} }
else
if( name == "addelt" ) if( name == "addelt" )
{ {
switch( _AddElt ) switch( _AddElt )
{ {
case Top: case Top:
return "T"; return "T";
break;
case Left: case Left:
return "L"; return "L";
break;
case Right: case Right:
return "R"; return "R";
break;
}
case Bottom:
return "B"; return "B";
} }
else
nlassert(false);
}
if( name == "align" ) if( name == "align" )
{ {
switch( _Align ) switch( _Align )
{ {
case Top: case Top:
return "T"; return "T";
break;
case Left: case Left:
return "L"; return "L";
break;
case Right: case Right:
return "R"; return "R";
break;
}
case Bottom:
return "B"; return "B";
} }
else
nlassert(false);
}
if( name == "space" ) if( name == "space" )
{ {
return toString( _Space ); return toString( _Space );
} }
else
if( name == "over" ) if( name == "over" )
{ {
return toString( _Over ); return toString( _Over );
} }
else
if( name == "dynamic_display_size" ) if( name == "dynamic_display_size" )
{ {
return toString( _DynamicDisplaySize ); return toString( _DynamicDisplaySize );
} }
else
if( name == "col_over" ) if( name == "col_over" )
{ {
return toString( _OverColor ); return toString( _OverColor );
} }
else
if( name == "hardtext" ) if( name == "hardtext" )
{ {
return _HardText; return _HardText;
} }
else
if( name == "textid" ) if( name == "textid" )
{ {
return toString( _TextId ); return toString( _TextId );
} }
else
return CInterfaceGroup::getProperty( name ); return CInterfaceGroup::getProperty( name );
} }
@ -282,7 +282,7 @@ namespace NLGUI
_MaxElements = i; _MaxElements = i;
return; return;
} }
else
if( name == "addelt" ) if( name == "addelt" )
{ {
if( value == "T" ) if( value == "T" )
@ -300,7 +300,7 @@ namespace NLGUI
setupSizes(); setupSizes();
return; return;
} }
else
if( name == "align" ) if( name == "align" )
{ {
if( value == "T" ) if( value == "T" )
@ -317,7 +317,7 @@ namespace NLGUI
return; return;
} }
else
if( name == "space" ) if( name == "space" )
{ {
sint32 i; sint32 i;
@ -325,7 +325,7 @@ namespace NLGUI
_Space = i; _Space = i;
return; return;
} }
else
if( name == "over" ) if( name == "over" )
{ {
bool b; bool b;
@ -333,7 +333,7 @@ namespace NLGUI
_Over = b; _Over = b;
return; return;
} }
else
if( name == "dynamic_display_size" ) if( name == "dynamic_display_size" )
{ {
bool b; bool b;
@ -341,7 +341,7 @@ namespace NLGUI
_DynamicDisplaySize = b; _DynamicDisplaySize = b;
return; return;
} }
else
if( name == "col_over" ) if( name == "col_over" )
{ {
CRGBA c; CRGBA c;
@ -349,7 +349,7 @@ namespace NLGUI
_OverColor = c; _OverColor = c;
return; return;
} }
else
if( name == "hardtext" ) if( name == "hardtext" )
{ {
_HardText = value; _HardText = value;
@ -357,7 +357,7 @@ namespace NLGUI
onTextChanged(); onTextChanged();
return; return;
} }
else
if( name == "textid" ) if( name == "textid" )
{ {
uint32 i; uint32 i;
@ -367,7 +367,7 @@ namespace NLGUI
onTextChanged(); onTextChanged();
return; return;
} }
else
CInterfaceGroup::setProperty( name, value ); CInterfaceGroup::setProperty( name, value );
} }

View file

@ -197,18 +197,18 @@ namespace NLGUI
{ {
case Top: case Top:
return "T"; return "T";
break;
case Left: case Left:
return "L"; return "L";
break;
case Right: case Right:
return "R"; return "R";
break;
case Bottom:
return "B";
} }
return "B"; nlassert(false);
} }
else else
if( name == "align" ) if( name == "align" )
@ -217,18 +217,18 @@ namespace NLGUI
{ {
case Top: case Top:
return "T"; return "T";
break;
case Left: case Left:
return "L"; return "L";
break;
case Right: case Right:
return "R"; return "R";
break;
case Bottom:
return "B";
} }
return "B"; nlassert(false);
} }
else else
if( name == "space" ) if( name == "space" )

View file

@ -80,15 +80,15 @@ namespace NLGUI
{ {
case Right: case Right:
return "right"; return "right";
break;
case Center: case Center:
return "center"; return "center";
break;
case Left:
return "left";
} }
return "left"; nlassert(false);
} }
else else
if( name == "valign" ) if( name == "valign" )
@ -97,14 +97,15 @@ namespace NLGUI
{ {
case Middle: case Middle:
return "middle"; return "middle";
break;
case Bottom: case Bottom:
return "bottom"; return "bottom";
break;
case Top:
return "top";
} }
return "top"; nlassert(false);
} }
else else
if( name == "left_margin" ) if( name == "left_margin" )

View file

@ -2292,23 +2292,23 @@ void CCharacterCL::endAnimTransition()
if(_CurrentState->NextMode != _Mode) if(_CurrentState->NextMode != _Mode)
{ {
// Undo previous behaviour // Undo previous behaviour
switch(_Mode) if (_Mode == MBEHAV::DEATH)
{ {
case MBEHAV::DEATH:
// Restore collisions. // Restore collisions.
if(_Primitive) if (_Primitive)
{ {
// TODO: Without this dynamic cast // TODO: Without this dynamic cast
if(dynamic_cast<CPlayerCL *>(this)) if (dynamic_cast<CPlayerCL *>(this))
_Primitive->setOcclusionMask(MaskColPlayer); _Primitive->setOcclusionMask(MaskColPlayer);
else else
_Primitive->setOcclusionMask(MaskColNpc); _Primitive->setOcclusionMask(MaskColNpc);
} }
break;
} }
if(ClientCfg.UsePACSForAll && _Primitive)
if (ClientCfg.UsePACSForAll && _Primitive)
_Primitive->setCollisionMask(MaskColNone); _Primitive->setCollisionMask(MaskColNone);
//// AJOUT ////
//// ADDED ////
switch(_CurrentState->NextMode) switch(_CurrentState->NextMode)
{ {
// Combat // Combat