diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-18 19:30:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-18 19:30:51 +0400 |
commit | e6c54c26aef3334078c27730c9ea7fa546ecb51e (patch) | |
tree | bcbb68e57755dadf930d63169c6c52ab8b0d1c53 | |
parent | 484d765bd49e0b7a3370280f5f3b9dac89e5f699 (diff) |
use booleans for operator check functions.
-rw-r--r-- | source/blender/editors/screen/screendump.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 6 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 4 |
6 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 20edd3d32e7..527715cdbd3 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -220,7 +220,7 @@ static int screenshot_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED( return OPERATOR_CANCELLED; } -static int screenshot_check(bContext *UNUSED(C), wmOperator *op) +static bool screenshot_check(bContext *UNUSED(C), wmOperator *op) { ScreenshotData *scd = op->customdata; return WM_operator_filesel_ensure_ext_imtype(op, &scd->im_format); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 8272222e4c2..0a2bd2aad81 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1441,7 +1441,7 @@ static int image_save_as_exec(bContext *C, wmOperator *op) } -static int image_save_as_check(bContext *UNUSED(C), wmOperator *op) +static bool image_save_as_check(bContext *UNUSED(C), wmOperator *op) { ImageFormatData *imf = op->customdata; return WM_operator_filesel_ensure_ext_imtype(op, imf); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 6bf3beec57b..b70ab7c15f2 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -955,7 +955,7 @@ static int operator_execute(bContext *C, wmOperator *op) } /* same as execute() but no return value */ -static int operator_check(bContext *C, wmOperator *op) +static bool operator_check(bContext *C, wmOperator *op) { extern FunctionRNA rna_Operator_check_func; @@ -963,7 +963,7 @@ static int operator_check(bContext *C, wmOperator *op) ParameterList list; FunctionRNA *func; void *ret; - int result; + bool result; RNA_pointer_create(NULL, op->type->ext.srna, op, &opr); func = &rna_Operator_check_func; /* RNA_struct_find_function(&opr, "check"); */ @@ -973,7 +973,7 @@ static int operator_check(bContext *C, wmOperator *op) op->type->ext.call(C, &opr, func, &list); RNA_parameter_get_lookup(&list, "result", &ret); - result = *(int *)ret; + result = (*(int *)ret) != 0; RNA_parameter_list_free(&list); diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 189c30b02e8..01ddbd3995b 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -193,7 +193,7 @@ int WM_enum_search_invoke(struct bContext *C, struct wmOperator *op, const str int WM_operator_confirm (struct bContext *C, struct wmOperator *op, const struct wmEvent *event); /* invoke callback, file selector "filepath" unset + exec */ int WM_operator_filesel (struct bContext *C, struct wmOperator *op, const struct wmEvent *event); -int WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const struct ImageFormatData *im_format); +bool WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const struct ImageFormatData *im_format); /* poll callback, context checks */ int WM_operator_winactive (struct bContext *C); /* invoke callback, exec + redo popup */ diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index cb060077166..cd3899897a1 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -531,7 +531,7 @@ typedef struct wmOperatorType { * is changed. It can correct its own properties or report errors for * invalid settings in exceptional cases. * Boolean return value, True denotes a change has been made and to redraw */ - int (*check)(struct bContext *, struct wmOperator *); + bool (*check)(struct bContext *, struct wmOperator *); /* for modal temporary operators, initially invoke is called. then * any further events are handled in modal. if the operation is diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 3d4bd2a1bc6..d729e15a43d 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1038,7 +1038,7 @@ int WM_operator_filesel(bContext *C, wmOperator *op, const wmEvent *UNUSED(event } } -int WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const struct ImageFormatData *im_format) +bool WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const struct ImageFormatData *im_format) { PropertyRNA *prop; char filepath[FILE_MAX]; @@ -2400,7 +2400,7 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op) } /* function used for WM_OT_save_mainfile too */ -static int blend_save_check(bContext *UNUSED(C), wmOperator *op) +static bool blend_save_check(bContext *UNUSED(C), wmOperator *op) { char filepath[FILE_MAX]; RNA_string_get(op->ptr, "filepath", filepath); |