Code cleanup: better warning in case of modifier icons in outliner.

Modified the switch statement to use the ModifierType enum and changed
the default case to use specific missing values. Compiler can then
issue warnings when new modifier types are added (at least gcc 4.6.3
does)
This commit is contained in:
Nicholas Bishop 2012-05-22 18:40:31 +00:00
parent fc4d5cf37e
commit 89fcec812a

@ -932,7 +932,7 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto
{
Object *ob = (Object *)tselem->id;
ModifierData *md = BLI_findlink(&ob->modifiers, tselem->nr);
switch (md->type) {
switch ((ModifierType)md->type) {
case eModifierType_Subsurf:
UI_icon_draw(x, y, ICON_MOD_SUBSURF); break;
case eModifierType_Armature:
@ -986,6 +986,7 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto
case eModifierType_Explode:
UI_icon_draw(x, y, ICON_MOD_EXPLODE); break;
case eModifierType_Collision:
case eModifierType_Surface:
UI_icon_draw(x, y, ICON_MOD_PHYSICS); break;
case eModifierType_Fluidsim:
UI_icon_draw(x, y, ICON_MOD_FLUIDSIM); break;
@ -1011,7 +1012,11 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto
UI_icon_draw(x, y, ICON_MOD_WARP); break;
case eModifierType_Skin:
UI_icon_draw(x, y, ICON_MOD_SKIN); break;
default:
/* Default */
case eModifierType_None:
case eModifierType_ShapeKey:
case NUM_MODIFIER_TYPES:
UI_icon_draw(x, y, ICON_DOT); break;
}
break;