aboutsummaryrefslogtreecommitdiffstats
path: root/src/xmenu.c
diff options
context:
space:
mode:
authorPaul Eggert2012-08-01 13:51:44 -0700
committerPaul Eggert2012-08-01 13:51:44 -0700
commit4939150cb43137980c49b318bc70119b9d8ff6f7 (patch)
treebcee8eb23f3a6388789bd808a5539dae6e2fc854 /src/xmenu.c
parent947b2afddc9f54a999125aa7e8c9a705ecb51e18 (diff)
downloademacs-4939150cb43137980c49b318bc70119b9d8ff6f7.tar.gz
emacs-4939150cb43137980c49b318bc70119b9d8ff6f7.zip
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 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>. * 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.
Diffstat (limited to 'src/xmenu.c')
-rw-r--r--src/xmenu.c9
1 files changed, 4 insertions, 5 deletions
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,
1782 /* If this item has a null value, 1782 /* If this item has a null value,
1783 make the call_data null so that it won't display a box 1783 make the call_data null so that it won't display a box
1784 when the mouse is on it. */ 1784 when the mouse is on it. */
1785 wv->call_data 1785 wv->call_data = !NILP (def) ? aref_addr (menu_items, i) : 0;
1786 = (!NILP (def) ? (void *) &AREF (menu_items, i) : 0);
1787 wv->enabled = !NILP (enable); 1786 wv->enabled = !NILP (enable);
1788 1787
1789 if (NILP (type)) 1788 if (NILP (type))
@@ -1884,7 +1883,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
1884 { 1883 {
1885 entry 1884 entry
1886 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); 1885 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
1887 if (menu_item_selection == &AREF (menu_items, i)) 1886 if (menu_item_selection == aref_addr (menu_items, i))
1888 { 1887 {
1889 if (keymaps != 0) 1888 if (keymaps != 0)
1890 { 1889 {
@@ -2104,7 +2103,7 @@ xdialog_show (FRAME_PTR f,
2104 if (!NILP (descrip)) 2103 if (!NILP (descrip))
2105 wv->key = SSDATA (descrip); 2104 wv->key = SSDATA (descrip);
2106 wv->value = SSDATA (item_name); 2105 wv->value = SSDATA (item_name);
2107 wv->call_data = (void *) &AREF (menu_items, i); 2106 wv->call_data = aref_addr (menu_items, i);
2108 wv->enabled = !NILP (enable); 2107 wv->enabled = !NILP (enable);
2109 wv->help = Qnil; 2108 wv->help = Qnil;
2110 prev_wv = wv; 2109 prev_wv = wv;
@@ -2187,7 +2186,7 @@ xdialog_show (FRAME_PTR f,
2187 { 2186 {
2188 entry 2187 entry
2189 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); 2188 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
2190 if (menu_item_selection == &AREF (menu_items, i)) 2189 if (menu_item_selection == aref_addr (menu_items, i))
2191 { 2190 {
2192 if (keymaps != 0) 2191 if (keymaps != 0)
2193 { 2192 {