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>2021-02-04 13:53:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-02-04 14:21:10 +0300
commit3be5859b21950ed5f5949fce803cf8cbe68dcf99 (patch)
treed17c63c3db09b6e6c6e4574e3b24de51172172a2 /source/blender/makesrna/intern/rna_wm_api.c
parentdff51d418a6499a9e90adc97ab2bb599de36a860 (diff)
Cleanup: pass keymap items as const where possible
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 3ebcb09a65d..5541fe3053f 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -72,6 +72,12 @@ const EnumPropertyItem rna_enum_window_cursor_items[] = {
# include "WM_types.h"
+/* Needed since RNA doesn't use `const` in function signatures. */
+static bool rna_KeyMapItem_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2)
+{
+ return WM_keymap_item_compare(k1, k2);
+}
+
static void rna_KeyMapItem_to_string(wmKeyMapItem *kmi, bool compact, char *result)
{
WM_keymap_item_to_string(kmi, compact, result, UI_MAX_SHORTCUT_STR);
@@ -1103,7 +1109,7 @@ void RNA_api_keymapitem(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func = RNA_def_function(srna, "compare", "WM_keymap_item_compare");
+ func = RNA_def_function(srna, "compare", "rna_KeyMapItem_compare");
parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
parm = RNA_def_boolean(func, "result", 0, "Comparison result", "");