emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109381: Use "ASET (a, i, v)" rather


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109381: Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
Date: Wed, 01 Aug 2012 13:51:44 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109381
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Wed 2012-08-01 13:51:44 -0700
message:
  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.
modified:
  src/ChangeLog
  src/charset.c
  src/charset.h
  src/coding.c
  src/composite.c
  src/composite.h
  src/fns.c
  src/font.c
  src/keyboard.c
  src/lisp.h
  src/lread.c
  src/menu.c
  src/nsmenu.m
  src/w32menu.c
  src/xfaces.c
  src/xfont.c
  src/xmenu.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-08-01 20:15:30 +0000
+++ b/src/ChangeLog     2012-08-01 20:51:44 +0000
@@ -1,3 +1,19 @@
+2012-08-01  Paul Eggert  <address@hidden>
+
+       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.
+
 2012-08-01  Alp Aker  <address@hidden>
 
        * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)

=== modified file 'src/charset.c'
--- a/src/charset.c     2012-07-27 09:24:34 +0000
+++ b/src/charset.c     2012-08-01 20:51:44 +0000
@@ -272,8 +272,8 @@
                {
                  int n = CODE_POINT_TO_INDEX (charset, max_code) + 1;
 
-                 vec = CHARSET_DECODER (charset)
-                   = Fmake_vector (make_number (n), make_number (-1));
+                 vec = Fmake_vector (make_number (n), make_number (-1));
+                 set_charset_attr (charset, charset_decoder, vec);
                }
              else
                {
@@ -285,10 +285,10 @@
          else
            {
              table = Fmake_char_table (Qnil, Qnil);
-             if (charset->method == CHARSET_METHOD_MAP)
-               CHARSET_ENCODER (charset) = table;
-             else
-               CHARSET_DEUNIFIER (charset) = table;
+             set_charset_attr (charset,
+                               (charset->method == CHARSET_METHOD_MAP
+                                ? charset_encoder : charset_deunifier),
+                               table);
            }
        }
       else
@@ -1133,7 +1133,7 @@
     {
       new_definition_p = 0;
       id = XFASTINT (CHARSET_SYMBOL_ID (args[charset_arg_name]));
-      HASH_VALUE (hash_table, charset.hash_index) = attrs;
+      set_hash_value (hash_table, charset.hash_index, attrs);
     }
   else
     {
@@ -1336,7 +1336,7 @@
   Lisp_Object attrs;
 
   CHECK_CHARSET_GET_ATTR (charset, attrs);
-  CHARSET_ATTR_PLIST (attrs) = plist;
+  ASET (attrs, charset_plist, plist);
   return plist;
 }
 
@@ -1375,7 +1375,7 @@
        {
          if (! STRINGP (unify_map) && ! VECTORP (unify_map))
            signal_error ("Bad unify-map", unify_map);
-         CHARSET_UNIFY_MAP (cs) = unify_map;
+         set_charset_attr (cs, charset_unify_map, unify_map);
        }
       if (NILP (Vchar_unify_table))
        Vchar_unify_table = Fmake_char_table (Qnil, Qnil);

=== modified file 'src/charset.h'
--- a/src/charset.h     2012-02-10 18:58:48 +0000
+++ b/src/charset.h     2012-08-01 20:51:44 +0000
@@ -325,6 +325,13 @@
 #define CHARSET_DEUNIFIER(charset)     \
   (CHARSET_ATTR_DEUNIFIER (CHARSET_ATTRIBUTES (charset)))
 
+static inline void
+set_charset_attr (struct charset *charset, enum charset_attr_index idx,
+                 Lisp_Object val)
+{
+  ASET (CHARSET_ATTRIBUTES (charset), idx, val);
+}
+
 
 /* Nonzero if OBJ is a valid charset symbol.  */
 #define CHARSETP(obj) (CHARSET_SYMBOL_HASH_INDEX (obj) >= 0)

=== modified file 'src/coding.c'
--- a/src/coding.c      2012-07-30 06:43:46 +0000
+++ b/src/coding.c      2012-08-01 20:51:44 +0000
@@ -2674,8 +2674,8 @@
   CODING_GET_INFO (coding, attrs, charset_list);
   if (! EQ (charset_list, Vemacs_mule_charset_list))
     {
-      CODING_ATTR_CHARSET_LIST (attrs)
-       = charset_list = Vemacs_mule_charset_list;
+      charset_list = Vemacs_mule_charset_list;
+      ASET (attrs, coding_attr_charset_list, charset_list);
     }
 
   while (charbuf < charbuf_end)
@@ -2967,8 +2967,8 @@
   if ((flags & CODING_ISO_FLAG_FULL_SUPPORT)
       && ! EQ (charset_list, Viso_2022_charset_list))
     {
-      CODING_ATTR_CHARSET_LIST (attrs)
-       = charset_list = Viso_2022_charset_list;
+      charset_list = Viso_2022_charset_list;
+      ASET (attrs, coding_attr_charset_list, charset_list);
       ASET (attrs, coding_attr_safe_charsets, Qnil);
     }
 
@@ -9603,16 +9603,16 @@
 
   name = args[coding_arg_name];
   CHECK_SYMBOL (name);
-  CODING_ATTR_BASE_NAME (attrs) = name;
+  ASET (attrs, coding_attr_base_name, name);
 
   val = args[coding_arg_mnemonic];
   if (! STRINGP (val))
     CHECK_CHARACTER (val);
-  CODING_ATTR_MNEMONIC (attrs) = val;
+  ASET (attrs, coding_attr_mnemonic, val);
 
   coding_type = args[coding_arg_coding_type];
   CHECK_SYMBOL (coding_type);
-  CODING_ATTR_TYPE (attrs) = coding_type;
+  ASET (attrs, coding_attr_type, coding_type);
 
   charset_list = args[coding_arg_charset_list];
   if (SYMBOLP (charset_list))
@@ -9659,49 +9659,49 @@
            max_charset_id = charset->id;
        }
     }
-  CODING_ATTR_CHARSET_LIST (attrs) = charset_list;
+  ASET (attrs, coding_attr_charset_list, charset_list);
 
   safe_charsets = make_uninit_string (max_charset_id + 1);
   memset (SDATA (safe_charsets), 255, max_charset_id + 1);
   for (tail = charset_list; CONSP (tail); tail = XCDR (tail))
     SSET (safe_charsets, XFASTINT (XCAR (tail)), 0);
-  CODING_ATTR_SAFE_CHARSETS (attrs) = safe_charsets;
+  ASET (attrs, coding_attr_safe_charsets, safe_charsets);
 
-  CODING_ATTR_ASCII_COMPAT (attrs) = args[coding_arg_ascii_compatible_p];
+  ASET (attrs, coding_attr_ascii_compat, args[coding_arg_ascii_compatible_p]);
 
   val = args[coding_arg_decode_translation_table];
   if (! CHAR_TABLE_P (val) && ! CONSP (val))
     CHECK_SYMBOL (val);
-  CODING_ATTR_DECODE_TBL (attrs) = val;
+  ASET (attrs, coding_attr_decode_tbl, val);
 
   val = args[coding_arg_encode_translation_table];
   if (! CHAR_TABLE_P (val) && ! CONSP (val))
     CHECK_SYMBOL (val);
-  CODING_ATTR_ENCODE_TBL (attrs) = val;
+  ASET (attrs, coding_attr_encode_tbl, val);
 
   val = args[coding_arg_post_read_conversion];
   CHECK_SYMBOL (val);
-  CODING_ATTR_POST_READ (attrs) = val;
+  ASET (attrs, coding_attr_post_read, val);
 
   val = args[coding_arg_pre_write_conversion];
   CHECK_SYMBOL (val);
-  CODING_ATTR_PRE_WRITE (attrs) = val;
+  ASET (attrs, coding_attr_pre_write, val);
 
   val = args[coding_arg_default_char];
   if (NILP (val))
-    CODING_ATTR_DEFAULT_CHAR (attrs) = make_number (' ');
+    ASET (attrs, coding_attr_default_char, make_number (' '));
   else
     {
       CHECK_CHARACTER (val);
-      CODING_ATTR_DEFAULT_CHAR (attrs) = val;
+      ASET (attrs, coding_attr_default_char, val);
     }
 
   val = args[coding_arg_for_unibyte];
-  CODING_ATTR_FOR_UNIBYTE (attrs) = NILP (val) ? Qnil : Qt;
+  ASET (attrs, coding_attr_for_unibyte, NILP (val) ? Qnil : Qt);
 
   val = args[coding_arg_plist];
   CHECK_LIST (val);
-  CODING_ATTR_PLIST (attrs) = val;
+  ASET (attrs, coding_attr_plist, val);
 
   if (EQ (coding_type, Qcharset))
     {
@@ -9726,7 +9726,7 @@
          int idx = (dim - 1) * 4;
 
          if (CHARSET_ASCII_COMPATIBLE_P (charset))
-           CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+           ASET (attrs, coding_attr_ascii_compat, Qt);
 
          for (i = charset->code_space[idx];
               i <= charset->code_space[idx + 1]; i++)
@@ -9824,7 +9824,7 @@
     {
       Lisp_Object bom, endian;
 
-      CODING_ATTR_ASCII_COMPAT (attrs) = Qnil;
+      ASET (attrs, coding_attr_ascii_compat, Qnil);
 
       if (nargs < coding_arg_utf16_max)
        goto short_args;
@@ -9877,7 +9877,7 @@
              CHECK_CHARSET_GET_CHARSET (val, charset);
              ASET (initial, i, make_number (CHARSET_ID (charset)));
              if (i == 0 && CHARSET_ASCII_COMPATIBLE_P (charset))
-               CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+               ASET (attrs, coding_attr_ascii_compat, Qt);
            }
          else
            ASET (initial, i, make_number (-1));
@@ -9938,13 +9938,13 @@
        }
       if (category != coding_category_iso_8_1
          && category != coding_category_iso_8_2)
-       CODING_ATTR_ASCII_COMPAT (attrs) = Qnil;
+       ASET (attrs, coding_attr_ascii_compat, Qnil);
     }
   else if (EQ (coding_type, Qemacs_mule))
     {
       if (EQ (args[coding_arg_charset_list], Qemacs_mule))
        ASET (attrs, coding_attr_emacs_mule_full, Qt);
-      CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+      ASET (attrs, coding_attr_ascii_compat, Qt);
       category = coding_category_emacs_mule;
     }
   else if (EQ (coding_type, Qshift_jis))
@@ -9961,7 +9961,7 @@
        error ("Dimension of charset %s is not one",
               SDATA (SYMBOL_NAME (CHARSET_NAME (charset))));
       if (CHARSET_ASCII_COMPATIBLE_P (charset))
-       CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+       ASET (attrs, coding_attr_ascii_compat, Qt);
 
       charset_list = XCDR (charset_list);
       charset = CHARSET_FROM_ID (XINT (XCAR (charset_list)));
@@ -9999,7 +9999,7 @@
        error ("Dimension of charset %s is not one",
               SDATA (SYMBOL_NAME (CHARSET_NAME (charset))));
       if (CHARSET_ASCII_COMPATIBLE_P (charset))
-       CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+       ASET (attrs, coding_attr_ascii_compat, Qt);
 
       charset_list = XCDR (charset_list);
       charset = CHARSET_FROM_ID (XINT (XCAR (charset_list)));
@@ -10013,7 +10013,7 @@
   else if (EQ (coding_type, Qraw_text))
     {
       category = coding_category_raw_text;
-      CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+      ASET (attrs, coding_attr_ascii_compat, Qt);
     }
   else if (EQ (coding_type, Qutf_8))
     {
@@ -10033,7 +10033,7 @@
        }
       ASET (attrs, coding_attr_utf_bom, bom);
       if (NILP (bom))
-       CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+       ASET (attrs, coding_attr_ascii_compat, Qt);
 
       category = (CONSP (bom) ? coding_category_utf_8_auto
                  : NILP (bom) ? coding_category_utf_8_nosig
@@ -10045,14 +10045,15 @@
     error ("Invalid coding system type: %s",
           SDATA (SYMBOL_NAME (coding_type)));
 
-  CODING_ATTR_CATEGORY (attrs) = make_number (category);
-  CODING_ATTR_PLIST (attrs)
-    = Fcons (QCcategory, Fcons (AREF (Vcoding_category_table, category),
-                               CODING_ATTR_PLIST (attrs)));
-  CODING_ATTR_PLIST (attrs)
-    = Fcons (QCascii_compatible_p,
-            Fcons (CODING_ATTR_ASCII_COMPAT (attrs),
-                   CODING_ATTR_PLIST (attrs)));
+  ASET (attrs, coding_attr_category, make_number (category));
+  ASET (attrs, coding_attr_plist,
+       Fcons (QCcategory,
+              Fcons (AREF (Vcoding_category_table, category),
+                     CODING_ATTR_PLIST (attrs))));
+  ASET (attrs, coding_attr_plist,
+       Fcons (QCascii_compatible_p,
+              Fcons (CODING_ATTR_ASCII_COMPAT (attrs),
+                     CODING_ATTR_PLIST (attrs))));
 
   eol_type = args[coding_arg_eol_type];
   if (! NILP (eol_type)
@@ -10126,7 +10127,7 @@
     {
       if (! STRINGP (val))
        CHECK_CHARACTER (val);
-      CODING_ATTR_MNEMONIC (attrs) = val;
+      ASET (attrs, coding_attr_mnemonic, val);
     }
   else if (EQ (prop, QCdefault_char))
     {
@@ -10134,37 +10135,37 @@
        val = make_number (' ');
       else
        CHECK_CHARACTER (val);
-      CODING_ATTR_DEFAULT_CHAR (attrs) = val;
+      ASET (attrs, coding_attr_default_char, val);
     }
   else if (EQ (prop, QCdecode_translation_table))
     {
       if (! CHAR_TABLE_P (val) && ! CONSP (val))
        CHECK_SYMBOL (val);
-      CODING_ATTR_DECODE_TBL (attrs) = val;
+      ASET (attrs, coding_attr_decode_tbl, val);
     }
   else if (EQ (prop, QCencode_translation_table))
     {
       if (! CHAR_TABLE_P (val) && ! CONSP (val))
        CHECK_SYMBOL (val);
-      CODING_ATTR_ENCODE_TBL (attrs) = val;
+      ASET (attrs, coding_attr_encode_tbl, val);
     }
   else if (EQ (prop, QCpost_read_conversion))
     {
       CHECK_SYMBOL (val);
-      CODING_ATTR_POST_READ (attrs) = val;
+      ASET (attrs, coding_attr_post_read, val);
     }
   else if (EQ (prop, QCpre_write_conversion))
     {
       CHECK_SYMBOL (val);
-      CODING_ATTR_PRE_WRITE (attrs) = val;
+      ASET (attrs, coding_attr_pre_write, val);
     }
   else if (EQ (prop, QCascii_compatible_p))
     {
-      CODING_ATTR_ASCII_COMPAT (attrs) = val;
+      ASET (attrs, coding_attr_ascii_compat, val);
     }
 
-  CODING_ATTR_PLIST (attrs)
-    = Fplist_put (CODING_ATTR_PLIST (attrs), prop, val);
+  ASET (attrs, coding_attr_plist,
+       Fplist_put (CODING_ATTR_PLIST (attrs), prop, val));
   return val;
 }
 

=== modified file 'src/composite.c'
--- a/src/composite.c   2012-08-01 05:11:36 +0000
+++ b/src/composite.c   2012-08-01 20:51:44 +0000
@@ -762,7 +762,7 @@
        }
       metrics->width = metrics->lbearing = metrics->rbearing = 0;
     }
-  for (glyph = &LGSTRING_GLYPH (gstring, from); from < to; from++, glyph++)
+  for (glyph = lgstring_glyph_addr (gstring, from); from < to; from++, glyph++)
     {
       int x;
 

=== modified file 'src/composite.h'
--- a/src/composite.h   2012-02-10 18:58:48 +0000
+++ b/src/composite.h   2012-08-01 20:51:44 +0000
@@ -247,6 +247,11 @@
 #define LGSTRING_GLYPH_LEN(lgs) (ASIZE ((lgs)) - 2)
 #define LGSTRING_GLYPH(lgs, idx) AREF ((lgs), (idx) + 2)
 #define LGSTRING_SET_GLYPH(lgs, idx, val) ASET ((lgs), (idx) + 2, (val))
+static inline Lisp_Object *
+lgstring_glyph_addr (Lisp_Object lgs, ptrdiff_t idx)
+{
+  return aref_addr (lgs, idx + 2);
+}
 
 /* Vector size of Lispy glyph.  */
 enum lglyph_indices

=== modified file 'src/fns.c'
--- a/src/fns.c 2012-08-01 08:49:28 +0000
+++ b/src/fns.c 2012-08-01 20:51:44 +0000
@@ -1192,7 +1192,7 @@
                            string, make_number (0), res, Qnil);
     }
   else
-    res = Fvector (to_char - from_char, &AREF (string, from_char));
+    res = Fvector (to_char - from_char, aref_addr (string, from_char));
 
   return res;
 }
@@ -1274,7 +1274,7 @@
                            string, make_number (0), res, Qnil);
     }
   else
-    res = Fvector (to - from, &AREF (string, from));
+    res = Fvector (to - from, aref_addr (string, from));
 
   return res;
 }
@@ -3663,7 +3663,7 @@
 
   /* Set up the free list.  */
   for (i = 0; i < sz - 1; ++i)
-    HASH_NEXT (h, i) = make_number (i + 1);
+    set_hash_next (h, i, make_number (i + 1));
   h->next_free = make_number (0);
 
   XSET_HASH_TABLE (table, h);
@@ -3770,7 +3770,7 @@
          the end of the free list.  This makes some operations like
          maphash faster.  */
       for (i = old_size; i < new_size - 1; ++i)
-       HASH_NEXT (h, i) = make_number (i + 1);
+       set_hash_next (h, i, make_number (i + 1));
 
       if (!NILP (h->next_free))
        {
@@ -3781,7 +3781,7 @@
                 !NILP (next))
            last = next;
 
-         HASH_NEXT (h, XFASTINT (last)) = make_number (old_size);
+         set_hash_next (h, XFASTINT (last), make_number (old_size));
        }
       else
        XSETFASTINT (h->next_free, old_size);
@@ -3792,8 +3792,8 @@
          {
            EMACS_UINT hash_code = XUINT (HASH_HASH (h, i));
            ptrdiff_t start_of_bucket = hash_code % ASIZE (h->index);
-           HASH_NEXT (h, i) = HASH_INDEX (h, start_of_bucket);
-           HASH_INDEX (h, start_of_bucket) = make_number (i);
+           set_hash_next (h, i, HASH_INDEX (h, start_of_bucket));
+           set_hash_index (h, start_of_bucket, make_number (i));
          }
     }
 }
@@ -3852,16 +3852,16 @@
   /* Store key/value in the key_and_value vector.  */
   i = XFASTINT (h->next_free);
   h->next_free = HASH_NEXT (h, i);
-  HASH_KEY (h, i) = key;
-  HASH_VALUE (h, i) = value;
+  set_hash_key (h, i, key);
+  set_hash_value (h, i, value);
 
   /* Remember its hash code.  */
-  HASH_HASH (h, i) = make_number (hash);
+  set_hash_hash (h, i, make_number (hash));
 
   /* Add new entry to its collision chain.  */
   start_of_bucket = hash % ASIZE (h->index);
-  HASH_NEXT (h, i) = HASH_INDEX (h, start_of_bucket);
-  HASH_INDEX (h, start_of_bucket) = make_number (i);
+  set_hash_next (h, i, HASH_INDEX (h, start_of_bucket));
+  set_hash_index (h, start_of_bucket, make_number (i));
   return i;
 }
 
@@ -3892,14 +3892,16 @@
        {
          /* Take entry out of collision chain.  */
          if (NILP (prev))
-           HASH_INDEX (h, start_of_bucket) = HASH_NEXT (h, i);
+           set_hash_index (h, start_of_bucket, HASH_NEXT (h, i));
          else
-           HASH_NEXT (h, XFASTINT (prev)) = HASH_NEXT (h, i);
+           set_hash_next (h, XFASTINT (prev), HASH_NEXT (h, i));
 
          /* Clear slots in key_and_value and add the slots to
             the free list.  */
-         HASH_KEY (h, i) = HASH_VALUE (h, i) = HASH_HASH (h, i) = Qnil;
-         HASH_NEXT (h, i) = h->next_free;
+         set_hash_key (h, i, Qnil);
+         set_hash_value (h, i, Qnil);
+         set_hash_hash (h, i, Qnil);
+         set_hash_next (h, i, h->next_free);
          h->next_free = make_number (i);
          h->count--;
          eassert (h->count >= 0);
@@ -3925,10 +3927,10 @@
 
       for (i = 0; i < size; ++i)
        {
-         HASH_NEXT (h, i) = i < size - 1 ? make_number (i + 1) : Qnil;
-         HASH_KEY (h, i) = Qnil;
-         HASH_VALUE (h, i) = Qnil;
-         HASH_HASH (h, i) = Qnil;
+         set_hash_next (h, i, i < size - 1 ? make_number (i + 1) : Qnil);
+         set_hash_key (h, i, Qnil);
+         set_hash_value (h, i, Qnil);
+         set_hash_hash (h, i, Qnil);
        }
 
       for (i = 0; i < ASIZE (h->index); ++i)
@@ -3992,17 +3994,18 @@
                {
                  /* Take out of collision chain.  */
                  if (NILP (prev))
-                   HASH_INDEX (h, bucket) = next;
+                   set_hash_index (h, bucket, next);
                  else
-                   HASH_NEXT (h, XFASTINT (prev)) = next;
+                   set_hash_next (h, XFASTINT (prev), next);
 
                  /* Add to free list.  */
-                 HASH_NEXT (h, i) = h->next_free;
+                 set_hash_next (h, i, h->next_free);
                  h->next_free = idx;
 
                  /* Clear key, value, and hash.  */
-                 HASH_KEY (h, i) = HASH_VALUE (h, i) = Qnil;
-                 HASH_HASH (h, i) = Qnil;
+                 set_hash_key (h, i, Qnil);
+                 set_hash_value (h, i, Qnil);
+                 set_hash_hash (h, i, Qnil);
 
                  h->count--;
                }
@@ -4509,7 +4512,7 @@
 
   i = hash_lookup (h, key, &hash);
   if (i >= 0)
-    HASH_VALUE (h, i) = value;
+    set_hash_value (h, i, value);
   else
     hash_put (h, key, value, hash);
 

=== modified file 'src/font.c'
--- a/src/font.c        2012-08-01 05:11:36 +0000
+++ b/src/font.c        2012-08-01 20:51:44 +0000
@@ -4722,7 +4722,7 @@
          Lisp_Object elt = AREF (object, XFASTINT (from) + i);
          CHECK_CHARACTER (elt);
        }
-      chars = &(AREF (object, XFASTINT (from)));
+      chars = aref_addr (object, XFASTINT (from));
     }
 
   vec = Fmake_vector (make_number (len), Qnil);

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2012-08-01 07:57:09 +0000
+++ b/src/keyboard.c    2012-08-01 20:51:44 +0000
@@ -5551,7 +5551,7 @@
            mouse_syms = larger_vector (mouse_syms, incr, -1);
          }
 
-       start_pos_ptr = &AREF (button_down_location, button);
+       start_pos_ptr = aref_addr (button_down_location, button);
        start_pos = *start_pos_ptr;
        *start_pos_ptr = Qnil;
 
@@ -5959,7 +5959,7 @@
            mouse_syms = larger_vector (mouse_syms, incr, -1);
          }
 
-       start_pos_ptr = &AREF (button_down_location, button);
+       start_pos_ptr = aref_addr (button_down_location, button);
        start_pos = *start_pos_ptr;
 
        position = make_lispy_position (f, event->x, event->y,
@@ -7525,8 +7525,8 @@
            tem2 = AREF (menu_bar_items_vector, i + 2);
            tem3 = AREF (menu_bar_items_vector, i + 3);
            if (end > i + 4)
-             memmove (&AREF (menu_bar_items_vector, i),
-                      &AREF (menu_bar_items_vector, i + 4),
+             memmove (aref_addr (menu_bar_items_vector, i),
+                      aref_addr (menu_bar_items_vector, i + 4),
                       (end - i - 4) * sizeof (Lisp_Object));
            ASET (menu_bar_items_vector, end - 4, tem0);
            ASET (menu_bar_items_vector, end - 3, tem1);
@@ -7575,8 +7575,8 @@
        if (EQ (key, AREF (menu_bar_items_vector, i)))
          {
            if (menu_bar_items_index > i + 4)
-             memmove (&AREF (menu_bar_items_vector, i),
-                      &AREF (menu_bar_items_vector, i + 4),
+             memmove (aref_addr (menu_bar_items_vector, i),
+                      aref_addr (menu_bar_items_vector, i + 4),
                       (menu_bar_items_index - i - 4) * sizeof (Lisp_Object));
            menu_bar_items_index -= 4;
          }
@@ -8096,6 +8096,14 @@
   UNGCPRO;
 }
 
+/* Access slot with index IDX of vector tool_bar_item_properties.  */
+#define PROP(IDX) AREF (tool_bar_item_properties, (IDX))
+static inline void
+set_prop (ptrdiff_t idx, Lisp_Object val)
+{
+  ASET (tool_bar_item_properties, idx, val);
+}
+
 
 /* Parse a tool bar item specification ITEM for key KEY and return the
    result in tool_bar_item_properties.  Value is zero if ITEM is
@@ -8146,9 +8154,6 @@
 static int
 parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
 {
-  /* Access slot with index IDX of vector tool_bar_item_properties.  */
-#define PROP(IDX) AREF (tool_bar_item_properties, (IDX))
-
   Lisp_Object filter = Qnil;
   Lisp_Object caption;
   int i, have_label = 0;
@@ -8172,15 +8177,15 @@
   if (VECTORP (tool_bar_item_properties))
     {
       for (i = 0; i < TOOL_BAR_ITEM_NSLOTS; ++i)
-       PROP (i) = Qnil;
+       set_prop (i, Qnil);
     }
   else
     tool_bar_item_properties
       = Fmake_vector (make_number (TOOL_BAR_ITEM_NSLOTS), Qnil);
 
   /* Set defaults.  */
-  PROP (TOOL_BAR_ITEM_KEY) = key;
-  PROP (TOOL_BAR_ITEM_ENABLED_P) = Qt;
+  set_prop (TOOL_BAR_ITEM_KEY, key);
+  set_prop (TOOL_BAR_ITEM_ENABLED_P, Qt);
 
   /* Get the caption of the item.  If the caption is not a string,
      evaluate it to get a string.  If we don't get a string, skip this
@@ -8192,7 +8197,7 @@
       if (!STRINGP (caption))
        return 0;
     }
-  PROP (TOOL_BAR_ITEM_CAPTION) = caption;
+  set_prop (TOOL_BAR_ITEM_CAPTION, caption);
 
   /* If the rest following the caption is not a list, the menu item is
      either a separator, or invalid.  */
@@ -8201,7 +8206,7 @@
     {
       if (menu_separator_name_p (SSDATA (caption)))
        {
-         PROP (TOOL_BAR_ITEM_TYPE) = Qt;
+         set_prop (TOOL_BAR_ITEM_TYPE, Qt);
 #if !defined (USE_GTK) && !defined (HAVE_NS)
          /* If we use build_desired_tool_bar_string to render the
             tool bar, the separator is rendered as an image.  */
@@ -8217,7 +8222,7 @@
     }
 
   /* Store the binding.  */
-  PROP (TOOL_BAR_ITEM_BINDING) = XCAR (item);
+  set_prop (TOOL_BAR_ITEM_BINDING, XCAR (item));
   item = XCDR (item);
 
   /* Ignore cached key binding, if any.  */
@@ -8236,9 +8241,9 @@
        {
          /* `:enable FORM'.  */
          if (!NILP (Venable_disabled_menus_and_buttons))
-           PROP (TOOL_BAR_ITEM_ENABLED_P) = Qt;
+           set_prop (TOOL_BAR_ITEM_ENABLED_P, Qt);
          else
-           PROP (TOOL_BAR_ITEM_ENABLED_P) = value;
+           set_prop (TOOL_BAR_ITEM_ENABLED_P, value);
        }
       else if (EQ (ikey, QCvisible))
        {
@@ -8249,17 +8254,16 @@
        }
       else if (EQ (ikey, QChelp))
         /* `:help HELP-STRING'.  */
-        PROP (TOOL_BAR_ITEM_HELP) = value;
+        set_prop (TOOL_BAR_ITEM_HELP, value);
       else if (EQ (ikey, QCvert_only))
         /* `:vert-only t/nil'.  */
-        PROP (TOOL_BAR_ITEM_VERT_ONLY) = value;
+        set_prop (TOOL_BAR_ITEM_VERT_ONLY, value);
       else if (EQ (ikey, QClabel))
         {
           const char *bad_label = "!!?GARBLED ITEM?!!";
           /* `:label LABEL-STRING'.  */
-          PROP (TOOL_BAR_ITEM_LABEL) = STRINGP (value)
-            ? value
-            : build_string (bad_label);
+          set_prop (TOOL_BAR_ITEM_LABEL,
+                   STRINGP (value) ? value : build_string (bad_label));
           have_label = 1;
         }
       else if (EQ (ikey, QCfilter))
@@ -8274,8 +8278,8 @@
          selected = XCDR (value);
          if (EQ (type, QCtoggle) || EQ (type, QCradio))
            {
-             PROP (TOOL_BAR_ITEM_SELECTED_P) = selected;
-             PROP (TOOL_BAR_ITEM_TYPE) = type;
+             set_prop (TOOL_BAR_ITEM_SELECTED_P, selected);
+             set_prop (TOOL_BAR_ITEM_TYPE, type);
            }
        }
       else if (EQ (ikey, QCimage)
@@ -8283,10 +8287,10 @@
                   || (VECTORP (value) && ASIZE (value) == 4)))
        /* Value is either a single image specification or a vector
           of 4 such specifications for the different button states.  */
-       PROP (TOOL_BAR_ITEM_IMAGES) = value;
+       set_prop (TOOL_BAR_ITEM_IMAGES, value);
       else if (EQ (ikey, QCrtl))
         /* ':rtl STRING' */
-       PROP (TOOL_BAR_ITEM_RTL_IMAGE) = value;
+       set_prop (TOOL_BAR_ITEM_RTL_IMAGE, value);
     }
 
 
@@ -8328,18 +8332,19 @@
 
       new_lbl = Fupcase_initials (build_string (label));
       if (SCHARS (new_lbl) <= tool_bar_max_label_size)
-        PROP (TOOL_BAR_ITEM_LABEL) = new_lbl;
+        set_prop (TOOL_BAR_ITEM_LABEL, new_lbl);
       else
-        PROP (TOOL_BAR_ITEM_LABEL) = empty_unibyte_string;
+        set_prop (TOOL_BAR_ITEM_LABEL, empty_unibyte_string);
       xfree (buf);
     }
 
   /* If got a filter apply it on binding.  */
   if (!NILP (filter))
-    PROP (TOOL_BAR_ITEM_BINDING)
-      = menu_item_eval_property (list2 (filter,
-                                       list2 (Qquote,
-                                              PROP (TOOL_BAR_ITEM_BINDING))));
+    set_prop (TOOL_BAR_ITEM_BINDING,
+             (menu_item_eval_property
+              (list2 (filter,
+                      list2 (Qquote,
+                             PROP (TOOL_BAR_ITEM_BINDING))))));
 
   /* See if the binding is a keymap.  Give up if it is.  */
   if (CONSP (get_keymap (PROP (TOOL_BAR_ITEM_BINDING), 0, 1)))
@@ -8347,13 +8352,13 @@
 
   /* Enable or disable selection of item.  */
   if (!EQ (PROP (TOOL_BAR_ITEM_ENABLED_P), Qt))
-    PROP (TOOL_BAR_ITEM_ENABLED_P)
-      = menu_item_eval_property (PROP (TOOL_BAR_ITEM_ENABLED_P));
+    set_prop (TOOL_BAR_ITEM_ENABLED_P,
+             menu_item_eval_property (PROP (TOOL_BAR_ITEM_ENABLED_P)));
 
   /* Handle radio buttons or toggle boxes.  */
   if (!NILP (PROP (TOOL_BAR_ITEM_SELECTED_P)))
-    PROP (TOOL_BAR_ITEM_SELECTED_P)
-      = menu_item_eval_property (PROP (TOOL_BAR_ITEM_SELECTED_P));
+    set_prop (TOOL_BAR_ITEM_SELECTED_P,
+             menu_item_eval_property (PROP (TOOL_BAR_ITEM_SELECTED_P)));
 
   return 1;
 

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2012-08-01 08:49:28 +0000
+++ b/src/lisp.h        2012-08-01 20:51:44 +0000
@@ -598,7 +598,7 @@
 #define ASET(ARRAY, IDX, VAL)  \
   (eassert ((IDX) == (IDX)),                           \
    eassert ((IDX) >= 0 && (IDX) < ASIZE (ARRAY)),      \
-   AREF ((ARRAY), (IDX)) = (VAL))
+   XVECTOR (ARRAY)->contents[IDX] = (VAL))
 
 /* Convenience macros for dealing with Lisp strings.  */
 
@@ -2336,6 +2336,44 @@
 struct window;
 struct frame;
 
+/* Simple access functions.  */
+
+static inline Lisp_Object *
+aref_addr (Lisp_Object array, ptrdiff_t idx)
+{
+  return & XVECTOR (array)->contents[idx];
+}
+
+static inline void
+set_hash_key (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
+{
+  ASET (h->key_and_value, 2 * idx, val);
+}
+
+static inline void
+set_hash_value (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
+{
+  ASET (h->key_and_value, 2 * idx + 1, val);
+}
+
+static inline void
+set_hash_next (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
+{
+  ASET (h->next, idx, val);
+}
+
+static inline void
+set_hash_hash (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
+{
+  ASET (h->hash, idx, val);
+}
+
+static inline void
+set_hash_index (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
+{
+  ASET (h->index, idx, val);
+}
+
 /* Defined in data.c.  */
 extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
 extern Lisp_Object Qerror_conditions, Qerror_message, Qtop_level;

=== modified file 'src/lread.c'
--- a/src/lread.c       2012-08-01 07:57:09 +0000
+++ b/src/lread.c       2012-08-01 20:51:44 +0000
@@ -3715,7 +3715,7 @@
       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 @@
   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
     {

=== modified file 'src/menu.c'
--- a/src/menu.c        2012-07-05 18:35:48 +0000
+++ b/src/menu.c        2012-08-01 20:51:44 +0000
@@ -1006,7 +1006,7 @@
         {
           entry
             = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
-          if (&AREF (menu_items, i) == client_data)
+          if (aref_addr (menu_items, i) == client_data)
             {
               if (keymaps != 0)
                 {

=== modified file 'src/nsmenu.m'
--- a/src/nsmenu.m      2012-08-01 20:15:30 +0000
+++ b/src/nsmenu.m      2012-08-01 20:51:44 +0000
@@ -222,7 +222,7 @@
 
       /* Save the frame's previous menu bar contents data */
       if (previous_menu_items_used)
-       memcpy (previous_items, &AREF (FVAR (f, menu_bar_vector), 0),
+       memcpy (previous_items, aref_addr (FVAR (f, menu_bar_vector), 0),
                previous_menu_items_used * sizeof (Lisp_Object));
 
       /* parse stage 1: extract from lisp */
@@ -939,8 +939,7 @@
          /* 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))
@@ -1453,7 +1452,7 @@
 
     unwind_data->pool = pool;
     unwind_data->dialog = dialog;
-    
+
     record_unwind_protect (pop_down_menu, make_save_value (unwind_data, 0));
     popup_activated_flag = 1;
     tem = [dialog runDialogAt: p];

=== modified file 'src/w32menu.c'
--- a/src/w32menu.c     2012-08-01 05:11:36 +0000
+++ b/src/w32menu.c     2012-08-01 20:51:44 +0000
@@ -1062,7 +1062,7 @@
        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;

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2012-08-01 05:11:36 +0000
+++ b/src/xfaces.c      2012-08-01 20:51:44 +0000
@@ -2182,14 +2182,14 @@
     {
       Lisp_Object family = AREF (font_object, FONT_FAMILY_INDEX);
 
-      LFACE_FAMILY (lface) = SYMBOL_NAME (family);
+      ASET (lface, LFACE_FAMILY_INDEX, SYMBOL_NAME (family));
     }
 
   if (force_p || UNSPECIFIEDP (LFACE_FOUNDRY (lface)))
     {
       Lisp_Object foundry = AREF (font_object, FONT_FOUNDRY_INDEX);
 
-      LFACE_FOUNDRY (lface) = SYMBOL_NAME (foundry);
+      ASET (lface, LFACE_FOUNDRY_INDEX, SYMBOL_NAME (foundry));
     }
 
   if (force_p || UNSPECIFIEDP (LFACE_HEIGHT (lface)))
@@ -2197,26 +2197,26 @@
       int pt = PIXEL_TO_POINT (font->pixel_size * 10, f->resy);
 
       eassert (pt > 0);
-      LFACE_HEIGHT (lface) = make_number (pt);
+      ASET (lface, LFACE_HEIGHT_INDEX, make_number (pt));
     }
 
   if (force_p || UNSPECIFIEDP (LFACE_WEIGHT (lface)))
     {
       val = FONT_WEIGHT_FOR_FACE (font_object);
-      LFACE_WEIGHT (lface) = ! NILP (val) ? val :Qnormal;
+      ASET (lface, LFACE_WEIGHT_INDEX, ! NILP (val) ? val :Qnormal);
     }
   if (force_p || UNSPECIFIEDP (LFACE_SLANT (lface)))
     {
       val = FONT_SLANT_FOR_FACE (font_object);
-      LFACE_SLANT (lface) = ! NILP (val) ? val : Qnormal;
+      ASET (lface, LFACE_SLANT_INDEX, ! NILP (val) ? val : Qnormal);
     }
   if (force_p || UNSPECIFIEDP (LFACE_SWIDTH (lface)))
     {
       val = FONT_WIDTH_FOR_FACE (font_object);
-      LFACE_SWIDTH (lface) = ! NILP (val) ? val : Qnormal;
+      ASET (lface, LFACE_SWIDTH_INDEX, ! NILP (val) ? val : Qnormal);
     }
 
-  LFACE_FONT (lface) = font_object;
+  ASET (lface, LFACE_FONT_INDEX, font_object);
   return 1;
 }
 
@@ -2851,7 +2851,7 @@
            signal_error ("Invalid face family", value);
        }
       old_value = LFACE_FAMILY (lface);
-      LFACE_FAMILY (lface) = value;
+      ASET (lface, LFACE_FAMILY_INDEX, value);
       prop_index = FONT_FAMILY_INDEX;
     }
   else if (EQ (attr, QCfoundry))
@@ -2863,7 +2863,7 @@
            signal_error ("Invalid face foundry", value);
        }
       old_value = LFACE_FOUNDRY (lface);
-      LFACE_FOUNDRY (lface) = value;
+      ASET (lface, LFACE_FOUNDRY_INDEX, value);
       prop_index = FONT_FOUNDRY_INDEX;
     }
   else if (EQ (attr, QCheight))
@@ -2891,7 +2891,7 @@
        }
 
       old_value = LFACE_HEIGHT (lface);
-      LFACE_HEIGHT (lface) = value;
+      ASET (lface, LFACE_HEIGHT_INDEX, value);
       prop_index = FONT_SIZE_INDEX;
     }
   else if (EQ (attr, QCweight))
@@ -2903,7 +2903,7 @@
            signal_error ("Invalid face weight", value);
        }
       old_value = LFACE_WEIGHT (lface);
-      LFACE_WEIGHT (lface) = value;
+      ASET (lface, LFACE_WEIGHT_INDEX, value);
       prop_index = FONT_WEIGHT_INDEX;
     }
   else if (EQ (attr, QCslant))
@@ -2915,7 +2915,7 @@
            signal_error ("Invalid face slant", value);
        }
       old_value = LFACE_SLANT (lface);
-      LFACE_SLANT (lface) = value;
+      ASET (lface, LFACE_SLANT_INDEX, value);
       prop_index = FONT_SLANT_INDEX;
     }
   else if (EQ (attr, QCunderline))
@@ -2969,7 +2969,7 @@
         signal_error ("Invalid face underline", value);
 
       old_value = LFACE_UNDERLINE (lface);
-      LFACE_UNDERLINE (lface) = value;
+      ASET (lface, LFACE_UNDERLINE_INDEX, value);
     }
   else if (EQ (attr, QCoverline))
     {
@@ -2983,7 +2983,7 @@
          signal_error ("Invalid face overline", value);
 
       old_value = LFACE_OVERLINE (lface);
-      LFACE_OVERLINE (lface) = value;
+      ASET (lface, LFACE_OVERLINE_INDEX, value);
     }
   else if (EQ (attr, QCstrike_through))
     {
@@ -2997,7 +2997,7 @@
          signal_error ("Invalid face strike-through", value);
 
       old_value = LFACE_STRIKE_THROUGH (lface);
-      LFACE_STRIKE_THROUGH (lface) = value;
+      ASET (lface, LFACE_STRIKE_THROUGH_INDEX, value);
     }
   else if (EQ (attr, QCbox))
     {
@@ -3060,7 +3060,7 @@
        signal_error ("Invalid face box", value);
 
       old_value = LFACE_BOX (lface);
-      LFACE_BOX (lface) = value;
+      ASET (lface, LFACE_BOX_INDEX, value);
     }
   else if (EQ (attr, QCinverse_video)
           || EQ (attr, QCreverse_video))
@@ -3072,7 +3072,7 @@
            signal_error ("Invalid inverse-video face attribute value", value);
        }
       old_value = LFACE_INVERSE (lface);
-      LFACE_INVERSE (lface) = value;
+      ASET (lface, LFACE_INVERSE_INDEX, value);
     }
   else if (EQ (attr, QCforeground))
     {
@@ -3089,7 +3089,7 @@
            signal_error ("Empty foreground color value", value);
        }
       old_value = LFACE_FOREGROUND (lface);
-      LFACE_FOREGROUND (lface) = value;
+      ASET (lface, LFACE_FOREGROUND_INDEX, value);
     }
   else if (EQ (attr, QCbackground))
     {
@@ -3106,7 +3106,7 @@
            signal_error ("Empty background color value", value);
        }
       old_value = LFACE_BACKGROUND (lface);
-      LFACE_BACKGROUND (lface) = value;
+      ASET (lface, LFACE_BACKGROUND_INDEX, value);
     }
   else if (EQ (attr, QCstipple))
     {
@@ -3116,7 +3116,7 @@
          && NILP (Fbitmap_spec_p (value)))
        signal_error ("Invalid stipple attribute", value);
       old_value = LFACE_STIPPLE (lface);
-      LFACE_STIPPLE (lface) = value;
+      ASET (lface, LFACE_STIPPLE_INDEX, value);
 #endif /* HAVE_X_WINDOWS || HAVE_NS */
     }
   else if (EQ (attr, QCwidth))
@@ -3128,7 +3128,7 @@
            signal_error ("Invalid face width", value);
        }
       old_value = LFACE_SWIDTH (lface);
-      LFACE_SWIDTH (lface) = value;
+      ASET (lface, LFACE_SWIDTH_INDEX, value);
       prop_index = FONT_WIDTH_INDEX;
     }
   else if (EQ (attr, QCfont))
@@ -3174,7 +3174,7 @@
              set_lface_from_font (f, lface, value, 1);
            }
          else
-           LFACE_FONT (lface) = value;
+           ASET (lface, LFACE_FONT_INDEX, value);
        }
 #endif /* HAVE_WINDOW_SYSTEM */
     }
@@ -3189,7 +3189,7 @@
          tmp = Fquery_fontset (value, Qnil);
          if (NILP (tmp))
            signal_error ("Invalid fontset name", value);
-         LFACE_FONTSET (lface) = value = tmp;
+         ASET (lface, LFACE_FONTSET_INDEX, value = tmp);
        }
 #endif /* HAVE_WINDOW_SYSTEM */
     }
@@ -3203,21 +3203,21 @@
          if (!SYMBOLP (XCAR (tail)))
            break;
       if (NILP (tail))
-       LFACE_INHERIT (lface) = value;
+       ASET (lface, LFACE_INHERIT_INDEX, value);
       else
        signal_error ("Invalid face inheritance", value);
     }
   else if (EQ (attr, QCbold))
     {
       old_value = LFACE_WEIGHT (lface);
-      LFACE_WEIGHT (lface) = NILP (value) ? Qnormal : Qbold;
+      ASET (lface, LFACE_WEIGHT_INDEX, NILP (value) ? Qnormal : Qbold);
       prop_index = FONT_WEIGHT_INDEX;
     }
   else if (EQ (attr, QCitalic))
     {
       attr = QCslant;
       old_value = LFACE_SLANT (lface);
-      LFACE_SLANT (lface) = NILP (value) ? Qnormal : Qitalic;
+      ASET (lface, LFACE_SLANT_INDEX, NILP (value) ? Qnormal : Qitalic);
       prop_index = FONT_SLANT_INDEX;
     }
   else
@@ -3365,8 +3365,8 @@
     {
       face = Qdefault;
       lface = lface_from_face_name (f, face, 1);
-      LFACE_FOREGROUND (lface) = (STRINGP (new_value)
-                                 ? new_value : Qunspecified);
+      ASET (lface, LFACE_FOREGROUND_INDEX,
+           (STRINGP (new_value) ? new_value : Qunspecified));
       realize_basic_faces (f);
     }
   else if (EQ (param, Qbackground_color))
@@ -3381,8 +3381,8 @@
 
       face = Qdefault;
       lface = lface_from_face_name (f, face, 1);
-      LFACE_BACKGROUND (lface) = (STRINGP (new_value)
-                                 ? new_value : Qunspecified);
+      ASET (lface, LFACE_BACKGROUND_INDEX,
+           (STRINGP (new_value) ? new_value : Qunspecified));
       realize_basic_faces (f);
     }
 #ifdef HAVE_WINDOW_SYSTEM
@@ -3390,22 +3390,22 @@
     {
       face = Qborder;
       lface = lface_from_face_name (f, face, 1);
-      LFACE_BACKGROUND (lface) = (STRINGP (new_value)
-                                 ? new_value : Qunspecified);
+      ASET (lface, LFACE_BACKGROUND_INDEX,
+           (STRINGP (new_value) ? new_value : Qunspecified));
     }
   else if (EQ (param, Qcursor_color))
     {
       face = Qcursor;
       lface = lface_from_face_name (f, face, 1);
-      LFACE_BACKGROUND (lface) = (STRINGP (new_value)
-                                 ? new_value : Qunspecified);
+      ASET (lface, LFACE_BACKGROUND_INDEX,
+           (STRINGP (new_value) ? new_value : Qunspecified));
     }
   else if (EQ (param, Qmouse_color))
     {
       face = Qmouse;
       lface = lface_from_face_name (f, face, 1);
-      LFACE_BACKGROUND (lface) = (STRINGP (new_value)
-                                 ? new_value : Qunspecified);
+      ASET (lface, LFACE_BACKGROUND_INDEX,
+           (STRINGP (new_value) ? new_value : Qunspecified));
     }
 #endif
 
@@ -3445,7 +3445,7 @@
          font = font_load_for_lface (f, XVECTOR (lface)->contents, font);
          if (NILP (font))
            return;
-         LFACE_FONT (lface) = font;
+         ASET (lface, LFACE_FONT_INDEX, font);
        }
       f->default_face_done_p = 0;
       Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font), Qnil));
@@ -5366,39 +5366,39 @@
 
       XSETFONT (font_object, FRAME_FONT (f));
       set_lface_from_font (f, lface, font_object, f->default_face_done_p);
-      LFACE_FONTSET (lface) = fontset_name (FRAME_FONTSET (f));
+      ASET (lface, LFACE_FONTSET_INDEX, fontset_name (FRAME_FONTSET (f)));
       f->default_face_done_p = 1;
     }
 #endif /* HAVE_WINDOW_SYSTEM */
 
   if (!FRAME_WINDOW_P (f))
     {
-      LFACE_FAMILY (lface) = build_string ("default");
-      LFACE_FOUNDRY (lface) = LFACE_FAMILY (lface);
-      LFACE_SWIDTH (lface) = Qnormal;
-      LFACE_HEIGHT (lface) = make_number (1);
+      ASET (lface, LFACE_FAMILY_INDEX, build_string ("default"));
+      ASET (lface, LFACE_FOUNDRY_INDEX, LFACE_FAMILY (lface));
+      ASET (lface, LFACE_SWIDTH_INDEX, Qnormal);
+      ASET (lface, LFACE_HEIGHT_INDEX, make_number (1));
       if (UNSPECIFIEDP (LFACE_WEIGHT (lface)))
-       LFACE_WEIGHT (lface) = Qnormal;
+       ASET (lface, LFACE_WEIGHT_INDEX, Qnormal);
       if (UNSPECIFIEDP (LFACE_SLANT (lface)))
-       LFACE_SLANT (lface) = Qnormal;
+       ASET (lface, LFACE_SLANT_INDEX, Qnormal);
       if (UNSPECIFIEDP (LFACE_FONTSET (lface)))
-       LFACE_FONTSET (lface) = Qnil;
+       ASET (lface, LFACE_FONTSET_INDEX, Qnil);
     }
 
   if (UNSPECIFIEDP (LFACE_UNDERLINE (lface)))
-    LFACE_UNDERLINE (lface) = Qnil;
+    ASET (lface, LFACE_UNDERLINE_INDEX, Qnil);
 
   if (UNSPECIFIEDP (LFACE_OVERLINE (lface)))
-    LFACE_OVERLINE (lface) = Qnil;
+    ASET (lface, LFACE_OVERLINE_INDEX, Qnil);
 
   if (UNSPECIFIEDP (LFACE_STRIKE_THROUGH (lface)))
-    LFACE_STRIKE_THROUGH (lface) = Qnil;
+    ASET (lface, LFACE_STRIKE_THROUGH_INDEX, Qnil);
 
   if (UNSPECIFIEDP (LFACE_BOX (lface)))
-    LFACE_BOX (lface) = Qnil;
+    ASET (lface, LFACE_BOX_INDEX, Qnil);
 
   if (UNSPECIFIEDP (LFACE_INVERSE (lface)))
-    LFACE_INVERSE (lface) = Qnil;
+    ASET (lface, LFACE_INVERSE_INDEX, Qnil);
 
   if (UNSPECIFIEDP (LFACE_FOREGROUND (lface)))
     {
@@ -5407,11 +5407,11 @@
       Lisp_Object color = Fassq (Qforeground_color, FVAR (f, param_alist));
 
       if (CONSP (color) && STRINGP (XCDR (color)))
-       LFACE_FOREGROUND (lface) = XCDR (color);
+       ASET (lface, LFACE_FOREGROUND_INDEX, XCDR (color));
       else if (FRAME_WINDOW_P (f))
        return 0;
       else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
-       LFACE_FOREGROUND (lface) = build_string (unspecified_fg);
+       ASET (lface, LFACE_FOREGROUND_INDEX, build_string (unspecified_fg));
       else
        abort ();
     }
@@ -5422,17 +5422,17 @@
         set in the frame parameter list.  */
       Lisp_Object color = Fassq (Qbackground_color, FVAR (f, param_alist));
       if (CONSP (color) && STRINGP (XCDR (color)))
-       LFACE_BACKGROUND (lface) = XCDR (color);
+       ASET (lface, LFACE_BACKGROUND_INDEX, XCDR (color));
       else if (FRAME_WINDOW_P (f))
        return 0;
       else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
-       LFACE_BACKGROUND (lface) = build_string (unspecified_bg);
+       ASET (lface, LFACE_BACKGROUND_INDEX, build_string (unspecified_bg));
       else
        abort ();
     }
 
   if (UNSPECIFIEDP (LFACE_STIPPLE (lface)))
-    LFACE_STIPPLE (lface) = Qnil;
+    ASET (lface, LFACE_STIPPLE_INDEX, Qnil);
 
   /* Realize the face; it must be fully-specified now.  */
   eassert (lface_fully_specified_p (XVECTOR (lface)->contents));

=== modified file 'src/xfont.c'
--- a/src/xfont.c       2012-07-11 06:14:19 +0000
+++ b/src/xfont.c       2012-08-01 20:51:44 +0000
@@ -463,11 +463,11 @@
                list = Fcons (entity, list);
              continue;
            }
-         if (memcmp (props, &(AREF (entity, FONT_FOUNDRY_INDEX)),
+         if (memcmp (props, aref_addr (entity, FONT_FOUNDRY_INDEX),
                      sizeof (Lisp_Object) * 7)
              || ! EQ (AREF (entity, FONT_SPACING_INDEX), props[7]))
            {
-             memcpy (props, &(AREF (entity, FONT_FOUNDRY_INDEX)),
+             memcpy (props, aref_addr (entity, FONT_FOUNDRY_INDEX),
                      sizeof (Lisp_Object) * 7);
              props[7] = AREF (entity, FONT_SPACING_INDEX);
              scripts = xfont_supported_scripts (display, indices[i],

=== modified file 'src/xmenu.c'
--- a/src/xmenu.c       2012-08-01 05:11:36 +0000
+++ b/src/xmenu.c       2012-08-01 20:51:44 +0000
@@ -1782,8 +1782,7 @@
          /* 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 @@
            {
              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 @@
        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 @@
            {
              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)
                    {


reply via email to

[Prev in Thread] Current Thread [Next in Thread]