diff options
| author | Paul Eggert | 2012-10-11 09:23:37 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-10-11 09:23:37 -0700 |
| commit | 7cded46f2bef23f86041cc883618ac82b6dbfe61 (patch) | |
| tree | c85855d128fee9247561a6f1395bfec9d8ceaa58 /src/menu.c | |
| parent | 549c3414d97575bfe537d2a4d357d48ea58c980a (diff) | |
| download | emacs-7cded46f2bef23f86041cc883618ac82b6dbfe61.tar.gz emacs-7cded46f2bef23f86041cc883618ac82b6dbfe61.zip | |
lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
* lread.c (load_each_byte, new_backquote_flag, readchar)
(read_filtered_event, lisp_file_lexically_bound_p)
(safe_to_load_version, Fload, complete_filename_p, openp)
(build_load_history, readevalloop, read_escape, read1)
(string_to_number, read_vector, read_list):
* macros.c (Fstart_kbd_macro):
* marker.c (CONSIDER):
* menu.c (parse_single_submenu, digest_single_submenu)
(find_and_return_menu_selection, Fx_popup_menu):
* minibuf.c (read_minibuf_noninteractive, read_minibuf)
(Ftry_completion):
* nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
(ns_menu_show):
* xmenu.c (set_frame_menubar, create_and_show_popup_menu)
(xmenu_show, xdialog_show):
Use bool for booleans.
* lread.c (safe_to_load_version): Rename from safe_to_load_p,
as it's not a predicate. All uses changed. Omit unnecessary
buffer termination.
Diffstat (limited to 'src/menu.c')
| -rw-r--r-- | src/menu.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/menu.c b/src/menu.c index 6e052dc65a9..7cc110ce7e2 100644 --- a/src/menu.c +++ b/src/menu.c | |||
| @@ -519,14 +519,15 @@ list_of_panes (Lisp_Object menu) | |||
| 519 | /* Set up data in menu_items for a menu bar item | 519 | /* Set up data in menu_items for a menu bar item |
| 520 | whose event type is ITEM_KEY (with string ITEM_NAME) | 520 | whose event type is ITEM_KEY (with string ITEM_NAME) |
| 521 | and whose contents come from the list of keymaps MAPS. */ | 521 | and whose contents come from the list of keymaps MAPS. */ |
| 522 | int | 522 | bool |
| 523 | parse_single_submenu (Lisp_Object item_key, Lisp_Object item_name, Lisp_Object maps) | 523 | parse_single_submenu (Lisp_Object item_key, Lisp_Object item_name, |
| 524 | Lisp_Object maps) | ||
| 524 | { | 525 | { |
| 525 | Lisp_Object length; | 526 | Lisp_Object length; |
| 526 | EMACS_INT len; | 527 | EMACS_INT len; |
| 527 | Lisp_Object *mapvec; | 528 | Lisp_Object *mapvec; |
| 528 | ptrdiff_t i; | 529 | ptrdiff_t i; |
| 529 | int top_level_items = 0; | 530 | bool top_level_items = 0; |
| 530 | USE_SAFE_ALLOCA; | 531 | USE_SAFE_ALLOCA; |
| 531 | 532 | ||
| 532 | length = Flength (maps); | 533 | length = Flength (maps); |
| @@ -616,13 +617,13 @@ free_menubar_widget_value_tree (widget_value *wv) | |||
| 616 | in menu_items starting at index START, up to index END. */ | 617 | in menu_items starting at index START, up to index END. */ |
| 617 | 618 | ||
| 618 | widget_value * | 619 | widget_value * |
| 619 | digest_single_submenu (int start, int end, int top_level_items) | 620 | digest_single_submenu (int start, int end, bool top_level_items) |
| 620 | { | 621 | { |
| 621 | widget_value *wv, *prev_wv, *save_wv, *first_wv; | 622 | widget_value *wv, *prev_wv, *save_wv, *first_wv; |
| 622 | int i; | 623 | int i; |
| 623 | int submenu_depth = 0; | 624 | int submenu_depth = 0; |
| 624 | widget_value **submenu_stack; | 625 | widget_value **submenu_stack; |
| 625 | int panes_seen = 0; | 626 | bool panes_seen = 0; |
| 626 | 627 | ||
| 627 | submenu_stack = alloca (menu_items_used * sizeof *submenu_stack); | 628 | submenu_stack = alloca (menu_items_used * sizeof *submenu_stack); |
| 628 | wv = xmalloc_widget_value (); | 629 | wv = xmalloc_widget_value (); |
| @@ -668,7 +669,7 @@ digest_single_submenu (int start, int end, int top_level_items) | |||
| 668 | Lisp_Object pane_name; | 669 | Lisp_Object pane_name; |
| 669 | const char *pane_string; | 670 | const char *pane_string; |
| 670 | 671 | ||
| 671 | panes_seen++; | 672 | panes_seen = 1; |
| 672 | 673 | ||
| 673 | pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); | 674 | pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); |
| 674 | 675 | ||
| @@ -735,7 +736,7 @@ digest_single_submenu (int start, int end, int top_level_items) | |||
| 735 | Lisp_Object help; | 736 | Lisp_Object help; |
| 736 | 737 | ||
| 737 | /* All items should be contained in panes. */ | 738 | /* All items should be contained in panes. */ |
| 738 | if (panes_seen == 0) | 739 | if (! panes_seen) |
| 739 | emacs_abort (); | 740 | emacs_abort (); |
| 740 | 741 | ||
| 741 | item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME); | 742 | item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME); |
| @@ -957,9 +958,9 @@ find_and_call_menu_selection (FRAME_PTR f, int menu_bar_items_used, Lisp_Object | |||
| 957 | 958 | ||
| 958 | #ifdef HAVE_NS | 959 | #ifdef HAVE_NS |
| 959 | /* As above, but return the menu selection instead of storing in kb buffer. | 960 | /* As above, but return the menu selection instead of storing in kb buffer. |
| 960 | If keymaps==1, return full prefixes to selection. */ | 961 | If KEYMAPS, return full prefixes to selection. */ |
| 961 | Lisp_Object | 962 | Lisp_Object |
| 962 | find_and_return_menu_selection (FRAME_PTR f, int keymaps, void *client_data) | 963 | find_and_return_menu_selection (FRAME_PTR f, bool keymaps, void *client_data) |
| 963 | { | 964 | { |
| 964 | Lisp_Object prefix, entry; | 965 | Lisp_Object prefix, entry; |
| 965 | int i; | 966 | int i; |
| @@ -999,7 +1000,7 @@ find_and_return_menu_selection (FRAME_PTR f, int keymaps, void *client_data) | |||
| 999 | = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); | 1000 | = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); |
| 1000 | if (aref_addr (menu_items, i) == client_data) | 1001 | if (aref_addr (menu_items, i) == client_data) |
| 1001 | { | 1002 | { |
| 1002 | if (keymaps != 0) | 1003 | if (keymaps) |
| 1003 | { | 1004 | { |
| 1004 | int j; | 1005 | int j; |
| 1005 | 1006 | ||
| @@ -1071,8 +1072,8 @@ no quit occurs and `x-popup-menu' returns nil. */) | |||
| 1071 | Lisp_Object selection = Qnil; | 1072 | Lisp_Object selection = Qnil; |
| 1072 | FRAME_PTR f = NULL; | 1073 | FRAME_PTR f = NULL; |
| 1073 | Lisp_Object x, y, window; | 1074 | Lisp_Object x, y, window; |
| 1074 | int keymaps = 0; | 1075 | bool keymaps = 0; |
| 1075 | int for_click = 0; | 1076 | bool for_click = 0; |
| 1076 | ptrdiff_t specpdl_count = SPECPDL_INDEX (); | 1077 | ptrdiff_t specpdl_count = SPECPDL_INDEX (); |
| 1077 | struct gcpro gcpro1; | 1078 | struct gcpro gcpro1; |
| 1078 | 1079 | ||
| @@ -1083,7 +1084,7 @@ no quit occurs and `x-popup-menu' returns nil. */) | |||
| 1083 | 1084 | ||
| 1084 | #ifdef HAVE_MENUS | 1085 | #ifdef HAVE_MENUS |
| 1085 | { | 1086 | { |
| 1086 | int get_current_pos_p = 0; | 1087 | bool get_current_pos_p = 0; |
| 1087 | /* FIXME!! check_w32 (); or check_x (); or check_ns (); */ | 1088 | /* FIXME!! check_w32 (); or check_x (); or check_ns (); */ |
| 1088 | 1089 | ||
| 1089 | /* Decode the first argument: find the window and the coordinates. */ | 1090 | /* Decode the first argument: find the window and the coordinates. */ |