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/lread.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/lread.c') diff --git a/src/lread.c b/src/lread.c index 8a9547ee579..d1549a34264 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3715,7 +3715,7 @@ it defaults to the value of `obarray'. */) SET_SYMBOL_VAL (XSYMBOL (sym), sym); } - ptr = &AREF (obarray, XINT(tem)); + ptr = aref_addr (obarray, XINT(tem)); if (SYMBOLP (*ptr)) XSYMBOL (sym)->next = XSYMBOL (*ptr); else @@ -3797,9 +3797,13 @@ OBARRAY defaults to the value of the variable `obarray'. */) if (EQ (AREF (obarray, hash), tem)) { if (XSYMBOL (tem)->next) - XSETSYMBOL (AREF (obarray, hash), XSYMBOL (tem)->next); + { + Lisp_Object sym; + XSETSYMBOL (sym, XSYMBOL (tem)->next); + ASET (obarray, hash, sym); + } else - XSETINT (AREF (obarray, hash), 0); + ASET (obarray, hash, make_number (0)); } else { -- cgit v1.2.1