From 4939150cb43137980c49b318bc70119b9d8ff6f7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 1 Aug 2012 13:51:44 -0700 Subject: Use "ASET (a, i, v)" rather than "AREF (a, i) = v". This how ASET and AREF are supposed to work, and makes it easier to think about future improvements. See . * charset.h (set_charset_attr): New function. All lvalue-style uses of CHARSET_DECODER etc. changed to use it. * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style. (aref_addr): New function. All uses of &AREF(...) changed. (set_hash_key, set_hash_value, set_hash_next, set_hash_hash) (set_hash_index): New functions. All lvalue-style uses of HASH_KEY etc. changed. * keyboard.c (set_prop): New function. All lvalue-style uses of PROP changed. --- src/xmenu.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/xmenu.c') diff --git a/src/xmenu.c b/src/xmenu.c index e68245ba379..e7ed9d69627 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1782,8 +1782,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, /* If this item has a null value, make the call_data null so that it won't display a box when the mouse is on it. */ - wv->call_data - = (!NILP (def) ? (void *) &AREF (menu_items, i) : 0); + wv->call_data = !NILP (def) ? aref_addr (menu_items, i) : 0; wv->enabled = !NILP (enable); if (NILP (type)) @@ -1884,7 +1883,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, { entry = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); - if (menu_item_selection == &AREF (menu_items, i)) + if (menu_item_selection == aref_addr (menu_items, i)) { if (keymaps != 0) { @@ -2104,7 +2103,7 @@ xdialog_show (FRAME_PTR f, if (!NILP (descrip)) wv->key = SSDATA (descrip); wv->value = SSDATA (item_name); - wv->call_data = (void *) &AREF (menu_items, i); + wv->call_data = aref_addr (menu_items, i); wv->enabled = !NILP (enable); wv->help = Qnil; prev_wv = wv; @@ -2187,7 +2186,7 @@ xdialog_show (FRAME_PTR f, { entry = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); - if (menu_item_selection == &AREF (menu_items, i)) + if (menu_item_selection == aref_addr (menu_items, i)) { if (keymaps != 0) { -- cgit v1.2.1