aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/ChangeLog16
-rw-r--r--src/charset.c18
-rw-r--r--src/charset.h7
-rw-r--r--src/coding.c89
-rw-r--r--src/composite.c2
-rw-r--r--src/composite.h5
-rw-r--r--src/fns.c55
-rw-r--r--src/font.c2
-rw-r--r--src/keyboard.c77
-rw-r--r--src/lisp.h40
-rw-r--r--src/lread.c10
-rw-r--r--src/menu.c2
-rw-r--r--src/nsmenu.m7
-rw-r--r--src/w32menu.c2
-rw-r--r--src/xfaces.c110
-rw-r--r--src/xfont.c4
-rw-r--r--src/xmenu.c9
17 files changed, 266 insertions, 189 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5558a5c7c52..3954d489251 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,19 @@
12012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2
3 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4 This how ASET and AREF are supposed to work, and makes
5 it easier to think about future improvements. See
6 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
7 * charset.h (set_charset_attr): New function.
8 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
10 (aref_addr): New function. All uses of &AREF(...) changed.
11 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
12 (set_hash_index): New functions. All lvalue-style uses of
13 HASH_KEY etc. changed.
14 * keyboard.c (set_prop): New function. All lvalue-style uses
15 of PROP changed.
16
12012-08-01 Alp Aker <alp.tekin.aker@gmail.com> 172012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2 18
3 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar) 19 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
diff --git a/src/charset.c b/src/charset.c
index b621109b75d..ec3c522e3dc 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -272,8 +272,8 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries,
272 { 272 {
273 int n = CODE_POINT_TO_INDEX (charset, max_code) + 1; 273 int n = CODE_POINT_TO_INDEX (charset, max_code) + 1;
274 274
275 vec = CHARSET_DECODER (charset) 275 vec = Fmake_vector (make_number (n), make_number (-1));
276 = Fmake_vector (make_number (n), make_number (-1)); 276 set_charset_attr (charset, charset_decoder, vec);
277 } 277 }
278 else 278 else
279 { 279 {
@@ -285,10 +285,10 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries,
285 else 285 else
286 { 286 {
287 table = Fmake_char_table (Qnil, Qnil); 287 table = Fmake_char_table (Qnil, Qnil);
288 if (charset->method == CHARSET_METHOD_MAP) 288 set_charset_attr (charset,
289 CHARSET_ENCODER (charset) = table; 289 (charset->method == CHARSET_METHOD_MAP
290 else 290 ? charset_encoder : charset_deunifier),
291 CHARSET_DEUNIFIER (charset) = table; 291 table);
292 } 292 }
293 } 293 }
294 else 294 else
@@ -1133,7 +1133,7 @@ usage: (define-charset-internal ...) */)
1133 { 1133 {
1134 new_definition_p = 0; 1134 new_definition_p = 0;
1135 id = XFASTINT (CHARSET_SYMBOL_ID (args[charset_arg_name])); 1135 id = XFASTINT (CHARSET_SYMBOL_ID (args[charset_arg_name]));
1136 HASH_VALUE (hash_table, charset.hash_index) = attrs; 1136 set_hash_value (hash_table, charset.hash_index, attrs);
1137 } 1137 }
1138 else 1138 else
1139 { 1139 {
@@ -1336,7 +1336,7 @@ DEFUN ("set-charset-plist", Fset_charset_plist, Sset_charset_plist, 2, 2, 0,
1336 Lisp_Object attrs; 1336 Lisp_Object attrs;
1337 1337
1338 CHECK_CHARSET_GET_ATTR (charset, attrs); 1338 CHECK_CHARSET_GET_ATTR (charset, attrs);
1339 CHARSET_ATTR_PLIST (attrs) = plist; 1339 ASET (attrs, charset_plist, plist);
1340 return plist; 1340 return plist;
1341} 1341}
1342 1342
@@ -1375,7 +1375,7 @@ Optional third argument DEUNIFY, if non-nil, means to de-unify CHARSET. */)
1375 { 1375 {
1376 if (! STRINGP (unify_map) && ! VECTORP (unify_map)) 1376 if (! STRINGP (unify_map) && ! VECTORP (unify_map))
1377 signal_error ("Bad unify-map", unify_map); 1377 signal_error ("Bad unify-map", unify_map);
1378 CHARSET_UNIFY_MAP (cs) = unify_map; 1378 set_charset_attr (cs, charset_unify_map, unify_map);
1379 } 1379 }
1380 if (NILP (Vchar_unify_table)) 1380 if (NILP (Vchar_unify_table))
1381 Vchar_unify_table = Fmake_char_table (Qnil, Qnil); 1381 Vchar_unify_table = Fmake_char_table (Qnil, Qnil);
diff --git a/src/charset.h b/src/charset.h
index 516582a3f3d..40dd012b780 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -325,6 +325,13 @@ extern int emacs_mule_charset[256];
325#define CHARSET_DEUNIFIER(charset) \ 325#define CHARSET_DEUNIFIER(charset) \
326 (CHARSET_ATTR_DEUNIFIER (CHARSET_ATTRIBUTES (charset))) 326 (CHARSET_ATTR_DEUNIFIER (CHARSET_ATTRIBUTES (charset)))
327 327
328static inline void
329set_charset_attr (struct charset *charset, enum charset_attr_index idx,
330 Lisp_Object val)
331{
332 ASET (CHARSET_ATTRIBUTES (charset), idx, val);
333}
334
328 335
329/* Nonzero if OBJ is a valid charset symbol. */ 336/* Nonzero if OBJ is a valid charset symbol. */
330#define CHARSETP(obj) (CHARSET_SYMBOL_HASH_INDEX (obj) >= 0) 337#define CHARSETP(obj) (CHARSET_SYMBOL_HASH_INDEX (obj) >= 0)
diff --git a/src/coding.c b/src/coding.c
index e4ed65079d9..12a7cf93c46 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -2674,8 +2674,8 @@ encode_coding_emacs_mule (struct coding_system *coding)
2674 CODING_GET_INFO (coding, attrs, charset_list); 2674 CODING_GET_INFO (coding, attrs, charset_list);
2675 if (! EQ (charset_list, Vemacs_mule_charset_list)) 2675 if (! EQ (charset_list, Vemacs_mule_charset_list))
2676 { 2676 {
2677 CODING_ATTR_CHARSET_LIST (attrs) 2677 charset_list = Vemacs_mule_charset_list;
2678 = charset_list = Vemacs_mule_charset_list; 2678 ASET (attrs, coding_attr_charset_list, charset_list);
2679 } 2679 }
2680 2680
2681 while (charbuf < charbuf_end) 2681 while (charbuf < charbuf_end)
@@ -2967,8 +2967,8 @@ setup_iso_safe_charsets (Lisp_Object attrs)
2967 if ((flags & CODING_ISO_FLAG_FULL_SUPPORT) 2967 if ((flags & CODING_ISO_FLAG_FULL_SUPPORT)
2968 && ! EQ (charset_list, Viso_2022_charset_list)) 2968 && ! EQ (charset_list, Viso_2022_charset_list))
2969 { 2969 {
2970 CODING_ATTR_CHARSET_LIST (attrs) 2970 charset_list = Viso_2022_charset_list;
2971 = charset_list = Viso_2022_charset_list; 2971 ASET (attrs, coding_attr_charset_list, charset_list);
2972 ASET (attrs, coding_attr_safe_charsets, Qnil); 2972 ASET (attrs, coding_attr_safe_charsets, Qnil);
2973 } 2973 }
2974 2974
@@ -9603,16 +9603,16 @@ usage: (define-coding-system-internal ...) */)
9603 9603
9604 name = args[coding_arg_name]; 9604 name = args[coding_arg_name];
9605 CHECK_SYMBOL (name); 9605 CHECK_SYMBOL (name);
9606 CODING_ATTR_BASE_NAME (attrs) = name; 9606 ASET (attrs, coding_attr_base_name, name);
9607 9607
9608 val = args[coding_arg_mnemonic]; 9608 val = args[coding_arg_mnemonic];
9609 if (! STRINGP (val)) 9609 if (! STRINGP (val))
9610 CHECK_CHARACTER (val); 9610 CHECK_CHARACTER (val);
9611 CODING_ATTR_MNEMONIC (attrs) = val; 9611 ASET (attrs, coding_attr_mnemonic, val);
9612 9612
9613 coding_type = args[coding_arg_coding_type]; 9613 coding_type = args[coding_arg_coding_type];
9614 CHECK_SYMBOL (coding_type); 9614 CHECK_SYMBOL (coding_type);
9615 CODING_ATTR_TYPE (attrs) = coding_type; 9615 ASET (attrs, coding_attr_type, coding_type);
9616 9616
9617 charset_list = args[coding_arg_charset_list]; 9617 charset_list = args[coding_arg_charset_list];
9618 if (SYMBOLP (charset_list)) 9618 if (SYMBOLP (charset_list))
@@ -9659,49 +9659,49 @@ usage: (define-coding-system-internal ...) */)
9659 max_charset_id = charset->id; 9659 max_charset_id = charset->id;
9660 } 9660 }
9661 } 9661 }
9662 CODING_ATTR_CHARSET_LIST (attrs) = charset_list; 9662 ASET (attrs, coding_attr_charset_list, charset_list);
9663 9663
9664 safe_charsets = make_uninit_string (max_charset_id + 1); 9664 safe_charsets = make_uninit_string (max_charset_id + 1);
9665 memset (SDATA (safe_charsets), 255, max_charset_id + 1); 9665 memset (SDATA (safe_charsets), 255, max_charset_id + 1);
9666 for (tail = charset_list; CONSP (tail); tail = XCDR (tail)) 9666 for (tail = charset_list; CONSP (tail); tail = XCDR (tail))
9667 SSET (safe_charsets, XFASTINT (XCAR (tail)), 0); 9667 SSET (safe_charsets, XFASTINT (XCAR (tail)), 0);
9668 CODING_ATTR_SAFE_CHARSETS (attrs) = safe_charsets; 9668 ASET (attrs, coding_attr_safe_charsets, safe_charsets);
9669 9669
9670 CODING_ATTR_ASCII_COMPAT (attrs) = args[coding_arg_ascii_compatible_p]; 9670 ASET (attrs, coding_attr_ascii_compat, args[coding_arg_ascii_compatible_p]);
9671 9671
9672 val = args[coding_arg_decode_translation_table]; 9672 val = args[coding_arg_decode_translation_table];
9673 if (! CHAR_TABLE_P (val) && ! CONSP (val)) 9673 if (! CHAR_TABLE_P (val) && ! CONSP (val))
9674 CHECK_SYMBOL (val); 9674 CHECK_SYMBOL (val);
9675 CODING_ATTR_DECODE_TBL (attrs) = val; 9675 ASET (attrs, coding_attr_decode_tbl, val);
9676 9676
9677 val = args[coding_arg_encode_translation_table]; 9677 val = args[coding_arg_encode_translation_table];
9678 if (! CHAR_TABLE_P (val) && ! CONSP (val)) 9678 if (! CHAR_TABLE_P (val) && ! CONSP (val))
9679 CHECK_SYMBOL (val); 9679 CHECK_SYMBOL (val);
9680 CODING_ATTR_ENCODE_TBL (attrs) = val; 9680 ASET (attrs, coding_attr_encode_tbl, val);
9681 9681
9682 val = args[coding_arg_post_read_conversion]; 9682 val = args[coding_arg_post_read_conversion];
9683 CHECK_SYMBOL (val); 9683 CHECK_SYMBOL (val);
9684 CODING_ATTR_POST_READ (attrs) = val; 9684 ASET (attrs, coding_attr_post_read, val);
9685 9685
9686 val = args[coding_arg_pre_write_conversion]; 9686 val = args[coding_arg_pre_write_conversion];
9687 CHECK_SYMBOL (val); 9687 CHECK_SYMBOL (val);
9688 CODING_ATTR_PRE_WRITE (attrs) = val; 9688 ASET (attrs, coding_attr_pre_write, val);
9689 9689
9690 val = args[coding_arg_default_char]; 9690 val = args[coding_arg_default_char];
9691 if (NILP (val)) 9691 if (NILP (val))
9692 CODING_ATTR_DEFAULT_CHAR (attrs) = make_number (' '); 9692 ASET (attrs, coding_attr_default_char, make_number (' '));
9693 else 9693 else
9694 { 9694 {
9695 CHECK_CHARACTER (val); 9695 CHECK_CHARACTER (val);
9696 CODING_ATTR_DEFAULT_CHAR (attrs) = val; 9696 ASET (attrs, coding_attr_default_char, val);
9697 } 9697 }
9698 9698
9699 val = args[coding_arg_for_unibyte]; 9699 val = args[coding_arg_for_unibyte];
9700 CODING_ATTR_FOR_UNIBYTE (attrs) = NILP (val) ? Qnil : Qt; 9700 ASET (attrs, coding_attr_for_unibyte, NILP (val) ? Qnil : Qt);
9701 9701
9702 val = args[coding_arg_plist]; 9702 val = args[coding_arg_plist];
9703 CHECK_LIST (val); 9703 CHECK_LIST (val);
9704 CODING_ATTR_PLIST (attrs) = val; 9704 ASET (attrs, coding_attr_plist, val);
9705 9705
9706 if (EQ (coding_type, Qcharset)) 9706 if (EQ (coding_type, Qcharset))
9707 { 9707 {
@@ -9726,7 +9726,7 @@ usage: (define-coding-system-internal ...) */)
9726 int idx = (dim - 1) * 4; 9726 int idx = (dim - 1) * 4;
9727 9727
9728 if (CHARSET_ASCII_COMPATIBLE_P (charset)) 9728 if (CHARSET_ASCII_COMPATIBLE_P (charset))
9729 CODING_ATTR_ASCII_COMPAT (attrs) = Qt; 9729 ASET (attrs, coding_attr_ascii_compat, Qt);
9730 9730
9731 for (i = charset->code_space[idx]; 9731 for (i = charset->code_space[idx];
9732 i <= charset->code_space[idx + 1]; i++) 9732 i <= charset->code_space[idx + 1]; i++)
@@ -9824,7 +9824,7 @@ usage: (define-coding-system-internal ...) */)
9824 { 9824 {
9825 Lisp_Object bom, endian; 9825 Lisp_Object bom, endian;
9826 9826
9827 CODING_ATTR_ASCII_COMPAT (attrs) = Qnil; 9827 ASET (attrs, coding_attr_ascii_compat, Qnil);
9828 9828
9829 if (nargs < coding_arg_utf16_max) 9829 if (nargs < coding_arg_utf16_max)
9830 goto short_args; 9830 goto short_args;
@@ -9877,7 +9877,7 @@ usage: (define-coding-system-internal ...) */)
9877 CHECK_CHARSET_GET_CHARSET (val, charset); 9877 CHECK_CHARSET_GET_CHARSET (val, charset);
9878 ASET (initial, i, make_number (CHARSET_ID (charset))); 9878 ASET (initial, i, make_number (CHARSET_ID (charset)));
9879 if (i == 0 && CHARSET_ASCII_COMPATIBLE_P (charset)) 9879 if (i == 0 && CHARSET_ASCII_COMPATIBLE_P (charset))
9880 CODING_ATTR_ASCII_COMPAT (attrs) = Qt; 9880 ASET (attrs, coding_attr_ascii_compat, Qt);
9881 } 9881 }
9882 else 9882 else
9883 ASET (initial, i, make_number (-1)); 9883 ASET (initial, i, make_number (-1));
@@ -9938,13 +9938,13 @@ usage: (define-coding-system-internal ...) */)
9938 } 9938 }
9939 if (category != coding_category_iso_8_1 9939 if (category != coding_category_iso_8_1
9940 && category != coding_category_iso_8_2) 9940 && category != coding_category_iso_8_2)
9941 CODING_ATTR_ASCII_COMPAT (attrs) = Qnil; 9941 ASET (attrs, coding_attr_ascii_compat, Qnil);
9942 } 9942 }
9943 else if (EQ (coding_type, Qemacs_mule)) 9943 else if (EQ (coding_type, Qemacs_mule))
9944 { 9944 {
9945 if (EQ (args[coding_arg_charset_list], Qemacs_mule)) 9945 if (EQ (args[coding_arg_charset_list], Qemacs_mule))
9946 ASET (attrs, coding_attr_emacs_mule_full, Qt); 9946 ASET (attrs, coding_attr_emacs_mule_full, Qt);
9947 CODING_ATTR_ASCII_COMPAT (attrs) = Qt; 9947 ASET (attrs, coding_attr_ascii_compat, Qt);
9948 category = coding_category_emacs_mule; 9948 category = coding_category_emacs_mule;
9949 } 9949 }
9950 else if (EQ (coding_type, Qshift_jis)) 9950 else if (EQ (coding_type, Qshift_jis))
@@ -9961,7 +9961,7 @@ usage: (define-coding-system-internal ...) */)
9961 error ("Dimension of charset %s is not one", 9961 error ("Dimension of charset %s is not one",
9962 SDATA (SYMBOL_NAME (CHARSET_NAME (charset)))); 9962 SDATA (SYMBOL_NAME (CHARSET_NAME (charset))));
9963 if (CHARSET_ASCII_COMPATIBLE_P (charset)) 9963 if (CHARSET_ASCII_COMPATIBLE_P (charset))
9964 CODING_ATTR_ASCII_COMPAT (attrs) = Qt; 9964 ASET (attrs, coding_attr_ascii_compat, Qt);
9965 9965
9966 charset_list = XCDR (charset_list); 9966 charset_list = XCDR (charset_list);
9967 charset = CHARSET_FROM_ID (XINT (XCAR (charset_list))); 9967 charset = CHARSET_FROM_ID (XINT (XCAR (charset_list)));
@@ -9999,7 +9999,7 @@ usage: (define-coding-system-internal ...) */)
9999 error ("Dimension of charset %s is not one", 9999 error ("Dimension of charset %s is not one",
10000 SDATA (SYMBOL_NAME (CHARSET_NAME (charset)))); 10000 SDATA (SYMBOL_NAME (CHARSET_NAME (charset))));
10001 if (CHARSET_ASCII_COMPATIBLE_P (charset)) 10001 if (CHARSET_ASCII_COMPATIBLE_P (charset))
10002 CODING_ATTR_ASCII_COMPAT (attrs) = Qt; 10002 ASET (attrs, coding_attr_ascii_compat, Qt);
10003 10003
10004 charset_list = XCDR (charset_list); 10004 charset_list = XCDR (charset_list);
10005 charset = CHARSET_FROM_ID (XINT (XCAR (charset_list))); 10005 charset = CHARSET_FROM_ID (XINT (XCAR (charset_list)));
@@ -10013,7 +10013,7 @@ usage: (define-coding-system-internal ...) */)
10013 else if (EQ (coding_type, Qraw_text)) 10013 else if (EQ (coding_type, Qraw_text))
10014 { 10014 {
10015 category = coding_category_raw_text; 10015 category = coding_category_raw_text;
10016 CODING_ATTR_ASCII_COMPAT (attrs) = Qt; 10016 ASET (attrs, coding_attr_ascii_compat, Qt);
10017 } 10017 }
10018 else if (EQ (coding_type, Qutf_8)) 10018 else if (EQ (coding_type, Qutf_8))
10019 { 10019 {
@@ -10033,7 +10033,7 @@ usage: (define-coding-system-internal ...) */)
10033 } 10033 }
10034 ASET (attrs, coding_attr_utf_bom, bom); 10034 ASET (attrs, coding_attr_utf_bom, bom);
10035 if (NILP (bom)) 10035 if (NILP (bom))
10036 CODING_ATTR_ASCII_COMPAT (attrs) = Qt; 10036 ASET (attrs, coding_attr_ascii_compat, Qt);
10037 10037
10038 category = (CONSP (bom) ? coding_category_utf_8_auto 10038 category = (CONSP (bom) ? coding_category_utf_8_auto
10039 : NILP (bom) ? coding_category_utf_8_nosig 10039 : NILP (bom) ? coding_category_utf_8_nosig
@@ -10045,14 +10045,15 @@ usage: (define-coding-system-internal ...) */)
10045 error ("Invalid coding system type: %s", 10045 error ("Invalid coding system type: %s",
10046 SDATA (SYMBOL_NAME (coding_type))); 10046 SDATA (SYMBOL_NAME (coding_type)));
10047 10047
10048 CODING_ATTR_CATEGORY (attrs) = make_number (category); 10048 ASET (attrs, coding_attr_category, make_number (category));
10049 CODING_ATTR_PLIST (attrs) 10049 ASET (attrs, coding_attr_plist,
10050 = Fcons (QCcategory, Fcons (AREF (Vcoding_category_table, category), 10050 Fcons (QCcategory,
10051 CODING_ATTR_PLIST (attrs))); 10051 Fcons (AREF (Vcoding_category_table, category),
10052 CODING_ATTR_PLIST (attrs) 10052 CODING_ATTR_PLIST (attrs))));
10053 = Fcons (QCascii_compatible_p, 10053 ASET (attrs, coding_attr_plist,
10054 Fcons (CODING_ATTR_ASCII_COMPAT (attrs), 10054 Fcons (QCascii_compatible_p,
10055 CODING_ATTR_PLIST (attrs))); 10055 Fcons (CODING_ATTR_ASCII_COMPAT (attrs),
10056 CODING_ATTR_PLIST (attrs))));
10056 10057
10057 eol_type = args[coding_arg_eol_type]; 10058 eol_type = args[coding_arg_eol_type];
10058 if (! NILP (eol_type) 10059 if (! NILP (eol_type)
@@ -10126,7 +10127,7 @@ DEFUN ("coding-system-put", Fcoding_system_put, Scoding_system_put,
10126 { 10127 {
10127 if (! STRINGP (val)) 10128 if (! STRINGP (val))
10128 CHECK_CHARACTER (val); 10129 CHECK_CHARACTER (val);
10129 CODING_ATTR_MNEMONIC (attrs) = val; 10130 ASET (attrs, coding_attr_mnemonic, val);
10130 } 10131 }
10131 else if (EQ (prop, QCdefault_char)) 10132 else if (EQ (prop, QCdefault_char))
10132 { 10133 {
@@ -10134,37 +10135,37 @@ DEFUN ("coding-system-put", Fcoding_system_put, Scoding_system_put,
10134 val = make_number (' '); 10135 val = make_number (' ');
10135 else 10136 else
10136 CHECK_CHARACTER (val); 10137 CHECK_CHARACTER (val);
10137 CODING_ATTR_DEFAULT_CHAR (attrs) = val; 10138 ASET (attrs, coding_attr_default_char, val);
10138 } 10139 }
10139 else if (EQ (prop, QCdecode_translation_table)) 10140 else if (EQ (prop, QCdecode_translation_table))
10140 { 10141 {
10141 if (! CHAR_TABLE_P (val) && ! CONSP (val)) 10142 if (! CHAR_TABLE_P (val) && ! CONSP (val))
10142 CHECK_SYMBOL (val); 10143 CHECK_SYMBOL (val);
10143 CODING_ATTR_DECODE_TBL (attrs) = val; 10144 ASET (attrs, coding_attr_decode_tbl, val);
10144 } 10145 }
10145 else if (EQ (prop, QCencode_translation_table)) 10146 else if (EQ (prop, QCencode_translation_table))
10146 { 10147 {
10147 if (! CHAR_TABLE_P (val) && ! CONSP (val)) 10148 if (! CHAR_TABLE_P (val) && ! CONSP (val))
10148 CHECK_SYMBOL (val); 10149 CHECK_SYMBOL (val);
10149 CODING_ATTR_ENCODE_TBL (attrs) = val; 10150 ASET (attrs, coding_attr_encode_tbl, val);
10150 } 10151 }
10151 else if (EQ (prop, QCpost_read_conversion)) 10152 else if (EQ (prop, QCpost_read_conversion))
10152 { 10153 {
10153 CHECK_SYMBOL (val); 10154 CHECK_SYMBOL (val);
10154 CODING_ATTR_POST_READ (attrs) = val; 10155 ASET (attrs, coding_attr_post_read, val);
10155 } 10156 }
10156 else if (EQ (prop, QCpre_write_conversion)) 10157 else if (EQ (prop, QCpre_write_conversion))
10157 { 10158 {
10158 CHECK_SYMBOL (val); 10159 CHECK_SYMBOL (val);
10159 CODING_ATTR_PRE_WRITE (attrs) = val; 10160 ASET (attrs, coding_attr_pre_write, val);
10160 } 10161 }
10161 else if (EQ (prop, QCascii_compatible_p)) 10162 else if (EQ (prop, QCascii_compatible_p))
10162 { 10163 {
10163 CODING_ATTR_ASCII_COMPAT (attrs) = val; 10164 ASET (attrs, coding_attr_ascii_compat, val);
10164 } 10165 }
10165 10166
10166 CODING_ATTR_PLIST (attrs) 10167 ASET (attrs, coding_attr_plist,
10167 = Fplist_put (CODING_ATTR_PLIST (attrs), prop, val); 10168 Fplist_put (CODING_ATTR_PLIST (attrs), prop, val));
10168 return val; 10169 return val;
10169} 10170}
10170 10171
diff --git a/src/composite.c b/src/composite.c
index 485e51467ca..f5e9d2f9fdd 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -762,7 +762,7 @@ composition_gstring_width (Lisp_Object gstring, ptrdiff_t from, ptrdiff_t to,
762 } 762 }
763 metrics->width = metrics->lbearing = metrics->rbearing = 0; 763 metrics->width = metrics->lbearing = metrics->rbearing = 0;
764 } 764 }
765 for (glyph = &LGSTRING_GLYPH (gstring, from); from < to; from++, glyph++) 765 for (glyph = lgstring_glyph_addr (gstring, from); from < to; from++, glyph++)
766 { 766 {
767 int x; 767 int x;
768 768
diff --git a/src/composite.h b/src/composite.h
index 845411f5cde..18edc66b1b0 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -247,6 +247,11 @@ extern void compose_text (ptrdiff_t, ptrdiff_t, Lisp_Object, Lisp_Object,
247#define LGSTRING_GLYPH_LEN(lgs) (ASIZE ((lgs)) - 2) 247#define LGSTRING_GLYPH_LEN(lgs) (ASIZE ((lgs)) - 2)
248#define LGSTRING_GLYPH(lgs, idx) AREF ((lgs), (idx) + 2) 248#define LGSTRING_GLYPH(lgs, idx) AREF ((lgs), (idx) + 2)
249#define LGSTRING_SET_GLYPH(lgs, idx, val) ASET ((lgs), (idx) + 2, (val)) 249#define LGSTRING_SET_GLYPH(lgs, idx, val) ASET ((lgs), (idx) + 2, (val))
250static inline Lisp_Object *
251lgstring_glyph_addr (Lisp_Object lgs, ptrdiff_t idx)
252{
253 return aref_addr (lgs, idx + 2);
254}
250 255
251/* Vector size of Lispy glyph. */ 256/* Vector size of Lispy glyph. */
252enum lglyph_indices 257enum lglyph_indices
diff --git a/src/fns.c b/src/fns.c
index a8c8cb283b0..727424b705b 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1192,7 +1192,7 @@ value is a new vector that contains the elements between index FROM
1192 string, make_number (0), res, Qnil); 1192 string, make_number (0), res, Qnil);
1193 } 1193 }
1194 else 1194 else
1195 res = Fvector (to_char - from_char, &AREF (string, from_char)); 1195 res = Fvector (to_char - from_char, aref_addr (string, from_char));
1196 1196
1197 return res; 1197 return res;
1198} 1198}
@@ -1274,7 +1274,7 @@ substring_both (Lisp_Object string, ptrdiff_t from, ptrdiff_t from_byte,
1274 string, make_number (0), res, Qnil); 1274 string, make_number (0), res, Qnil);
1275 } 1275 }
1276 else 1276 else
1277 res = Fvector (to - from, &AREF (string, from)); 1277 res = Fvector (to - from, aref_addr (string, from));
1278 1278
1279 return res; 1279 return res;
1280} 1280}
@@ -3663,7 +3663,7 @@ make_hash_table (Lisp_Object test, Lisp_Object size, Lisp_Object rehash_size,
3663 3663
3664 /* Set up the free list. */ 3664 /* Set up the free list. */
3665 for (i = 0; i < sz - 1; ++i) 3665 for (i = 0; i < sz - 1; ++i)
3666 HASH_NEXT (h, i) = make_number (i + 1); 3666 set_hash_next (h, i, make_number (i + 1));
3667 h->next_free = make_number (0); 3667 h->next_free = make_number (0);
3668 3668
3669 XSET_HASH_TABLE (table, h); 3669 XSET_HASH_TABLE (table, h);
@@ -3770,7 +3770,7 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
3770 the end of the free list. This makes some operations like 3770 the end of the free list. This makes some operations like
3771 maphash faster. */ 3771 maphash faster. */
3772 for (i = old_size; i < new_size - 1; ++i) 3772 for (i = old_size; i < new_size - 1; ++i)
3773 HASH_NEXT (h, i) = make_number (i + 1); 3773 set_hash_next (h, i, make_number (i + 1));
3774 3774
3775 if (!NILP (h->next_free)) 3775 if (!NILP (h->next_free))
3776 { 3776 {
@@ -3781,7 +3781,7 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
3781 !NILP (next)) 3781 !NILP (next))
3782 last = next; 3782 last = next;
3783 3783
3784 HASH_NEXT (h, XFASTINT (last)) = make_number (old_size); 3784 set_hash_next (h, XFASTINT (last), make_number (old_size));
3785 } 3785 }
3786 else 3786 else
3787 XSETFASTINT (h->next_free, old_size); 3787 XSETFASTINT (h->next_free, old_size);
@@ -3792,8 +3792,8 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
3792 { 3792 {
3793 EMACS_UINT hash_code = XUINT (HASH_HASH (h, i)); 3793 EMACS_UINT hash_code = XUINT (HASH_HASH (h, i));
3794 ptrdiff_t start_of_bucket = hash_code % ASIZE (h->index); 3794 ptrdiff_t start_of_bucket = hash_code % ASIZE (h->index);
3795 HASH_NEXT (h, i) = HASH_INDEX (h, start_of_bucket); 3795 set_hash_next (h, i, HASH_INDEX (h, start_of_bucket));
3796 HASH_INDEX (h, start_of_bucket) = make_number (i); 3796 set_hash_index (h, start_of_bucket, make_number (i));
3797 } 3797 }
3798 } 3798 }
3799} 3799}
@@ -3852,16 +3852,16 @@ hash_put (struct Lisp_Hash_Table *h, Lisp_Object key, Lisp_Object value,
3852 /* Store key/value in the key_and_value vector. */ 3852 /* Store key/value in the key_and_value vector. */
3853 i = XFASTINT (h->next_free); 3853 i = XFASTINT (h->next_free);
3854 h->next_free = HASH_NEXT (h, i); 3854 h->next_free = HASH_NEXT (h, i);
3855 HASH_KEY (h, i) = key; 3855 set_hash_key (h, i, key);
3856 HASH_VALUE (h, i) = value; 3856 set_hash_value (h, i, value);
3857 3857
3858 /* Remember its hash code. */ 3858 /* Remember its hash code. */
3859 HASH_HASH (h, i) = make_number (hash); 3859 set_hash_hash (h, i, make_number (hash));
3860 3860
3861 /* Add new entry to its collision chain. */ 3861 /* Add new entry to its collision chain. */
3862 start_of_bucket = hash % ASIZE (h->index); 3862 start_of_bucket = hash % ASIZE (h->index);
3863 HASH_NEXT (h, i) = HASH_INDEX (h, start_of_bucket); 3863 set_hash_next (h, i, HASH_INDEX (h, start_of_bucket));
3864 HASH_INDEX (h, start_of_bucket) = make_number (i); 3864 set_hash_index (h, start_of_bucket, make_number (i));
3865 return i; 3865 return i;
3866} 3866}
3867 3867
@@ -3892,14 +3892,16 @@ hash_remove_from_table (struct Lisp_Hash_Table *h, Lisp_Object key)
3892 { 3892 {
3893 /* Take entry out of collision chain. */ 3893 /* Take entry out of collision chain. */
3894 if (NILP (prev)) 3894 if (NILP (prev))
3895 HASH_INDEX (h, start_of_bucket) = HASH_NEXT (h, i); 3895 set_hash_index (h, start_of_bucket, HASH_NEXT (h, i));
3896 else 3896 else
3897 HASH_NEXT (h, XFASTINT (prev)) = HASH_NEXT (h, i); 3897 set_hash_next (h, XFASTINT (prev), HASH_NEXT (h, i));
3898 3898
3899 /* Clear slots in key_and_value and add the slots to 3899 /* Clear slots in key_and_value and add the slots to
3900 the free list. */ 3900 the free list. */
3901 HASH_KEY (h, i) = HASH_VALUE (h, i) = HASH_HASH (h, i) = Qnil; 3901 set_hash_key (h, i, Qnil);
3902 HASH_NEXT (h, i) = h->next_free; 3902 set_hash_value (h, i, Qnil);
3903 set_hash_hash (h, i, Qnil);
3904 set_hash_next (h, i, h->next_free);
3903 h->next_free = make_number (i); 3905 h->next_free = make_number (i);
3904 h->count--; 3906 h->count--;
3905 eassert (h->count >= 0); 3907 eassert (h->count >= 0);
@@ -3925,10 +3927,10 @@ hash_clear (struct Lisp_Hash_Table *h)
3925 3927
3926 for (i = 0; i < size; ++i) 3928 for (i = 0; i < size; ++i)
3927 { 3929 {
3928 HASH_NEXT (h, i) = i < size - 1 ? make_number (i + 1) : Qnil; 3930 set_hash_next (h, i, i < size - 1 ? make_number (i + 1) : Qnil);
3929 HASH_KEY (h, i) = Qnil; 3931 set_hash_key (h, i, Qnil);
3930 HASH_VALUE (h, i) = Qnil; 3932 set_hash_value (h, i, Qnil);
3931 HASH_HASH (h, i) = Qnil; 3933 set_hash_hash (h, i, Qnil);
3932 } 3934 }
3933 3935
3934 for (i = 0; i < ASIZE (h->index); ++i) 3936 for (i = 0; i < ASIZE (h->index); ++i)
@@ -3992,17 +3994,18 @@ sweep_weak_table (struct Lisp_Hash_Table *h, int remove_entries_p)
3992 { 3994 {
3993 /* Take out of collision chain. */ 3995 /* Take out of collision chain. */
3994 if (NILP (prev)) 3996 if (NILP (prev))
3995 HASH_INDEX (h, bucket) = next; 3997 set_hash_index (h, bucket, next);
3996 else 3998 else
3997 HASH_NEXT (h, XFASTINT (prev)) = next; 3999 set_hash_next (h, XFASTINT (prev), next);
3998 4000
3999 /* Add to free list. */ 4001 /* Add to free list. */
4000 HASH_NEXT (h, i) = h->next_free; 4002 set_hash_next (h, i, h->next_free);
4001 h->next_free = idx; 4003 h->next_free = idx;
4002 4004
4003 /* Clear key, value, and hash. */ 4005 /* Clear key, value, and hash. */
4004 HASH_KEY (h, i) = HASH_VALUE (h, i) = Qnil; 4006 set_hash_key (h, i, Qnil);
4005 HASH_HASH (h, i) = Qnil; 4007 set_hash_value (h, i, Qnil);
4008 set_hash_hash (h, i, Qnil);
4006 4009
4007 h->count--; 4010 h->count--;
4008 } 4011 }
@@ -4509,7 +4512,7 @@ VALUE. In any case, return VALUE. */)
4509 4512
4510 i = hash_lookup (h, key, &hash); 4513 i = hash_lookup (h, key, &hash);
4511 if (i >= 0) 4514 if (i >= 0)
4512 HASH_VALUE (h, i) = value; 4515 set_hash_value (h, i, value);
4513 else 4516 else
4514 hash_put (h, key, value, hash); 4517 hash_put (h, key, value, hash);
4515 4518
diff --git a/src/font.c b/src/font.c
index db454dd6a23..b5e384140d8 100644
--- a/src/font.c
+++ b/src/font.c
@@ -4722,7 +4722,7 @@ the corresponding element is nil. */)
4722 Lisp_Object elt = AREF (object, XFASTINT (from) + i); 4722 Lisp_Object elt = AREF (object, XFASTINT (from) + i);
4723 CHECK_CHARACTER (elt); 4723 CHECK_CHARACTER (elt);
4724 } 4724 }
4725 chars = &(AREF (object, XFASTINT (from))); 4725 chars = aref_addr (object, XFASTINT (from));
4726 } 4726 }
4727 4727
4728 vec = Fmake_vector (make_number (len), Qnil); 4728 vec = Fmake_vector (make_number (len), Qnil);
diff --git a/src/keyboard.c b/src/keyboard.c
index d14d5106306..663a3956bf1 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -5551,7 +5551,7 @@ make_lispy_event (struct input_event *event)
5551 mouse_syms = larger_vector (mouse_syms, incr, -1); 5551 mouse_syms = larger_vector (mouse_syms, incr, -1);
5552 } 5552 }
5553 5553
5554 start_pos_ptr = &AREF (button_down_location, button); 5554 start_pos_ptr = aref_addr (button_down_location, button);
5555 start_pos = *start_pos_ptr; 5555 start_pos = *start_pos_ptr;
5556 *start_pos_ptr = Qnil; 5556 *start_pos_ptr = Qnil;
5557 5557
@@ -5959,7 +5959,7 @@ make_lispy_event (struct input_event *event)
5959 mouse_syms = larger_vector (mouse_syms, incr, -1); 5959 mouse_syms = larger_vector (mouse_syms, incr, -1);
5960 } 5960 }
5961 5961
5962 start_pos_ptr = &AREF (button_down_location, button); 5962 start_pos_ptr = aref_addr (button_down_location, button);
5963 start_pos = *start_pos_ptr; 5963 start_pos = *start_pos_ptr;
5964 5964
5965 position = make_lispy_position (f, event->x, event->y, 5965 position = make_lispy_position (f, event->x, event->y,
@@ -7525,8 +7525,8 @@ menu_bar_items (Lisp_Object old)
7525 tem2 = AREF (menu_bar_items_vector, i + 2); 7525 tem2 = AREF (menu_bar_items_vector, i + 2);
7526 tem3 = AREF (menu_bar_items_vector, i + 3); 7526 tem3 = AREF (menu_bar_items_vector, i + 3);
7527 if (end > i + 4) 7527 if (end > i + 4)
7528 memmove (&AREF (menu_bar_items_vector, i), 7528 memmove (aref_addr (menu_bar_items_vector, i),
7529 &AREF (menu_bar_items_vector, i + 4), 7529 aref_addr (menu_bar_items_vector, i + 4),
7530 (end - i - 4) * sizeof (Lisp_Object)); 7530 (end - i - 4) * sizeof (Lisp_Object));
7531 ASET (menu_bar_items_vector, end - 4, tem0); 7531 ASET (menu_bar_items_vector, end - 4, tem0);
7532 ASET (menu_bar_items_vector, end - 3, tem1); 7532 ASET (menu_bar_items_vector, end - 3, tem1);
@@ -7575,8 +7575,8 @@ menu_bar_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy1, void *dumm
7575 if (EQ (key, AREF (menu_bar_items_vector, i))) 7575 if (EQ (key, AREF (menu_bar_items_vector, i)))
7576 { 7576 {
7577 if (menu_bar_items_index > i + 4) 7577 if (menu_bar_items_index > i + 4)
7578 memmove (&AREF (menu_bar_items_vector, i), 7578 memmove (aref_addr (menu_bar_items_vector, i),
7579 &AREF (menu_bar_items_vector, i + 4), 7579 aref_addr (menu_bar_items_vector, i + 4),
7580 (menu_bar_items_index - i - 4) * sizeof (Lisp_Object)); 7580 (menu_bar_items_index - i - 4) * sizeof (Lisp_Object));
7581 menu_bar_items_index -= 4; 7581 menu_bar_items_index -= 4;
7582 } 7582 }
@@ -8096,6 +8096,14 @@ process_tool_bar_item (Lisp_Object key, Lisp_Object def, Lisp_Object data, void
8096 UNGCPRO; 8096 UNGCPRO;
8097} 8097}
8098 8098
8099/* Access slot with index IDX of vector tool_bar_item_properties. */
8100#define PROP(IDX) AREF (tool_bar_item_properties, (IDX))
8101static inline void
8102set_prop (ptrdiff_t idx, Lisp_Object val)
8103{
8104 ASET (tool_bar_item_properties, idx, val);
8105}
8106
8099 8107
8100/* Parse a tool bar item specification ITEM for key KEY and return the 8108/* Parse a tool bar item specification ITEM for key KEY and return the
8101 result in tool_bar_item_properties. Value is zero if ITEM is 8109 result in tool_bar_item_properties. Value is zero if ITEM is
@@ -8146,9 +8154,6 @@ process_tool_bar_item (Lisp_Object key, Lisp_Object def, Lisp_Object data, void
8146static int 8154static int
8147parse_tool_bar_item (Lisp_Object key, Lisp_Object item) 8155parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8148{ 8156{
8149 /* Access slot with index IDX of vector tool_bar_item_properties. */
8150#define PROP(IDX) AREF (tool_bar_item_properties, (IDX))
8151
8152 Lisp_Object filter = Qnil; 8157 Lisp_Object filter = Qnil;
8153 Lisp_Object caption; 8158 Lisp_Object caption;
8154 int i, have_label = 0; 8159 int i, have_label = 0;
@@ -8172,15 +8177,15 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8172 if (VECTORP (tool_bar_item_properties)) 8177 if (VECTORP (tool_bar_item_properties))
8173 { 8178 {
8174 for (i = 0; i < TOOL_BAR_ITEM_NSLOTS; ++i) 8179 for (i = 0; i < TOOL_BAR_ITEM_NSLOTS; ++i)
8175 PROP (i) = Qnil; 8180 set_prop (i, Qnil);
8176 } 8181 }
8177 else 8182 else
8178 tool_bar_item_properties 8183 tool_bar_item_properties
8179 = Fmake_vector (make_number (TOOL_BAR_ITEM_NSLOTS), Qnil); 8184 = Fmake_vector (make_number (TOOL_BAR_ITEM_NSLOTS), Qnil);
8180 8185
8181 /* Set defaults. */ 8186 /* Set defaults. */
8182 PROP (TOOL_BAR_ITEM_KEY) = key; 8187 set_prop (TOOL_BAR_ITEM_KEY, key);
8183 PROP (TOOL_BAR_ITEM_ENABLED_P) = Qt; 8188 set_prop (TOOL_BAR_ITEM_ENABLED_P, Qt);
8184 8189
8185 /* Get the caption of the item. If the caption is not a string, 8190 /* Get the caption of the item. If the caption is not a string,
8186 evaluate it to get a string. If we don't get a string, skip this 8191 evaluate it to get a string. If we don't get a string, skip this
@@ -8192,7 +8197,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8192 if (!STRINGP (caption)) 8197 if (!STRINGP (caption))
8193 return 0; 8198 return 0;
8194 } 8199 }
8195 PROP (TOOL_BAR_ITEM_CAPTION) = caption; 8200 set_prop (TOOL_BAR_ITEM_CAPTION, caption);
8196 8201
8197 /* If the rest following the caption is not a list, the menu item is 8202 /* If the rest following the caption is not a list, the menu item is
8198 either a separator, or invalid. */ 8203 either a separator, or invalid. */
@@ -8201,7 +8206,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8201 { 8206 {
8202 if (menu_separator_name_p (SSDATA (caption))) 8207 if (menu_separator_name_p (SSDATA (caption)))
8203 { 8208 {
8204 PROP (TOOL_BAR_ITEM_TYPE) = Qt; 8209 set_prop (TOOL_BAR_ITEM_TYPE, Qt);
8205#if !defined (USE_GTK) && !defined (HAVE_NS) 8210#if !defined (USE_GTK) && !defined (HAVE_NS)
8206 /* If we use build_desired_tool_bar_string to render the 8211 /* If we use build_desired_tool_bar_string to render the
8207 tool bar, the separator is rendered as an image. */ 8212 tool bar, the separator is rendered as an image. */
@@ -8217,7 +8222,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8217 } 8222 }
8218 8223
8219 /* Store the binding. */ 8224 /* Store the binding. */
8220 PROP (TOOL_BAR_ITEM_BINDING) = XCAR (item); 8225 set_prop (TOOL_BAR_ITEM_BINDING, XCAR (item));
8221 item = XCDR (item); 8226 item = XCDR (item);
8222 8227
8223 /* Ignore cached key binding, if any. */ 8228 /* Ignore cached key binding, if any. */
@@ -8236,9 +8241,9 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8236 { 8241 {
8237 /* `:enable FORM'. */ 8242 /* `:enable FORM'. */
8238 if (!NILP (Venable_disabled_menus_and_buttons)) 8243 if (!NILP (Venable_disabled_menus_and_buttons))
8239 PROP (TOOL_BAR_ITEM_ENABLED_P) = Qt; 8244 set_prop (TOOL_BAR_ITEM_ENABLED_P, Qt);
8240 else 8245 else
8241 PROP (TOOL_BAR_ITEM_ENABLED_P) = value; 8246 set_prop (TOOL_BAR_ITEM_ENABLED_P, value);
8242 } 8247 }
8243 else if (EQ (ikey, QCvisible)) 8248 else if (EQ (ikey, QCvisible))
8244 { 8249 {
@@ -8249,17 +8254,16 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8249 } 8254 }
8250 else if (EQ (ikey, QChelp)) 8255 else if (EQ (ikey, QChelp))
8251 /* `:help HELP-STRING'. */ 8256 /* `:help HELP-STRING'. */
8252 PROP (TOOL_BAR_ITEM_HELP) = value; 8257 set_prop (TOOL_BAR_ITEM_HELP, value);
8253 else if (EQ (ikey, QCvert_only)) 8258 else if (EQ (ikey, QCvert_only))
8254 /* `:vert-only t/nil'. */ 8259 /* `:vert-only t/nil'. */
8255 PROP (TOOL_BAR_ITEM_VERT_ONLY) = value; 8260 set_prop (TOOL_BAR_ITEM_VERT_ONLY, value);
8256 else if (EQ (ikey, QClabel)) 8261 else if (EQ (ikey, QClabel))
8257 { 8262 {
8258 const char *bad_label = "!!?GARBLED ITEM?!!"; 8263 const char *bad_label = "!!?GARBLED ITEM?!!";
8259 /* `:label LABEL-STRING'. */ 8264 /* `:label LABEL-STRING'. */
8260 PROP (TOOL_BAR_ITEM_LABEL) = STRINGP (value) 8265 set_prop (TOOL_BAR_ITEM_LABEL,
8261 ? value 8266 STRINGP (value) ? value : build_string (bad_label));
8262 : build_string (bad_label);
8263 have_label = 1; 8267 have_label = 1;
8264 } 8268 }
8265 else if (EQ (ikey, QCfilter)) 8269 else if (EQ (ikey, QCfilter))
@@ -8274,8 +8278,8 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8274 selected = XCDR (value); 8278 selected = XCDR (value);
8275 if (EQ (type, QCtoggle) || EQ (type, QCradio)) 8279 if (EQ (type, QCtoggle) || EQ (type, QCradio))
8276 { 8280 {
8277 PROP (TOOL_BAR_ITEM_SELECTED_P) = selected; 8281 set_prop (TOOL_BAR_ITEM_SELECTED_P, selected);
8278 PROP (TOOL_BAR_ITEM_TYPE) = type; 8282 set_prop (TOOL_BAR_ITEM_TYPE, type);
8279 } 8283 }
8280 } 8284 }
8281 else if (EQ (ikey, QCimage) 8285 else if (EQ (ikey, QCimage)
@@ -8283,10 +8287,10 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8283 || (VECTORP (value) && ASIZE (value) == 4))) 8287 || (VECTORP (value) && ASIZE (value) == 4)))
8284 /* Value is either a single image specification or a vector 8288 /* Value is either a single image specification or a vector
8285 of 4 such specifications for the different button states. */ 8289 of 4 such specifications for the different button states. */
8286 PROP (TOOL_BAR_ITEM_IMAGES) = value; 8290 set_prop (TOOL_BAR_ITEM_IMAGES, value);
8287 else if (EQ (ikey, QCrtl)) 8291 else if (EQ (ikey, QCrtl))
8288 /* ':rtl STRING' */ 8292 /* ':rtl STRING' */
8289 PROP (TOOL_BAR_ITEM_RTL_IMAGE) = value; 8293 set_prop (TOOL_BAR_ITEM_RTL_IMAGE, value);
8290 } 8294 }
8291 8295
8292 8296
@@ -8328,18 +8332,19 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8328 8332
8329 new_lbl = Fupcase_initials (build_string (label)); 8333 new_lbl = Fupcase_initials (build_string (label));
8330 if (SCHARS (new_lbl) <= tool_bar_max_label_size) 8334 if (SCHARS (new_lbl) <= tool_bar_max_label_size)
8331 PROP (TOOL_BAR_ITEM_LABEL) = new_lbl; 8335 set_prop (TOOL_BAR_ITEM_LABEL, new_lbl);
8332 else 8336 else
8333 PROP (TOOL_BAR_ITEM_LABEL) = empty_unibyte_string; 8337 set_prop (TOOL_BAR_ITEM_LABEL, empty_unibyte_string);
8334 xfree (buf); 8338 xfree (buf);
8335 } 8339 }
8336 8340
8337 /* If got a filter apply it on binding. */ 8341 /* If got a filter apply it on binding. */
8338 if (!NILP (filter)) 8342 if (!NILP (filter))
8339 PROP (TOOL_BAR_ITEM_BINDING) 8343 set_prop (TOOL_BAR_ITEM_BINDING,
8340 = menu_item_eval_property (list2 (filter, 8344 (menu_item_eval_property
8341 list2 (Qquote, 8345 (list2 (filter,
8342 PROP (TOOL_BAR_ITEM_BINDING)))); 8346 list2 (Qquote,
8347 PROP (TOOL_BAR_ITEM_BINDING))))));
8343 8348
8344 /* See if the binding is a keymap. Give up if it is. */ 8349 /* See if the binding is a keymap. Give up if it is. */
8345 if (CONSP (get_keymap (PROP (TOOL_BAR_ITEM_BINDING), 0, 1))) 8350 if (CONSP (get_keymap (PROP (TOOL_BAR_ITEM_BINDING), 0, 1)))
@@ -8347,13 +8352,13 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8347 8352
8348 /* Enable or disable selection of item. */ 8353 /* Enable or disable selection of item. */
8349 if (!EQ (PROP (TOOL_BAR_ITEM_ENABLED_P), Qt)) 8354 if (!EQ (PROP (TOOL_BAR_ITEM_ENABLED_P), Qt))
8350 PROP (TOOL_BAR_ITEM_ENABLED_P) 8355 set_prop (TOOL_BAR_ITEM_ENABLED_P,
8351 = menu_item_eval_property (PROP (TOOL_BAR_ITEM_ENABLED_P)); 8356 menu_item_eval_property (PROP (TOOL_BAR_ITEM_ENABLED_P)));
8352 8357
8353 /* Handle radio buttons or toggle boxes. */ 8358 /* Handle radio buttons or toggle boxes. */
8354 if (!NILP (PROP (TOOL_BAR_ITEM_SELECTED_P))) 8359 if (!NILP (PROP (TOOL_BAR_ITEM_SELECTED_P)))
8355 PROP (TOOL_BAR_ITEM_SELECTED_P) 8360 set_prop (TOOL_BAR_ITEM_SELECTED_P,
8356 = menu_item_eval_property (PROP (TOOL_BAR_ITEM_SELECTED_P)); 8361 menu_item_eval_property (PROP (TOOL_BAR_ITEM_SELECTED_P)));
8357 8362
8358 return 1; 8363 return 1;
8359 8364
diff --git a/src/lisp.h b/src/lisp.h
index 2928f92df37..dfddb09f2e9 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -598,7 +598,7 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
598#define ASET(ARRAY, IDX, VAL) \ 598#define ASET(ARRAY, IDX, VAL) \
599 (eassert ((IDX) == (IDX)), \ 599 (eassert ((IDX) == (IDX)), \
600 eassert ((IDX) >= 0 && (IDX) < ASIZE (ARRAY)), \ 600 eassert ((IDX) >= 0 && (IDX) < ASIZE (ARRAY)), \
601 AREF ((ARRAY), (IDX)) = (VAL)) 601 XVECTOR (ARRAY)->contents[IDX] = (VAL))
602 602
603/* Convenience macros for dealing with Lisp strings. */ 603/* Convenience macros for dealing with Lisp strings. */
604 604
@@ -2336,6 +2336,44 @@ void staticpro (Lisp_Object *);
2336struct window; 2336struct window;
2337struct frame; 2337struct frame;
2338 2338
2339/* Simple access functions. */
2340
2341static inline Lisp_Object *
2342aref_addr (Lisp_Object array, ptrdiff_t idx)
2343{
2344 return & XVECTOR (array)->contents[idx];
2345}
2346
2347static inline void
2348set_hash_key (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
2349{
2350 ASET (h->key_and_value, 2 * idx, val);
2351}
2352
2353static inline void
2354set_hash_value (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
2355{
2356 ASET (h->key_and_value, 2 * idx + 1, val);
2357}
2358
2359static inline void
2360set_hash_next (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
2361{
2362 ASET (h->next, idx, val);
2363}
2364
2365static inline void
2366set_hash_hash (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
2367{
2368 ASET (h->hash, idx, val);
2369}
2370
2371static inline void
2372set_hash_index (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
2373{
2374 ASET (h->index, idx, val);
2375}
2376
2339/* Defined in data.c. */ 2377/* Defined in data.c. */
2340extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound; 2378extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
2341extern Lisp_Object Qerror_conditions, Qerror_message, Qtop_level; 2379extern Lisp_Object Qerror_conditions, Qerror_message, Qtop_level;
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 {
diff --git a/src/menu.c b/src/menu.c
index 3b8ebb65d2c..15029390137 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1006,7 +1006,7 @@ find_and_return_menu_selection (FRAME_PTR f, int keymaps, void *client_data)
1006 { 1006 {
1007 entry 1007 entry
1008 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); 1008 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
1009 if (&AREF (menu_items, i) == client_data) 1009 if (aref_addr (menu_items, i) == client_data)
1010 { 1010 {
1011 if (keymaps != 0) 1011 if (keymaps != 0)
1012 { 1012 {
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 9f1a43a08f2..dc9b80a3adc 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -222,7 +222,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu)
222 222
223 /* Save the frame's previous menu bar contents data */ 223 /* Save the frame's previous menu bar contents data */
224 if (previous_menu_items_used) 224 if (previous_menu_items_used)
225 memcpy (previous_items, &AREF (FVAR (f, menu_bar_vector), 0), 225 memcpy (previous_items, aref_addr (FVAR (f, menu_bar_vector), 0),
226 previous_menu_items_used * sizeof (Lisp_Object)); 226 previous_menu_items_used * sizeof (Lisp_Object));
227 227
228 /* parse stage 1: extract from lisp */ 228 /* parse stage 1: extract from lisp */
@@ -939,8 +939,7 @@ ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
939 /* If this item has a null value, 939 /* If this item has a null value,
940 make the call_data null so that it won't display a box 940 make the call_data null so that it won't display a box
941 when the mouse is on it. */ 941 when the mouse is on it. */
942 wv->call_data 942 wv->call_data = !NILP (def) ? aref_addr (menu_items, i) : 0;
943 = !NILP (def) ? (void *) &AREF (menu_items, i) : 0;
944 wv->enabled = !NILP (enable); 943 wv->enabled = !NILP (enable);
945 944
946 if (NILP (type)) 945 if (NILP (type))
@@ -1453,7 +1452,7 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header)
1453 1452
1454 unwind_data->pool = pool; 1453 unwind_data->pool = pool;
1455 unwind_data->dialog = dialog; 1454 unwind_data->dialog = dialog;
1456 1455
1457 record_unwind_protect (pop_down_menu, make_save_value (unwind_data, 0)); 1456 record_unwind_protect (pop_down_menu, make_save_value (unwind_data, 0));
1458 popup_activated_flag = 1; 1457 popup_activated_flag = 1;
1459 tem = [dialog runDialogAt: p]; 1458 tem = [dialog runDialogAt: p];
diff --git a/src/w32menu.c b/src/w32menu.c
index 4545533c999..d99516c8540 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -1062,7 +1062,7 @@ w32_dialog_show (FRAME_PTR f, int keymaps,
1062 if (!NILP (descrip)) 1062 if (!NILP (descrip))
1063 wv->key = SSDATA (descrip); 1063 wv->key = SSDATA (descrip);
1064 wv->value = SSDATA (item_name); 1064 wv->value = SSDATA (item_name);
1065 wv->call_data = (void *) &AREF (menu_items, i); 1065 wv->call_data = aref_addr (menu_items, i);
1066 wv->enabled = !NILP (enable); 1066 wv->enabled = !NILP (enable);
1067 wv->help = Qnil; 1067 wv->help = Qnil;
1068 prev_wv = wv; 1068 prev_wv = wv;
diff --git a/src/xfaces.c b/src/xfaces.c
index b92e0c82173..b5eeca09210 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -2182,14 +2182,14 @@ set_lface_from_font (struct frame *f, Lisp_Object lface,
2182 { 2182 {
2183 Lisp_Object family = AREF (font_object, FONT_FAMILY_INDEX); 2183 Lisp_Object family = AREF (font_object, FONT_FAMILY_INDEX);
2184 2184
2185 LFACE_FAMILY (lface) = SYMBOL_NAME (family); 2185 ASET (lface, LFACE_FAMILY_INDEX, SYMBOL_NAME (family));
2186 } 2186 }
2187 2187
2188 if (force_p || UNSPECIFIEDP (LFACE_FOUNDRY (lface))) 2188 if (force_p || UNSPECIFIEDP (LFACE_FOUNDRY (lface)))
2189 { 2189 {
2190 Lisp_Object foundry = AREF (font_object, FONT_FOUNDRY_INDEX); 2190 Lisp_Object foundry = AREF (font_object, FONT_FOUNDRY_INDEX);
2191 2191
2192 LFACE_FOUNDRY (lface) = SYMBOL_NAME (foundry); 2192 ASET (lface, LFACE_FOUNDRY_INDEX, SYMBOL_NAME (foundry));
2193 } 2193 }
2194 2194
2195 if (force_p || UNSPECIFIEDP (LFACE_HEIGHT (lface))) 2195 if (force_p || UNSPECIFIEDP (LFACE_HEIGHT (lface)))
@@ -2197,26 +2197,26 @@ set_lface_from_font (struct frame *f, Lisp_Object lface,
2197 int pt = PIXEL_TO_POINT (font->pixel_size * 10, f->resy); 2197 int pt = PIXEL_TO_POINT (font->pixel_size * 10, f->resy);
2198 2198
2199 eassert (pt > 0); 2199 eassert (pt > 0);
2200 LFACE_HEIGHT (lface) = make_number (pt); 2200 ASET (lface, LFACE_HEIGHT_INDEX, make_number (pt));
2201 } 2201 }
2202 2202
2203 if (force_p || UNSPECIFIEDP (LFACE_WEIGHT (lface))) 2203 if (force_p || UNSPECIFIEDP (LFACE_WEIGHT (lface)))
2204 { 2204 {
2205 val = FONT_WEIGHT_FOR_FACE (font_object); 2205 val = FONT_WEIGHT_FOR_FACE (font_object);
2206 LFACE_WEIGHT (lface) = ! NILP (val) ? val :Qnormal; 2206 ASET (lface, LFACE_WEIGHT_INDEX, ! NILP (val) ? val :Qnormal);
2207 } 2207 }
2208 if (force_p || UNSPECIFIEDP (LFACE_SLANT (lface))) 2208 if (force_p || UNSPECIFIEDP (LFACE_SLANT (lface)))
2209 { 2209 {
2210 val = FONT_SLANT_FOR_FACE (font_object); 2210 val = FONT_SLANT_FOR_FACE (font_object);
2211 LFACE_SLANT (lface) = ! NILP (val) ? val : Qnormal; 2211 ASET (lface, LFACE_SLANT_INDEX, ! NILP (val) ? val : Qnormal);
2212 } 2212 }
2213 if (force_p || UNSPECIFIEDP (LFACE_SWIDTH (lface))) 2213 if (force_p || UNSPECIFIEDP (LFACE_SWIDTH (lface)))
2214 { 2214 {
2215 val = FONT_WIDTH_FOR_FACE (font_object); 2215 val = FONT_WIDTH_FOR_FACE (font_object);
2216 LFACE_SWIDTH (lface) = ! NILP (val) ? val : Qnormal; 2216 ASET (lface, LFACE_SWIDTH_INDEX, ! NILP (val) ? val : Qnormal);
2217 } 2217 }
2218 2218
2219 LFACE_FONT (lface) = font_object; 2219 ASET (lface, LFACE_FONT_INDEX, font_object);
2220 return 1; 2220 return 1;
2221} 2221}
2222 2222
@@ -2851,7 +2851,7 @@ FRAME 0 means change the face on all frames, and change the default
2851 signal_error ("Invalid face family", value); 2851 signal_error ("Invalid face family", value);
2852 } 2852 }
2853 old_value = LFACE_FAMILY (lface); 2853 old_value = LFACE_FAMILY (lface);
2854 LFACE_FAMILY (lface) = value; 2854 ASET (lface, LFACE_FAMILY_INDEX, value);
2855 prop_index = FONT_FAMILY_INDEX; 2855 prop_index = FONT_FAMILY_INDEX;
2856 } 2856 }
2857 else if (EQ (attr, QCfoundry)) 2857 else if (EQ (attr, QCfoundry))
@@ -2863,7 +2863,7 @@ FRAME 0 means change the face on all frames, and change the default
2863 signal_error ("Invalid face foundry", value); 2863 signal_error ("Invalid face foundry", value);
2864 } 2864 }
2865 old_value = LFACE_FOUNDRY (lface); 2865 old_value = LFACE_FOUNDRY (lface);
2866 LFACE_FOUNDRY (lface) = value; 2866 ASET (lface, LFACE_FOUNDRY_INDEX, value);
2867 prop_index = FONT_FOUNDRY_INDEX; 2867 prop_index = FONT_FOUNDRY_INDEX;
2868 } 2868 }
2869 else if (EQ (attr, QCheight)) 2869 else if (EQ (attr, QCheight))
@@ -2891,7 +2891,7 @@ FRAME 0 means change the face on all frames, and change the default
2891 } 2891 }
2892 2892
2893 old_value = LFACE_HEIGHT (lface); 2893 old_value = LFACE_HEIGHT (lface);
2894 LFACE_HEIGHT (lface) = value; 2894 ASET (lface, LFACE_HEIGHT_INDEX, value);
2895 prop_index = FONT_SIZE_INDEX; 2895 prop_index = FONT_SIZE_INDEX;
2896 } 2896 }
2897 else if (EQ (attr, QCweight)) 2897 else if (EQ (attr, QCweight))
@@ -2903,7 +2903,7 @@ FRAME 0 means change the face on all frames, and change the default
2903 signal_error ("Invalid face weight", value); 2903 signal_error ("Invalid face weight", value);
2904 } 2904 }
2905 old_value = LFACE_WEIGHT (lface); 2905 old_value = LFACE_WEIGHT (lface);
2906 LFACE_WEIGHT (lface) = value; 2906 ASET (lface, LFACE_WEIGHT_INDEX, value);
2907 prop_index = FONT_WEIGHT_INDEX; 2907 prop_index = FONT_WEIGHT_INDEX;
2908 } 2908 }
2909 else if (EQ (attr, QCslant)) 2909 else if (EQ (attr, QCslant))
@@ -2915,7 +2915,7 @@ FRAME 0 means change the face on all frames, and change the default
2915 signal_error ("Invalid face slant", value); 2915 signal_error ("Invalid face slant", value);
2916 } 2916 }
2917 old_value = LFACE_SLANT (lface); 2917 old_value = LFACE_SLANT (lface);
2918 LFACE_SLANT (lface) = value; 2918 ASET (lface, LFACE_SLANT_INDEX, value);
2919 prop_index = FONT_SLANT_INDEX; 2919 prop_index = FONT_SLANT_INDEX;
2920 } 2920 }
2921 else if (EQ (attr, QCunderline)) 2921 else if (EQ (attr, QCunderline))
@@ -2969,7 +2969,7 @@ FRAME 0 means change the face on all frames, and change the default
2969 signal_error ("Invalid face underline", value); 2969 signal_error ("Invalid face underline", value);
2970 2970
2971 old_value = LFACE_UNDERLINE (lface); 2971 old_value = LFACE_UNDERLINE (lface);
2972 LFACE_UNDERLINE (lface) = value; 2972 ASET (lface, LFACE_UNDERLINE_INDEX, value);
2973 } 2973 }
2974 else if (EQ (attr, QCoverline)) 2974 else if (EQ (attr, QCoverline))
2975 { 2975 {
@@ -2983,7 +2983,7 @@ FRAME 0 means change the face on all frames, and change the default
2983 signal_error ("Invalid face overline", value); 2983 signal_error ("Invalid face overline", value);
2984 2984
2985 old_value = LFACE_OVERLINE (lface); 2985 old_value = LFACE_OVERLINE (lface);
2986 LFACE_OVERLINE (lface) = value; 2986 ASET (lface, LFACE_OVERLINE_INDEX, value);
2987 } 2987 }
2988 else if (EQ (attr, QCstrike_through)) 2988 else if (EQ (attr, QCstrike_through))
2989 { 2989 {
@@ -2997,7 +2997,7 @@ FRAME 0 means change the face on all frames, and change the default
2997 signal_error ("Invalid face strike-through", value); 2997 signal_error ("Invalid face strike-through", value);
2998 2998
2999 old_value = LFACE_STRIKE_THROUGH (lface); 2999 old_value = LFACE_STRIKE_THROUGH (lface);
3000 LFACE_STRIKE_THROUGH (lface) = value; 3000 ASET (lface, LFACE_STRIKE_THROUGH_INDEX, value);
3001 } 3001 }
3002 else if (EQ (attr, QCbox)) 3002 else if (EQ (attr, QCbox))
3003 { 3003 {
@@ -3060,7 +3060,7 @@ FRAME 0 means change the face on all frames, and change the default
3060 signal_error ("Invalid face box", value); 3060 signal_error ("Invalid face box", value);
3061 3061
3062 old_value = LFACE_BOX (lface); 3062 old_value = LFACE_BOX (lface);
3063 LFACE_BOX (lface) = value; 3063 ASET (lface, LFACE_BOX_INDEX, value);
3064 } 3064 }
3065 else if (EQ (attr, QCinverse_video) 3065 else if (EQ (attr, QCinverse_video)
3066 || EQ (attr, QCreverse_video)) 3066 || EQ (attr, QCreverse_video))
@@ -3072,7 +3072,7 @@ FRAME 0 means change the face on all frames, and change the default
3072 signal_error ("Invalid inverse-video face attribute value", value); 3072 signal_error ("Invalid inverse-video face attribute value", value);
3073 } 3073 }
3074 old_value = LFACE_INVERSE (lface); 3074 old_value = LFACE_INVERSE (lface);
3075 LFACE_INVERSE (lface) = value; 3075 ASET (lface, LFACE_INVERSE_INDEX, value);
3076 } 3076 }
3077 else if (EQ (attr, QCforeground)) 3077 else if (EQ (attr, QCforeground))
3078 { 3078 {
@@ -3089,7 +3089,7 @@ FRAME 0 means change the face on all frames, and change the default
3089 signal_error ("Empty foreground color value", value); 3089 signal_error ("Empty foreground color value", value);
3090 } 3090 }
3091 old_value = LFACE_FOREGROUND (lface); 3091 old_value = LFACE_FOREGROUND (lface);
3092 LFACE_FOREGROUND (lface) = value; 3092 ASET (lface, LFACE_FOREGROUND_INDEX, value);
3093 } 3093 }
3094 else if (EQ (attr, QCbackground)) 3094 else if (EQ (attr, QCbackground))
3095 { 3095 {
@@ -3106,7 +3106,7 @@ FRAME 0 means change the face on all frames, and change the default
3106 signal_error ("Empty background color value", value); 3106 signal_error ("Empty background color value", value);
3107 } 3107 }
3108 old_value = LFACE_BACKGROUND (lface); 3108 old_value = LFACE_BACKGROUND (lface);
3109 LFACE_BACKGROUND (lface) = value; 3109 ASET (lface, LFACE_BACKGROUND_INDEX, value);
3110 } 3110 }
3111 else if (EQ (attr, QCstipple)) 3111 else if (EQ (attr, QCstipple))
3112 { 3112 {
@@ -3116,7 +3116,7 @@ FRAME 0 means change the face on all frames, and change the default
3116 && NILP (Fbitmap_spec_p (value))) 3116 && NILP (Fbitmap_spec_p (value)))
3117 signal_error ("Invalid stipple attribute", value); 3117 signal_error ("Invalid stipple attribute", value);
3118 old_value = LFACE_STIPPLE (lface); 3118 old_value = LFACE_STIPPLE (lface);
3119 LFACE_STIPPLE (lface) = value; 3119 ASET (lface, LFACE_STIPPLE_INDEX, value);
3120#endif /* HAVE_X_WINDOWS || HAVE_NS */ 3120#endif /* HAVE_X_WINDOWS || HAVE_NS */
3121 } 3121 }
3122 else if (EQ (attr, QCwidth)) 3122 else if (EQ (attr, QCwidth))
@@ -3128,7 +3128,7 @@ FRAME 0 means change the face on all frames, and change the default
3128 signal_error ("Invalid face width", value); 3128 signal_error ("Invalid face width", value);
3129 } 3129 }
3130 old_value = LFACE_SWIDTH (lface); 3130 old_value = LFACE_SWIDTH (lface);
3131 LFACE_SWIDTH (lface) = value; 3131 ASET (lface, LFACE_SWIDTH_INDEX, value);
3132 prop_index = FONT_WIDTH_INDEX; 3132 prop_index = FONT_WIDTH_INDEX;
3133 } 3133 }
3134 else if (EQ (attr, QCfont)) 3134 else if (EQ (attr, QCfont))
@@ -3174,7 +3174,7 @@ FRAME 0 means change the face on all frames, and change the default
3174 set_lface_from_font (f, lface, value, 1); 3174 set_lface_from_font (f, lface, value, 1);
3175 } 3175 }
3176 else 3176 else
3177 LFACE_FONT (lface) = value; 3177 ASET (lface, LFACE_FONT_INDEX, value);
3178 } 3178 }
3179#endif /* HAVE_WINDOW_SYSTEM */ 3179#endif /* HAVE_WINDOW_SYSTEM */
3180 } 3180 }
@@ -3189,7 +3189,7 @@ FRAME 0 means change the face on all frames, and change the default
3189 tmp = Fquery_fontset (value, Qnil); 3189 tmp = Fquery_fontset (value, Qnil);
3190 if (NILP (tmp)) 3190 if (NILP (tmp))
3191 signal_error ("Invalid fontset name", value); 3191 signal_error ("Invalid fontset name", value);
3192 LFACE_FONTSET (lface) = value = tmp; 3192 ASET (lface, LFACE_FONTSET_INDEX, value = tmp);
3193 } 3193 }
3194#endif /* HAVE_WINDOW_SYSTEM */ 3194#endif /* HAVE_WINDOW_SYSTEM */
3195 } 3195 }
@@ -3203,21 +3203,21 @@ FRAME 0 means change the face on all frames, and change the default
3203 if (!SYMBOLP (XCAR (tail))) 3203 if (!SYMBOLP (XCAR (tail)))
3204 break; 3204 break;
3205 if (NILP (tail)) 3205 if (NILP (tail))
3206 LFACE_INHERIT (lface) = value; 3206 ASET (lface, LFACE_INHERIT_INDEX, value);
3207 else 3207 else
3208 signal_error ("Invalid face inheritance", value); 3208 signal_error ("Invalid face inheritance", value);
3209 } 3209 }
3210 else if (EQ (attr, QCbold)) 3210 else if (EQ (attr, QCbold))
3211 { 3211 {
3212 old_value = LFACE_WEIGHT (lface); 3212 old_value = LFACE_WEIGHT (lface);
3213 LFACE_WEIGHT (lface) = NILP (value) ? Qnormal : Qbold; 3213 ASET (lface, LFACE_WEIGHT_INDEX, NILP (value) ? Qnormal : Qbold);
3214 prop_index = FONT_WEIGHT_INDEX; 3214 prop_index = FONT_WEIGHT_INDEX;
3215 } 3215 }
3216 else if (EQ (attr, QCitalic)) 3216 else if (EQ (attr, QCitalic))
3217 { 3217 {
3218 attr = QCslant; 3218 attr = QCslant;
3219 old_value = LFACE_SLANT (lface); 3219 old_value = LFACE_SLANT (lface);
3220 LFACE_SLANT (lface) = NILP (value) ? Qnormal : Qitalic; 3220 ASET (lface, LFACE_SLANT_INDEX, NILP (value) ? Qnormal : Qitalic);
3221 prop_index = FONT_SLANT_INDEX; 3221 prop_index = FONT_SLANT_INDEX;
3222 } 3222 }
3223 else 3223 else
@@ -3365,8 +3365,8 @@ update_face_from_frame_parameter (struct frame *f, Lisp_Object param,
3365 { 3365 {
3366 face = Qdefault; 3366 face = Qdefault;
3367 lface = lface_from_face_name (f, face, 1); 3367 lface = lface_from_face_name (f, face, 1);
3368 LFACE_FOREGROUND (lface) = (STRINGP (new_value) 3368 ASET (lface, LFACE_FOREGROUND_INDEX,
3369 ? new_value : Qunspecified); 3369 (STRINGP (new_value) ? new_value : Qunspecified));
3370 realize_basic_faces (f); 3370 realize_basic_faces (f);
3371 } 3371 }
3372 else if (EQ (param, Qbackground_color)) 3372 else if (EQ (param, Qbackground_color))
@@ -3381,8 +3381,8 @@ update_face_from_frame_parameter (struct frame *f, Lisp_Object param,
3381 3381
3382 face = Qdefault; 3382 face = Qdefault;
3383 lface = lface_from_face_name (f, face, 1); 3383 lface = lface_from_face_name (f, face, 1);
3384 LFACE_BACKGROUND (lface) = (STRINGP (new_value) 3384 ASET (lface, LFACE_BACKGROUND_INDEX,
3385 ? new_value : Qunspecified); 3385 (STRINGP (new_value) ? new_value : Qunspecified));
3386 realize_basic_faces (f); 3386 realize_basic_faces (f);
3387 } 3387 }
3388#ifdef HAVE_WINDOW_SYSTEM 3388#ifdef HAVE_WINDOW_SYSTEM
@@ -3390,22 +3390,22 @@ update_face_from_frame_parameter (struct frame *f, Lisp_Object param,
3390 { 3390 {
3391 face = Qborder; 3391 face = Qborder;
3392 lface = lface_from_face_name (f, face, 1); 3392 lface = lface_from_face_name (f, face, 1);
3393 LFACE_BACKGROUND (lface) = (STRINGP (new_value) 3393 ASET (lface, LFACE_BACKGROUND_INDEX,
3394 ? new_value : Qunspecified); 3394 (STRINGP (new_value) ? new_value : Qunspecified));
3395 } 3395 }
3396 else if (EQ (param, Qcursor_color)) 3396 else if (EQ (param, Qcursor_color))
3397 { 3397 {
3398 face = Qcursor; 3398 face = Qcursor;
3399 lface = lface_from_face_name (f, face, 1); 3399 lface = lface_from_face_name (f, face, 1);
3400 LFACE_BACKGROUND (lface) = (STRINGP (new_value) 3400 ASET (lface, LFACE_BACKGROUND_INDEX,
3401 ? new_value : Qunspecified); 3401 (STRINGP (new_value) ? new_value : Qunspecified));
3402 } 3402 }
3403 else if (EQ (param, Qmouse_color)) 3403 else if (EQ (param, Qmouse_color))
3404 { 3404 {
3405 face = Qmouse; 3405 face = Qmouse;
3406 lface = lface_from_face_name (f, face, 1); 3406 lface = lface_from_face_name (f, face, 1);
3407 LFACE_BACKGROUND (lface) = (STRINGP (new_value) 3407 ASET (lface, LFACE_BACKGROUND_INDEX,
3408 ? new_value : Qunspecified); 3408 (STRINGP (new_value) ? new_value : Qunspecified));
3409 } 3409 }
3410#endif 3410#endif
3411 3411
@@ -3445,7 +3445,7 @@ set_font_frame_param (Lisp_Object frame, Lisp_Object lface)
3445 font = font_load_for_lface (f, XVECTOR (lface)->contents, font); 3445 font = font_load_for_lface (f, XVECTOR (lface)->contents, font);
3446 if (NILP (font)) 3446 if (NILP (font))
3447 return; 3447 return;
3448 LFACE_FONT (lface) = font; 3448 ASET (lface, LFACE_FONT_INDEX, font);
3449 } 3449 }
3450 f->default_face_done_p = 0; 3450 f->default_face_done_p = 0;
3451 Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font), Qnil)); 3451 Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font), Qnil));
@@ -5366,39 +5366,39 @@ realize_default_face (struct frame *f)
5366 5366
5367 XSETFONT (font_object, FRAME_FONT (f)); 5367 XSETFONT (font_object, FRAME_FONT (f));
5368 set_lface_from_font (f, lface, font_object, f->default_face_done_p); 5368 set_lface_from_font (f, lface, font_object, f->default_face_done_p);
5369 LFACE_FONTSET (lface) = fontset_name (FRAME_FONTSET (f)); 5369 ASET (lface, LFACE_FONTSET_INDEX, fontset_name (FRAME_FONTSET (f)));
5370 f->default_face_done_p = 1; 5370 f->default_face_done_p = 1;
5371 } 5371 }
5372#endif /* HAVE_WINDOW_SYSTEM */ 5372#endif /* HAVE_WINDOW_SYSTEM */
5373 5373
5374 if (!FRAME_WINDOW_P (f)) 5374 if (!FRAME_WINDOW_P (f))
5375 { 5375 {
5376 LFACE_FAMILY (lface) = build_string ("default"); 5376 ASET (lface, LFACE_FAMILY_INDEX, build_string ("default"));
5377 LFACE_FOUNDRY (lface) = LFACE_FAMILY (lface); 5377 ASET (lface, LFACE_FOUNDRY_INDEX, LFACE_FAMILY (lface));
5378 LFACE_SWIDTH (lface) = Qnormal; 5378 ASET (lface, LFACE_SWIDTH_INDEX, Qnormal);
5379 LFACE_HEIGHT (lface) = make_number (1); 5379 ASET (lface, LFACE_HEIGHT_INDEX, make_number (1));
5380 if (UNSPECIFIEDP (LFACE_WEIGHT (lface))) 5380 if (UNSPECIFIEDP (LFACE_WEIGHT (lface)))
5381 LFACE_WEIGHT (lface) = Qnormal; 5381 ASET (lface, LFACE_WEIGHT_INDEX, Qnormal);
5382 if (UNSPECIFIEDP (LFACE_SLANT (lface))) 5382 if (UNSPECIFIEDP (LFACE_SLANT (lface)))
5383 LFACE_SLANT (lface) = Qnormal; 5383 ASET (lface, LFACE_SLANT_INDEX, Qnormal);
5384 if (UNSPECIFIEDP (LFACE_FONTSET (lface))) 5384 if (UNSPECIFIEDP (LFACE_FONTSET (lface)))
5385 LFACE_FONTSET (lface) = Qnil; 5385 ASET (lface, LFACE_FONTSET_INDEX, Qnil);
5386 } 5386 }
5387 5387
5388 if (UNSPECIFIEDP (LFACE_UNDERLINE (lface))) 5388 if (UNSPECIFIEDP (LFACE_UNDERLINE (lface)))
5389 LFACE_UNDERLINE (lface) = Qnil; 5389 ASET (lface, LFACE_UNDERLINE_INDEX, Qnil);
5390 5390
5391 if (UNSPECIFIEDP (LFACE_OVERLINE (lface))) 5391 if (UNSPECIFIEDP (LFACE_OVERLINE (lface)))
5392 LFACE_OVERLINE (lface) = Qnil; 5392 ASET (lface, LFACE_OVERLINE_INDEX, Qnil);
5393 5393
5394 if (UNSPECIFIEDP (LFACE_STRIKE_THROUGH (lface))) 5394 if (UNSPECIFIEDP (LFACE_STRIKE_THROUGH (lface)))
5395 LFACE_STRIKE_THROUGH (lface) = Qnil; 5395 ASET (lface, LFACE_STRIKE_THROUGH_INDEX, Qnil);
5396 5396
5397 if (UNSPECIFIEDP (LFACE_BOX (lface))) 5397 if (UNSPECIFIEDP (LFACE_BOX (lface)))
5398 LFACE_BOX (lface) = Qnil; 5398 ASET (lface, LFACE_BOX_INDEX, Qnil);
5399 5399
5400 if (UNSPECIFIEDP (LFACE_INVERSE (lface))) 5400 if (UNSPECIFIEDP (LFACE_INVERSE (lface)))
5401 LFACE_INVERSE (lface) = Qnil; 5401 ASET (lface, LFACE_INVERSE_INDEX, Qnil);
5402 5402
5403 if (UNSPECIFIEDP (LFACE_FOREGROUND (lface))) 5403 if (UNSPECIFIEDP (LFACE_FOREGROUND (lface)))
5404 { 5404 {
@@ -5407,11 +5407,11 @@ realize_default_face (struct frame *f)
5407 Lisp_Object color = Fassq (Qforeground_color, FVAR (f, param_alist)); 5407 Lisp_Object color = Fassq (Qforeground_color, FVAR (f, param_alist));
5408 5408
5409 if (CONSP (color) && STRINGP (XCDR (color))) 5409 if (CONSP (color) && STRINGP (XCDR (color)))
5410 LFACE_FOREGROUND (lface) = XCDR (color); 5410 ASET (lface, LFACE_FOREGROUND_INDEX, XCDR (color));
5411 else if (FRAME_WINDOW_P (f)) 5411 else if (FRAME_WINDOW_P (f))
5412 return 0; 5412 return 0;
5413 else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) 5413 else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
5414 LFACE_FOREGROUND (lface) = build_string (unspecified_fg); 5414 ASET (lface, LFACE_FOREGROUND_INDEX, build_string (unspecified_fg));
5415 else 5415 else
5416 abort (); 5416 abort ();
5417 } 5417 }
@@ -5422,17 +5422,17 @@ realize_default_face (struct frame *f)
5422 set in the frame parameter list. */ 5422 set in the frame parameter list. */
5423 Lisp_Object color = Fassq (Qbackground_color, FVAR (f, param_alist)); 5423 Lisp_Object color = Fassq (Qbackground_color, FVAR (f, param_alist));
5424 if (CONSP (color) && STRINGP (XCDR (color))) 5424 if (CONSP (color) && STRINGP (XCDR (color)))
5425 LFACE_BACKGROUND (lface) = XCDR (color); 5425 ASET (lface, LFACE_BACKGROUND_INDEX, XCDR (color));
5426 else if (FRAME_WINDOW_P (f)) 5426 else if (FRAME_WINDOW_P (f))
5427 return 0; 5427 return 0;
5428 else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) 5428 else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
5429 LFACE_BACKGROUND (lface) = build_string (unspecified_bg); 5429 ASET (lface, LFACE_BACKGROUND_INDEX, build_string (unspecified_bg));
5430 else 5430 else
5431 abort (); 5431 abort ();
5432 } 5432 }
5433 5433
5434 if (UNSPECIFIEDP (LFACE_STIPPLE (lface))) 5434 if (UNSPECIFIEDP (LFACE_STIPPLE (lface)))
5435 LFACE_STIPPLE (lface) = Qnil; 5435 ASET (lface, LFACE_STIPPLE_INDEX, Qnil);
5436 5436
5437 /* Realize the face; it must be fully-specified now. */ 5437 /* Realize the face; it must be fully-specified now. */
5438 eassert (lface_fully_specified_p (XVECTOR (lface)->contents)); 5438 eassert (lface_fully_specified_p (XVECTOR (lface)->contents));
diff --git a/src/xfont.c b/src/xfont.c
index 0443b49de8f..736c1161e27 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -463,11 +463,11 @@ xfont_list_pattern (Display *display, const char *pattern,
463 list = Fcons (entity, list); 463 list = Fcons (entity, list);
464 continue; 464 continue;
465 } 465 }
466 if (memcmp (props, &(AREF (entity, FONT_FOUNDRY_INDEX)), 466 if (memcmp (props, aref_addr (entity, FONT_FOUNDRY_INDEX),
467 sizeof (Lisp_Object) * 7) 467 sizeof (Lisp_Object) * 7)
468 || ! EQ (AREF (entity, FONT_SPACING_INDEX), props[7])) 468 || ! EQ (AREF (entity, FONT_SPACING_INDEX), props[7]))
469 { 469 {
470 memcpy (props, &(AREF (entity, FONT_FOUNDRY_INDEX)), 470 memcpy (props, aref_addr (entity, FONT_FOUNDRY_INDEX),
471 sizeof (Lisp_Object) * 7); 471 sizeof (Lisp_Object) * 7);
472 props[7] = AREF (entity, FONT_SPACING_INDEX); 472 props[7] = AREF (entity, FONT_SPACING_INDEX);
473 scripts = xfont_supported_scripts (display, indices[i], 473 scripts = xfont_supported_scripts (display, indices[i],
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 {