diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-04 10:16:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-04 11:10:01 +0400 |
commit | b9114cb609698bdd40175b79c017b8ec8d10b518 (patch) | |
tree | 98dc331711dcd06fb69f905ebdaf7937a4d23379 /source/blender/editors/interface/interface_ops.c | |
parent | 091740f858c1b6d3016e38fc3186cce737d9ff2c (diff) |
UI: Use bool rather then int/short's where possible
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r-- | source/blender/editors/interface/interface_ops.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 36e965e13d2..593f6e1dbe0 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -122,7 +122,7 @@ static int copy_data_path_button_exec(bContext *C, wmOperator *UNUSED(op)) path = RNA_path_from_ID_to_property(&ptr, prop); if (path) { - WM_clipboard_text_set(path, FALSE); + WM_clipboard_text_set(path, false); MEM_freeN(path); return OPERATOR_FINISHED; } @@ -256,9 +256,9 @@ static void UI_OT_unset_property_button(wmOperatorType *ot) /* Copy To Selected Operator ------------------------ */ -static int copy_to_selected_list(bContext *C, PointerRNA *ptr, ListBase *lb, int *use_path) +static bool copy_to_selected_list(bContext *C, PointerRNA *ptr, ListBase *lb, bool *use_path) { - *use_path = FALSE; + *use_path = false; if (RNA_struct_is_a(ptr->type, &RNA_EditBone)) *lb = CTX_data_collection_get(C, "selected_editable_bones"); @@ -271,13 +271,14 @@ static int copy_to_selected_list(bContext *C, PointerRNA *ptr, ListBase *lb, int if (id && GS(id->name) == ID_OB) { *lb = CTX_data_collection_get(C, "selected_editable_objects"); - *use_path = TRUE; + *use_path = true; + } + else { + return false; } - else - return 0; } - return 1; + return true; } static int copy_to_selected_button_poll(bContext *C) @@ -290,7 +291,7 @@ static int copy_to_selected_button_poll(bContext *C) if (ptr.data && prop) { char *path = NULL; - int use_path; + bool use_path; CollectionPointerLink *link; ListBase lb; @@ -340,7 +341,7 @@ static int copy_to_selected_button_exec(bContext *C, wmOperator *op) /* if there is a valid property that is editable... */ if (ptr.data && prop) { char *path = NULL; - int use_path; + bool use_path; CollectionPointerLink *link; ListBase lb; @@ -490,7 +491,7 @@ static void ui_editsource_active_but_clear(void) ui_editsource_info = NULL; } -static int ui_editsource_uibut_match(uiBut *but_a, uiBut *but_b) +static bool ui_editsource_uibut_match(uiBut *but_a, uiBut *but_b) { #if 0 printf("matching buttons: '%s' == '%s'\n", @@ -507,10 +508,10 @@ static int ui_editsource_uibut_match(uiBut *but_a, uiBut *but_b) (but_a->unit_type == but_b->unit_type) && (strncmp(but_a->drawstr, but_b->drawstr, UI_MAX_DRAW_STR) == 0)) { - return TRUE; + return true; } else { - return FALSE; + return false; } } @@ -575,7 +576,7 @@ static int editsource_text_edit(bContext *C, wmOperator *op, BKE_reportf(op->reports, RPT_INFO, "See '%s' in the text editor", text->id.name + 2); } - txt_move_toline(text, line - 1, FALSE); + txt_move_toline(text, line - 1, false); WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, text); } |