diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-12 03:46:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-12 03:46:12 +0400 |
commit | 28c20e456ff2c1cc85676e2dbf68d997d630e8a7 (patch) | |
tree | 61c259e59a4c44b9148766f722032f774cc1380c /source/blender/windowmanager | |
parent | 4124e2e0c9d42ec8d84ef06025932abeb333cd65 (diff) |
fix for many RNA definitions having soft/hard ranges swapped, make this BLI_assert() on debug builds.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 12 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index ad828cef6d5..764d274bfba 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -539,7 +539,11 @@ typedef struct wmOperatorType { /* verify if the operator can be executed in the current context, note * that the operator might still fail to execute even if this return true */ - int (*poll)(struct bContext *); + int (*poll)(struct bContext *) +#ifdef __GNUC__ + __attribute__((warn_unused_result)) +#endif + ; /* optional panel for redo and repeat, autogenerated if not set */ void (*ui)(struct bContext *, struct wmOperator *); @@ -563,7 +567,11 @@ typedef struct wmOperatorType { /* only used for operators defined with python * use to store pointers to python functions */ void *pyop_data; - int (*pyop_poll)(struct bContext *, struct wmOperatorType *ot); + int (*pyop_poll)(struct bContext *, struct wmOperatorType *ot) +#ifdef __GNUC__ + __attribute__((warn_unused_result)) +#endif + ; /* RNA integration */ ExtensionRNA ext; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index ec25e8dcffb..19c2a58fdfc 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1233,7 +1233,7 @@ static void WM_OT_debug_menu(wmOperatorType *ot) ot->exec = wm_debug_menu_exec; ot->poll = WM_operator_winactive; - RNA_def_int(ot->srna, "debug_value", 0, -10000, 10000, "Debug Value", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "debug_value", 0, SHRT_MIN, SHRT_MAX, "Debug Value", "", -10000, 10000); } |