From 6734936c13b379e299bfb45915a99b605ae450c6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 4 Jan 2014 18:08:43 +1100 Subject: RNA API: use bool's for enum itemf callbacks. --- source/blender/editors/interface/interface.c | 10 ++++++---- source/blender/editors/interface/interface_layout.c | 18 +++++++++++------- source/blender/editors/interface/interface_templates.c | 3 ++- 3 files changed, 19 insertions(+), 12 deletions(-) (limited to 'source/blender/editors/interface') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index af303e807b6..e6e175284d0 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2956,7 +2956,8 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s if (type == MENU && proptype == PROP_ENUM) { EnumPropertyItem *item; DynStr *dynstr; - int i, totitem, value, free; + int i, totitem, value; + bool free; RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free); value = RNA_property_enum_get(ptr, prop); @@ -2989,7 +2990,7 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s } else if (ELEM(type, ROW, LISTROW) && proptype == PROP_ENUM) { EnumPropertyItem *item, *item_array = NULL; - int free; + bool free; /* get untranslated, then translate the single string we need */ RNA_property_enum_items(block->evil_C, ptr, prop, &item_array, NULL, &free); @@ -3904,7 +3905,7 @@ static void operator_enum_search_cb(const struct bContext *C, void *but, const c else { PointerRNA *ptr = uiButGetOperatorPtrRNA(but); /* Will create it if needed! */ EnumPropertyItem *item, *item_array; - int do_free; + bool do_free; RNA_property_enum_items((bContext *)C, ptr, prop, &item_array, NULL, &do_free); @@ -3986,7 +3987,8 @@ void uiButGetStrInfo(bContext *C, uiBut *but, ...) uiStringInfo *si; EnumPropertyItem *items = NULL, *item = NULL; - int totitems, free_items = FALSE; + int totitems; + bool free_items = false; va_start(args, but); while ((si = (uiStringInfo *) va_arg(args, void *))) { diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 9944f72da8f..c884235c219 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -547,7 +547,8 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt uiBut *but; EnumPropertyItem *item, *item_array; const char *name; - int itemw, icon, value, free; + int itemw, icon, value; + bool free; RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item_array, NULL, &free); @@ -798,7 +799,7 @@ PointerRNA uiItemFullO(uiLayout *layout, const char *opname, const char *name, i static const char *ui_menu_enumpropname(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int retval) { EnumPropertyItem *item; - int free; + bool free; const char *name; RNA_property_enum_items(layout->root->block->evil_C, ptr, prop, &item, NULL, &free); @@ -877,7 +878,7 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname if (prop && RNA_property_type(prop) == PROP_ENUM) { EnumPropertyItem *item, *item_array = NULL; - int free; + bool free; uiLayout *split = uiLayoutSplit(layout, 0.0f, false); uiLayout *column = uiLayoutColumn(split, false); @@ -979,7 +980,8 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char PropertyRNA *prop; EnumPropertyItem *item; - int value, free; + int value; + bool free; UI_OPERATOR_ERROR_RET(ot, opname, return ); @@ -1096,7 +1098,7 @@ static void ui_item_rna_size(uiLayout *layout, const char *name, int icon, Point else if (type == PROP_ENUM) { /* Find the longest enum item name, instead of using a dummy text! */ EnumPropertyItem *item, *item_array; - int free; + bool free; RNA_property_enum_items_gettexted(layout->root->block->evil_C, ptr, prop, &item_array, NULL, &free); for (item = item_array; item->identifier; item++) { @@ -1272,7 +1274,8 @@ void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *pr { PropertyRNA *prop = RNA_struct_find_property(ptr, propname); EnumPropertyItem *item; - int ivalue, a, free; + int ivalue, a; + bool free; if (!prop || RNA_property_type(prop) != PROP_ENUM) { ui_item_disabled(layout, propname); @@ -1325,7 +1328,8 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname } else { EnumPropertyItem *item; - int totitem, i, free; + int totitem, i; + bool free; uiLayout *split = uiLayoutSplit(layout, 0.0f, false); uiLayout *column = uiLayoutColumn(split, false); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 4ab57e3b4ad..92a621387a8 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1584,7 +1584,8 @@ static uiBlock *icon_view_menu(bContext *C, ARegion *ar, void *arg_litem) uiBut *but; int icon; EnumPropertyItem *item; - int a, free; + int a; + bool free; /* arg_litem is malloced, can be freed by parent button */ cb = *((RNAUpdateCb *)arg_litem); -- cgit v1.2.3