diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-09-18 04:06:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-09-18 04:15:12 +0300 |
commit | 0e78dacb4d30070fd5ac727a7566d54bd11de545 (patch) | |
tree | df94581399d1d92f1818504d122f67e80a19094e /source/blender/editors/interface/interface_icons.c | |
parent | 1dda60792cc303ec81785d6a79926eed9a4da3d3 (diff) |
Cleanup: change enum usage so types are explicitly listed
Structure switch statements so new missing items cause warnings.
Diffstat (limited to 'source/blender/editors/interface/interface_icons.c')
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 6cd005b59e5..d8a2ec53011 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -2257,7 +2257,7 @@ int UI_icon_from_rnaptr(bContext *C, PointerRNA *ptr, int rnaicon, const bool bi int UI_icon_from_idcode(const int idcode) { - switch (idcode) { + switch ((ID_Type)idcode) { case ID_AC: return ICON_ACTION; case ID_AR: @@ -2329,14 +2329,21 @@ int UI_icon_from_idcode(const int idcode) case ID_SIM: /* TODO: Use correct icon. */ return ICON_PHYSICS; - default: - return ICON_NONE; + + /* No icons for these ID-types. */ + case ID_LI: + case ID_IP: + case ID_KE: + case ID_SCR: + case ID_WM: + break; } + return ICON_NONE; } int UI_icon_from_object_mode(const int mode) { - switch (mode) { + switch ((eObjectMode)mode) { case OB_MODE_OBJECT: return ICON_OBJECT_DATAMODE; case OB_MODE_EDIT: @@ -2359,9 +2366,8 @@ int UI_icon_from_object_mode(const int mode) return ICON_POSE_HLT; case OB_MODE_PAINT_GPENCIL: return ICON_GREASEPENCIL; - default: - return ICON_NONE; } + return ICON_NONE; } int UI_icon_color_from_collection(const Collection *collection) |