[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46908] trunk/blender/source/blender/ editors/space_outliner/outliner_draw.c: Code cleanup: better warning in case of modifier icons in outliner.

Nicholas Bishop nicholasbishop at gmail.com
Tue May 22 20:40:31 CEST 2012


Revision: 46908
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46908
Author:   nicholasbishop
Date:     2012-05-22 18:40:31 +0000 (Tue, 22 May 2012)
Log Message:
-----------
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)

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_outliner/outliner_draw.c

Modified: trunk/blender/source/blender/editors/space_outliner/outliner_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner_draw.c	2012-05-22 18:20:07 UTC (rev 46907)
+++ trunk/blender/source/blender/editors/space_outliner/outliner_draw.c	2012-05-22 18:40:31 UTC (rev 46908)
@@ -932,7 +932,7 @@
 			{
 				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 @@
 					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 @@
 						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;




More information about the Bf-blender-cvs mailing list