aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/menu.c b/src/menu.c
index 835267b2f0c..7cc110ce7e2 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -331,7 +331,7 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
331{ 331{
332 Lisp_Object map, item_string, enabled; 332 Lisp_Object map, item_string, enabled;
333 struct gcpro gcpro1, gcpro2; 333 struct gcpro gcpro1, gcpro2;
334 int res; 334 bool res;
335 struct skp *skp = skp_v; 335 struct skp *skp = skp_v;
336 336
337 /* Parse the menu item and leave the result in item_properties. */ 337 /* Parse the menu item and leave the result in item_properties. */
@@ -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. */
522int 522bool
523parse_single_submenu (Lisp_Object item_key, Lisp_Object item_name, Lisp_Object maps) 523parse_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
618widget_value * 619widget_value *
619digest_single_submenu (int start, int end, int top_level_items) 620digest_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. */
961Lisp_Object 962Lisp_Object
962find_and_return_menu_selection (FRAME_PTR f, int keymaps, void *client_data) 963find_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. */