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>2019-04-13 10:15:15 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-13 10:15:15 +0300
commit73c7aaba226349e93ca4966941f4eb051a94c097 (patch)
treea3883f8abae08ab019ebfded6591728dce2aab24 /source/blender/windowmanager/intern/wm_operator_type.c
parent45b810e1f8b088f3dc5329cfb0fe01092a156a6c (diff)
Cleanup: style, use braces for the window manager
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operator_type.c')
-rw-r--r--source/blender/windowmanager/intern/wm_operator_type.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/source/blender/windowmanager/intern/wm_operator_type.c b/source/blender/windowmanager/intern/wm_operator_type.c
index 76586ee2a0b..606fb822e67 100644
--- a/source/blender/windowmanager/intern/wm_operator_type.c
+++ b/source/blender/windowmanager/intern/wm_operator_type.c
@@ -158,8 +158,9 @@ void WM_operatortype_remove_ptr(wmOperatorType *ot)
MEM_freeN(ot->last_properties);
}
- if (ot->macro.first)
+ if (ot->macro.first) {
wm_operatortype_free_macro(ot);
+ }
BLI_ghash_remove(global_ops_hash, ot->idname, NULL, NULL);
@@ -172,8 +173,9 @@ bool WM_operatortype_remove(const char *idname)
{
wmOperatorType *ot = WM_operatortype_find(idname, 0);
- if (ot == NULL)
+ if (ot == NULL) {
return false;
+ }
WM_operatortype_remove_ptr(ot);
@@ -194,11 +196,14 @@ static void operatortype_ghash_free_cb(wmOperatorType *ot)
MEM_freeN(ot->last_properties);
}
- if (ot->macro.first)
+ if (ot->macro.first) {
wm_operatortype_free_macro(ot);
+ }
- if (ot->ext.srna) /* python operator, allocs own string */
+ if (ot->ext.srna) {
+ /* python operator, allocs own string */
MEM_freeN((void *)ot->idname);
+ }
MEM_freeN(ot);
}
@@ -354,10 +359,12 @@ static int wm_macro_invoke_internal(bContext *C, wmOperator *op, const wmEvent *
/* start from operator received as argument */
for (; opm; opm = opm->next) {
- if (opm->type->invoke)
+ if (opm->type->invoke) {
retval = opm->type->invoke(C, opm, event);
- else if (opm->type->exec)
+ }
+ else if (opm->type->exec) {
retval = opm->type->exec(C, opm);
+ }
OPERATOR_RETVAL_CHECK(retval);
@@ -480,8 +487,10 @@ wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *nam
ot->cancel = wm_macro_cancel;
ot->poll = NULL;
- if (!ot->description) /* XXX All ops should have a description but for now allow them not to. */
+ if (!ot->description) {
+ /* XXX All ops should have a description but for now allow them not to. */
ot->description = UNDOCUMENTED_OPERATOR_TIP;
+ }
RNA_def_struct_ui_text(ot->srna, ot->name, ot->description);
RNA_def_struct_identifier(&BLENDER_RNA, ot->srna, ot->idname);
@@ -509,8 +518,9 @@ void WM_operatortype_append_macro_ptr(void (*opfunc)(wmOperatorType *, void *),
ot->cancel = wm_macro_cancel;
ot->poll = NULL;
- if (!ot->description)
+ if (!ot->description) {
ot->description = UNDOCUMENTED_OPERATOR_TIP;
+ }
/* Set the default i18n context now, so that opfunc can redefine it if needed! */
RNA_def_struct_translation_context(ot->srna, BLT_I18NCONTEXT_OPERATOR_DEFAULT);