diff options
| author | Paul Eggert | 2012-08-01 13:51:44 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-08-01 13:51:44 -0700 |
| commit | 4939150cb43137980c49b318bc70119b9d8ff6f7 (patch) | |
| tree | bcee8eb23f3a6388789bd808a5539dae6e2fc854 /src/lread.c | |
| parent | 947b2afddc9f54a999125aa7e8c9a705ecb51e18 (diff) | |
| download | emacs-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/lread.c')
| -rw-r--r-- | src/lread.c | 10 |
1 files changed, 7 insertions, 3 deletions
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'. */) | |||
| 3715 | SET_SYMBOL_VAL (XSYMBOL (sym), sym); | 3715 | SET_SYMBOL_VAL (XSYMBOL (sym), sym); |
| 3716 | } | 3716 | } |
| 3717 | 3717 | ||
| 3718 | ptr = &AREF (obarray, XINT(tem)); | 3718 | ptr = aref_addr (obarray, XINT(tem)); |
| 3719 | if (SYMBOLP (*ptr)) | 3719 | if (SYMBOLP (*ptr)) |
| 3720 | XSYMBOL (sym)->next = XSYMBOL (*ptr); | 3720 | XSYMBOL (sym)->next = XSYMBOL (*ptr); |
| 3721 | else | 3721 | else |
| @@ -3797,9 +3797,13 @@ OBARRAY defaults to the value of the variable `obarray'. */) | |||
| 3797 | if (EQ (AREF (obarray, hash), tem)) | 3797 | if (EQ (AREF (obarray, hash), tem)) |
| 3798 | { | 3798 | { |
| 3799 | if (XSYMBOL (tem)->next) | 3799 | if (XSYMBOL (tem)->next) |
| 3800 | XSETSYMBOL (AREF (obarray, hash), XSYMBOL (tem)->next); | 3800 | { |
| 3801 | Lisp_Object sym; | ||
| 3802 | XSETSYMBOL (sym, XSYMBOL (tem)->next); | ||
| 3803 | ASET (obarray, hash, sym); | ||
| 3804 | } | ||
| 3801 | else | 3805 | else |
| 3802 | XSETINT (AREF (obarray, hash), 0); | 3806 | ASET (obarray, hash, make_number (0)); |
| 3803 | } | 3807 | } |
| 3804 | else | 3808 | else |
| 3805 | { | 3809 | { |