Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-09-18 04:06:41 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-09-18 04:15:12 +0300
commit0e78dacb4d30070fd5ac727a7566d54bd11de545 (patch)
treedf94581399d1d92f1818504d122f67e80a19094e /source/blender/editors
parent1dda60792cc303ec81785d6a79926eed9a4da3d3 (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')
-rw-r--r--source/blender/editors/interface/interface_icons.c18
-rw-r--r--source/blender/editors/interface/interface_templates.c11
2 files changed, 22 insertions, 7 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)
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 30b98717505..9d9a7e53c49 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -675,7 +675,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
static const char *template_id_browse_tip(const StructRNA *type)
{
if (type) {
- switch (RNA_type_to_ID_code(type)) {
+ switch ((ID_Type)RNA_type_to_ID_code(type)) {
case ID_SCE:
return N_("Browse Scene to be linked");
case ID_OB:
@@ -744,6 +744,15 @@ static const char *template_id_browse_tip(const StructRNA *type)
return N_("Browse Volume Data to be linked");
case ID_SIM:
return N_("Browse Simulation to be linked");
+
+ /* Use generic text. */
+ case ID_LI:
+ case ID_IP:
+ case ID_KE:
+ case ID_VF:
+ case ID_GR:
+ case ID_WM:
+ break;
}
}
return N_("Browse ID data to be linked");