replace ints with bools for keymap functions.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 27 Sep 2013 14:27:01 +0000 (14:27 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 27 Sep 2013 14:27:01 +0000 (14:27 +0000)
source/blender/windowmanager/WM_keymap.h
source/blender/windowmanager/intern/wm_keymap.c

index 49e9b4fd44569941c2ab41df0865428d258c2aba..121e5e401fac03fcd96af5aa3b4eaf07f1a01b84 100644 (file)
@@ -44,7 +44,7 @@ struct EnumPropertyItem;
 
 wmKeyConfig *WM_keyconfig_new  (struct wmWindowManager *wm, const char *idname);
 wmKeyConfig *WM_keyconfig_new_user(struct wmWindowManager *wm, const char *idname);
-int         WM_keyconfig_remove        (struct wmWindowManager *wm, struct wmKeyConfig *keyconf);
+bool        WM_keyconfig_remove        (struct wmWindowManager *wm, struct wmKeyConfig *keyconf);
 void           WM_keyconfig_free       (struct wmKeyConfig *keyconf);
 
 void           WM_keyconfig_set_active(struct wmWindowManager *wm, const char *idname);
@@ -64,7 +64,7 @@ wmKeyMapItem *WM_keymap_add_item(struct wmKeyMap *keymap, const char *idname, in
 wmKeyMapItem *WM_keymap_add_menu(struct wmKeyMap *keymap, const char *idname, int type,
                                  int val, int modifier, int keymodifier);
 
-int                    WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi);
+bool        WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi);
 int         WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, const int len);
 
 wmKeyMap       *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid);
@@ -72,7 +72,7 @@ wmKeyMap      *WM_keymap_find(struct wmKeyConfig *keyconf, const char *idname, int sp
 wmKeyMap       *WM_keymap_find_all(const struct bContext *C, const char *idname, int spaceid, int regionid);
 wmKeyMap       *WM_keymap_active(struct wmWindowManager *wm, struct wmKeyMap *keymap);
 wmKeyMap       *WM_keymap_guess_opname(const struct bContext *C, const char *opname);
-int                     WM_keymap_remove(struct wmKeyConfig *keyconfig, struct wmKeyMap *keymap);
+bool            WM_keymap_remove(struct wmKeyConfig *keyconfig, struct wmKeyMap *keymap);
 
 wmKeyMapItem *WM_keymap_item_find_id(struct wmKeyMap *keymap, int id);
 int                    WM_keymap_item_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2);
index 1b3ef8902993f17e4554554dd73ae2231a1b10ce..43a98a4600bfeb019472174a23c7324ad25cf864 100644 (file)
@@ -190,7 +190,7 @@ wmKeyConfig *WM_keyconfig_new_user(wmWindowManager *wm, const char *idname)
        return keyconf;
 }
 
-int WM_keyconfig_remove(wmWindowManager *wm, wmKeyConfig *keyconf)
+bool WM_keyconfig_remove(wmWindowManager *wm, wmKeyConfig *keyconf)
 {
        if (BLI_findindex(&wm->keyconfigs, keyconf) != -1) {
                if (strncmp(U.keyconfigstr, keyconf->idname, sizeof(U.keyconfigstr)) == 0) {
@@ -201,10 +201,10 @@ int WM_keyconfig_remove(wmWindowManager *wm, wmKeyConfig *keyconf)
                BLI_remlink(&wm->keyconfigs, keyconf);
                WM_keyconfig_free(keyconf);
 
-               return TRUE;
+               return true;
        }
        else {
-               return FALSE;
+               return false;
        }
 }
 
@@ -299,7 +299,7 @@ void WM_keymap_free(wmKeyMap *keymap)
        BLI_freelistN(&keymap->items);
 }
 
-int WM_keymap_remove(wmKeyConfig *keyconf, wmKeyMap *keymap)
+bool WM_keymap_remove(wmKeyConfig *keyconf, wmKeyMap *keymap)
 {
        if (BLI_findindex(&keyconf->keymaps, keymap) != -1) {
 
@@ -307,10 +307,10 @@ int WM_keymap_remove(wmKeyConfig *keyconf, wmKeyMap *keymap)
                BLI_remlink(&keyconf->keymaps, keymap);
                MEM_freeN(keymap);
 
-               return TRUE;
+               return true;
        }
        else {
-               return FALSE;
+               return false;
        }
 }
 
@@ -390,7 +390,7 @@ wmKeyMapItem *WM_keymap_add_menu(wmKeyMap *keymap, const char *idname, int type,
        return kmi;
 }
 
-int WM_keymap_remove_item(wmKeyMap *keymap, wmKeyMapItem *kmi)
+bool WM_keymap_remove_item(wmKeyMap *keymap, wmKeyMapItem *kmi)
 {
        if (BLI_findindex(&keymap->items, kmi) != -1) {
                if (kmi->ptr) {
@@ -400,10 +400,10 @@ int WM_keymap_remove_item(wmKeyMap *keymap, wmKeyMapItem *kmi)
                BLI_freelinkN(&keymap->items, kmi);
 
                WM_keyconfig_update_tag(keymap, NULL);
-               return TRUE;
+               return true;
        }
        else {
-               return FALSE;
+               return false;
        }
 }