aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-06-19 20:56:28 +0400
committerDmitry Antipov2012-06-19 20:56:28 +0400
commit28be1ada0fb9a4b51cf361dc45208e764bd34143 (patch)
tree30a21470e485d1d9f397d97dcb9a386c578ab746 /src/menu.c
parent68f12411893785de1cfc2c24ec36059e49af5d55 (diff)
downloademacs-28be1ada0fb9a4b51cf361dc45208e764bd34143.tar.gz
emacs-28be1ada0fb9a4b51cf361dc45208e764bd34143.zip
* alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
* font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c: * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct access to `contents' member of Lisp_Vector objects with AREF and ASET where appropriate.
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/menu.c b/src/menu.c
index 9ccfffd768c..ce0c7d6df68 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -197,7 +197,7 @@ static void
197push_submenu_start (void) 197push_submenu_start (void)
198{ 198{
199 ensure_menu_items (1); 199 ensure_menu_items (1);
200 XVECTOR (menu_items)->contents[menu_items_used++] = Qnil; 200 ASET (menu_items, menu_items_used, Qnil), menu_items_used++;
201 menu_items_submenu_depth++; 201 menu_items_submenu_depth++;
202} 202}
203 203
@@ -207,7 +207,7 @@ static void
207push_submenu_end (void) 207push_submenu_end (void)
208{ 208{
209 ensure_menu_items (1); 209 ensure_menu_items (1);
210 XVECTOR (menu_items)->contents[menu_items_used++] = Qlambda; 210 ASET (menu_items, menu_items_used, Qlambda), menu_items_used++;
211 menu_items_submenu_depth--; 211 menu_items_submenu_depth--;
212} 212}
213 213
@@ -219,7 +219,7 @@ static void
219push_left_right_boundary (void) 219push_left_right_boundary (void)
220{ 220{
221 ensure_menu_items (1); 221 ensure_menu_items (1);
222 XVECTOR (menu_items)->contents[menu_items_used++] = Qquote; 222 ASET (menu_items, menu_items_used, Qquote), menu_items_used++;
223} 223}
224 224
225/* Start a new menu pane in menu_items. 225/* Start a new menu pane in menu_items.
@@ -231,9 +231,9 @@ push_menu_pane (Lisp_Object name, Lisp_Object prefix_vec)
231 ensure_menu_items (MENU_ITEMS_PANE_LENGTH); 231 ensure_menu_items (MENU_ITEMS_PANE_LENGTH);
232 if (menu_items_submenu_depth == 0) 232 if (menu_items_submenu_depth == 0)
233 menu_items_n_panes++; 233 menu_items_n_panes++;
234 XVECTOR (menu_items)->contents[menu_items_used++] = Qt; 234 ASET (menu_items, menu_items_used, Qt), menu_items_used++;
235 XVECTOR (menu_items)->contents[menu_items_used++] = name; 235 ASET (menu_items, menu_items_used, name), menu_items_used++;
236 XVECTOR (menu_items)->contents[menu_items_used++] = prefix_vec; 236 ASET (menu_items, menu_items_used, prefix_vec), menu_items_used++;
237} 237}
238 238
239/* Push one menu item into the current pane. NAME is the string to 239/* Push one menu item into the current pane. NAME is the string to
@@ -343,10 +343,10 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
343 if (!res) 343 if (!res)
344 return; /* Not a menu item. */ 344 return; /* Not a menu item. */
345 345
346 map = XVECTOR (item_properties)->contents[ITEM_PROPERTY_MAP]; 346 map = AREF (item_properties, ITEM_PROPERTY_MAP);
347 347
348 enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE]; 348 enabled = AREF (item_properties, ITEM_PROPERTY_ENABLE);
349 item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; 349 item_string = AREF (item_properties, ITEM_PROPERTY_NAME);
350 350
351 if (!NILP (map) && SREF (item_string, 0) == '@') 351 if (!NILP (map) && SREF (item_string, 0) == '@')
352 { 352 {
@@ -363,11 +363,11 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
363 front of them. */ 363 front of them. */
364 { 364 {
365 Lisp_Object prefix = Qnil; 365 Lisp_Object prefix = Qnil;
366 Lisp_Object type = XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE]; 366 Lisp_Object type = AREF (item_properties, ITEM_PROPERTY_TYPE);
367 if (!NILP (type)) 367 if (!NILP (type))
368 { 368 {
369 Lisp_Object selected 369 Lisp_Object selected
370 = XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED]; 370 = AREF (item_properties, ITEM_PROPERTY_SELECTED);
371 371
372 if (skp->notbuttons) 372 if (skp->notbuttons)
373 /* The first button. Line up previous items in this menu. */ 373 /* The first button. Line up previous items in this menu. */
@@ -378,7 +378,7 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
378 while (idx < menu_items_used) 378 while (idx < menu_items_used)
379 { 379 {
380 tem 380 tem
381 = XVECTOR (menu_items)->contents[idx + MENU_ITEMS_ITEM_NAME]; 381 = AREF (menu_items, idx + MENU_ITEMS_ITEM_NAME);
382 if (NILP (tem)) 382 if (NILP (tem))
383 { 383 {
384 idx++; 384 idx++;
@@ -397,8 +397,8 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
397 { 397 {
398 if (!submenu && SREF (tem, 0) != '\0' 398 if (!submenu && SREF (tem, 0) != '\0'
399 && SREF (tem, 0) != '-') 399 && SREF (tem, 0) != '-')
400 XVECTOR (menu_items)->contents[idx + MENU_ITEMS_ITEM_NAME] 400 ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME,
401 = concat2 (build_string (" "), tem); 401 concat2 (build_string (" "), tem));
402 idx += MENU_ITEMS_ITEM_LENGTH; 402 idx += MENU_ITEMS_ITEM_LENGTH;
403 } 403 }
404 } 404 }
@@ -430,11 +430,11 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
430#endif /* HAVE_X_WINDOWS || MSDOS */ 430#endif /* HAVE_X_WINDOWS || MSDOS */
431 431
432 push_menu_item (item_string, enabled, key, 432 push_menu_item (item_string, enabled, key,
433 XVECTOR (item_properties)->contents[ITEM_PROPERTY_DEF], 433 AREF (item_properties, ITEM_PROPERTY_DEF),
434 XVECTOR (item_properties)->contents[ITEM_PROPERTY_KEYEQ], 434 AREF (item_properties, ITEM_PROPERTY_KEYEQ),
435 XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE], 435 AREF (item_properties, ITEM_PROPERTY_TYPE),
436 XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED], 436 AREF (item_properties, ITEM_PROPERTY_SELECTED),
437 XVECTOR (item_properties)->contents[ITEM_PROPERTY_HELP]); 437 AREF (item_properties, ITEM_PROPERTY_HELP));
438 438
439#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS) || defined (HAVE_NTGUI) 439#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS) || defined (HAVE_NTGUI)
440 /* Display a submenu using the toolkit. */ 440 /* Display a submenu using the toolkit. */
@@ -645,27 +645,27 @@ digest_single_submenu (int start, int end, int top_level_items)
645 i = start; 645 i = start;
646 while (i < end) 646 while (i < end)
647 { 647 {
648 if (EQ (XVECTOR (menu_items)->contents[i], Qnil)) 648 if (EQ (AREF (menu_items, i), Qnil))
649 { 649 {
650 submenu_stack[submenu_depth++] = save_wv; 650 submenu_stack[submenu_depth++] = save_wv;
651 save_wv = prev_wv; 651 save_wv = prev_wv;
652 prev_wv = 0; 652 prev_wv = 0;
653 i++; 653 i++;
654 } 654 }
655 else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda)) 655 else if (EQ (AREF (menu_items, i), Qlambda))
656 { 656 {
657 prev_wv = save_wv; 657 prev_wv = save_wv;
658 save_wv = submenu_stack[--submenu_depth]; 658 save_wv = submenu_stack[--submenu_depth];
659 i++; 659 i++;
660 } 660 }
661 else if (EQ (XVECTOR (menu_items)->contents[i], Qt) 661 else if (EQ (AREF (menu_items, i), Qt)
662 && submenu_depth != 0) 662 && submenu_depth != 0)
663 i += MENU_ITEMS_PANE_LENGTH; 663 i += MENU_ITEMS_PANE_LENGTH;
664 /* Ignore a nil in the item list. 664 /* Ignore a nil in the item list.
665 It's meaningful only for dialog boxes. */ 665 It's meaningful only for dialog boxes. */
666 else if (EQ (XVECTOR (menu_items)->contents[i], Qquote)) 666 else if (EQ (AREF (menu_items, i), Qquote))
667 i += 1; 667 i += 1;
668 else if (EQ (XVECTOR (menu_items)->contents[i], Qt)) 668 else if (EQ (AREF (menu_items, i), Qt))
669 { 669 {
670 /* Create a new pane. */ 670 /* Create a new pane. */
671 Lisp_Object pane_name; 671 Lisp_Object pane_name;
@@ -673,7 +673,7 @@ digest_single_submenu (int start, int end, int top_level_items)
673 673
674 panes_seen++; 674 panes_seen++;
675 675
676 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; 676 pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME);
677 677
678#ifdef HAVE_NTGUI 678#ifdef HAVE_NTGUI
679 if (STRINGP (pane_name)) 679 if (STRINGP (pane_name))
@@ -893,25 +893,25 @@ find_and_call_menu_selection (FRAME_PTR f, int menu_bar_items_used, Lisp_Object
893 893
894 while (i < menu_bar_items_used) 894 while (i < menu_bar_items_used)
895 { 895 {
896 if (EQ (XVECTOR (vector)->contents[i], Qnil)) 896 if (EQ (AREF (vector, i), Qnil))
897 { 897 {
898 subprefix_stack[submenu_depth++] = prefix; 898 subprefix_stack[submenu_depth++] = prefix;
899 prefix = entry; 899 prefix = entry;
900 i++; 900 i++;
901 } 901 }
902 else if (EQ (XVECTOR (vector)->contents[i], Qlambda)) 902 else if (EQ (AREF (vector, i), Qlambda))
903 { 903 {
904 prefix = subprefix_stack[--submenu_depth]; 904 prefix = subprefix_stack[--submenu_depth];
905 i++; 905 i++;
906 } 906 }
907 else if (EQ (XVECTOR (vector)->contents[i], Qt)) 907 else if (EQ (AREF (vector, i), Qt))
908 { 908 {
909 prefix = XVECTOR (vector)->contents[i + MENU_ITEMS_PANE_PREFIX]; 909 prefix = AREF (vector, i + MENU_ITEMS_PANE_PREFIX);
910 i += MENU_ITEMS_PANE_LENGTH; 910 i += MENU_ITEMS_PANE_LENGTH;
911 } 911 }
912 else 912 else
913 { 913 {
914 entry = XVECTOR (vector)->contents[i + MENU_ITEMS_ITEM_VALUE]; 914 entry = AREF (vector, i + MENU_ITEMS_ITEM_VALUE);
915 /* Treat the pointer as an integer. There's no problem 915 /* Treat the pointer as an integer. There's no problem
916 as long as pointers have enough bits to hold small integers. */ 916 as long as pointers have enough bits to hold small integers. */
917 if ((intptr_t) client_data == i) 917 if ((intptr_t) client_data == i)
@@ -976,32 +976,32 @@ find_and_return_menu_selection (FRAME_PTR f, int keymaps, void *client_data)
976 976
977 while (i < menu_items_used) 977 while (i < menu_items_used)
978 { 978 {
979 if (EQ (XVECTOR (menu_items)->contents[i], Qnil)) 979 if (EQ (AREF (menu_items, i), Qnil))
980 { 980 {
981 subprefix_stack[submenu_depth++] = prefix; 981 subprefix_stack[submenu_depth++] = prefix;
982 prefix = entry; 982 prefix = entry;
983 i++; 983 i++;
984 } 984 }
985 else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda)) 985 else if (EQ (AREF (menu_items, i), Qlambda))
986 { 986 {
987 prefix = subprefix_stack[--submenu_depth]; 987 prefix = subprefix_stack[--submenu_depth];
988 i++; 988 i++;
989 } 989 }
990 else if (EQ (XVECTOR (menu_items)->contents[i], Qt)) 990 else if (EQ (AREF (menu_items, i), Qt))
991 { 991 {
992 prefix 992 prefix
993 = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; 993 = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
994 i += MENU_ITEMS_PANE_LENGTH; 994 i += MENU_ITEMS_PANE_LENGTH;
995 } 995 }
996 /* Ignore a nil in the item list. 996 /* Ignore a nil in the item list.
997 It's meaningful only for dialog boxes. */ 997 It's meaningful only for dialog boxes. */
998 else if (EQ (XVECTOR (menu_items)->contents[i], Qquote)) 998 else if (EQ (AREF (menu_items, i), Qquote))
999 i += 1; 999 i += 1;
1000 else 1000 else
1001 { 1001 {
1002 entry 1002 entry
1003 = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_VALUE]; 1003 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
1004 if (&XVECTOR (menu_items)->contents[i] == client_data) 1004 if (&AREF (menu_items, i) == client_data)
1005 { 1005 {
1006 if (keymaps != 0) 1006 if (keymaps != 0)
1007 { 1007 {