diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-22 22:40:31 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-22 22:40:31 +0400 |
commit | 89fcec812af20faa1022bf9a6e6ba62985244f02 (patch) | |
tree | 8246011942b92f4349d0eecd2142c3ee4c81a33d | |
parent | fc4d5cf37ee426c1dd0f00938759a42c5adc2778 (diff) |
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)
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 3662cfb4e3f..fddd7af93f1 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -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; |