Commit 28be1ada authored by Dmitry Antipov's avatar Dmitry Antipov

* alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:

* font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
* print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
access to `contents' member of Lisp_Vector objects with AREF and ASET
where appropriate.
parent 68f12411
2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
* alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
* font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
* print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
access to `contents' member of Lisp_Vector objects with AREF and ASET
where appropriate.
2012-06-19 Chong Yidong <cyd@gnu.org>
* frame.c (delete_frame): When selecting a frame on a different
......
......@@ -5294,7 +5294,7 @@ Does not copy symbols. Copies strings without text properties. */)
size &= PSEUDOVECTOR_SIZE_MASK;
vec = XVECTOR (make_pure_vector (size));
for (i = 0; i < size; i++)
vec->contents[i] = Fpurecopy (XVECTOR (obj)->contents[i]);
vec->contents[i] = Fpurecopy (AREF (obj, i));
if (COMPILEDP (obj))
{
XSETPVECTYPE (vec, PVEC_COMPILED);
......
......@@ -1867,8 +1867,8 @@ integer, it is incremented each time that symbol's function is called. */);
{
int i = 256;
while (i--)
XVECTOR (Vbyte_code_meter)->contents[i] =
Fmake_vector (make_number (256), make_number (0));
ASET (Vbyte_code_meter, i,
Fmake_vector (make_number (256), make_number (0)));
}
#endif
}
......@@ -61,7 +61,7 @@ static Lisp_Object Vccl_program_table;
/* Return a hash table of id number ID. */
#define GET_HASH_TABLE(id) \
(XHASH_TABLE (XCDR (XVECTOR (Vtranslation_hash_table_vector)->contents[(id)])))
(XHASH_TABLE (XCDR (AREF (Vtranslation_hash_table_vector, (id)))))
/* CCL (Code Conversion Language) is a simple language which has
operations on one input buffer, one output buffer, and 7 registers.
......
......@@ -3189,7 +3189,7 @@ detect_coding_iso_2022 (struct coding_system *coding,
break;
check_extra_latin:
if (! VECTORP (Vlatin_extra_code_table)
|| NILP (XVECTOR (Vlatin_extra_code_table)->contents[c]))
|| NILP (AREF (Vlatin_extra_code_table, c)))
{
rejected = CATEGORY_MASK_ISO;
break;
......@@ -5464,7 +5464,7 @@ detect_coding_charset (struct coding_system *coding,
if (c < 0xA0
&& check_latin_extra
&& (!VECTORP (Vlatin_extra_code_table)
|| NILP (XVECTOR (Vlatin_extra_code_table)->contents[c])))
|| NILP (AREF (Vlatin_extra_code_table, c))))
break;
found = CATEGORY_MASK_CHARSET;
}
......@@ -10560,7 +10560,7 @@ Don't modify this variable directly, but use `set-coding-system-priority'. */);
Vcoding_category_list = Qnil;
for (i = coding_category_max - 1; i >= 0; i--)
Vcoding_category_list
= Fcons (XVECTOR (Vcoding_category_table)->contents[i],
= Fcons (AREF (Vcoding_category_table, i),
Vcoding_category_list);
}
......
......@@ -240,13 +240,13 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars,
for (i = 0; i < nchars; i++)
{
FETCH_STRING_CHAR_ADVANCE (ch, string, charpos, bytepos);
XVECTOR (key)->contents[i] = make_number (ch);
ASET (key, i, make_number (ch));
}
else
for (i = 0; i < nchars; i++)
{
FETCH_CHAR_ADVANCE (ch, charpos, bytepos);
XVECTOR (key)->contents[i] = make_number (ch);
ASET (key, i, make_number (ch));
}
}
else
......
......@@ -2134,7 +2134,7 @@ bool-vector. IDX starts at 0. */)
{
if (idxval < 0 || idxval >= ASIZE (array))
args_out_of_range (array, idx);
XVECTOR (array)->contents[idxval] = newelt;
ASET (array, idxval, newelt);
}
else if (BOOL_VECTOR_P (array))
{
......
......@@ -65,27 +65,27 @@ REGISTERS should be a vector produced by `make-register' and
if (no < 0 || no > 0xff || ASIZE (registers) != 8)
return Qnil;
for (i = 0; i < 8; i++)
CHECK_NUMBER (XVECTOR (registers)->contents[i]);
CHECK_NUMBER (AREF (registers, i));
inregs.x.ax = (unsigned long) XFASTINT (XVECTOR (registers)->contents[0]);
inregs.x.bx = (unsigned long) XFASTINT (XVECTOR (registers)->contents[1]);
inregs.x.cx = (unsigned long) XFASTINT (XVECTOR (registers)->contents[2]);
inregs.x.dx = (unsigned long) XFASTINT (XVECTOR (registers)->contents[3]);
inregs.x.si = (unsigned long) XFASTINT (XVECTOR (registers)->contents[4]);
inregs.x.di = (unsigned long) XFASTINT (XVECTOR (registers)->contents[5]);
inregs.x.cflag = (unsigned long) XFASTINT (XVECTOR (registers)->contents[6]);
inregs.x.flags = (unsigned long) XFASTINT (XVECTOR (registers)->contents[7]);
inregs.x.ax = (unsigned long) XFASTINT (AREF (registers, 0));
inregs.x.bx = (unsigned long) XFASTINT (AREF (registers, 1));
inregs.x.cx = (unsigned long) XFASTINT (AREF (registers, 2));
inregs.x.dx = (unsigned long) XFASTINT (AREF (registers, 3));
inregs.x.si = (unsigned long) XFASTINT (AREF (registers, 4));
inregs.x.di = (unsigned long) XFASTINT (AREF (registers, 5));
inregs.x.cflag = (unsigned long) XFASTINT (AREF (registers, 6));
inregs.x.flags = (unsigned long) XFASTINT (AREF (registers, 7));
int86 (no, &inregs, &outregs);
XVECTOR (registers)->contents[0] = make_number (outregs.x.ax);
XVECTOR (registers)->contents[1] = make_number (outregs.x.bx);
XVECTOR (registers)->contents[2] = make_number (outregs.x.cx);
XVECTOR (registers)->contents[3] = make_number (outregs.x.dx);
XVECTOR (registers)->contents[4] = make_number (outregs.x.si);
XVECTOR (registers)->contents[5] = make_number (outregs.x.di);
XVECTOR (registers)->contents[6] = make_number (outregs.x.cflag);
XVECTOR (registers)->contents[7] = make_number (outregs.x.flags);
ASET (registers, 0, make_number (outregs.x.ax));
ASET (registers, 1, make_number (outregs.x.bx));
ASET (registers, 2, make_number (outregs.x.cx));
ASET (registers, 3, make_number (outregs.x.dx));
ASET (registers, 4, make_number (outregs.x.si));
ASET (registers, 5, make_number (outregs.x.di));
ASET (registers, 6, make_number (outregs.x.cflag));
ASET (registers, 7, make_number (outregs.x.flags));
return registers;
}
......@@ -109,7 +109,7 @@ Return the updated VECTOR. */)
dosmemget (offs, len, buf);
for (i = 0; i < len; i++)
XVECTOR (vector)->contents[i] = make_number (buf[i]);
ASET (vector, i, make_number (buf[i]));
return vector;
}
......@@ -132,8 +132,8 @@ DEFUN ("msdos-memput", Fdos_memput, Sdos_memput, 2, 2, 0,
for (i = 0; i < len; i++)
{
CHECK_NUMBER (XVECTOR (vector)->contents[i]);
buf[i] = (unsigned char) XFASTINT (XVECTOR (vector)->contents[i]) & 0xFF;
CHECK_NUMBER (AREF (vector, i));
buf[i] = (unsigned char) XFASTINT (AREF (vector, i)) & 0xFF;
}
dosmemput (buf, len, offs);
......
......@@ -4877,13 +4877,13 @@ If the named font is not yet loaded, return nil. */)
font = XFONT_OBJECT (font_object);
info = Fmake_vector (make_number (7), Qnil);
XVECTOR (info)->contents[0] = AREF (font_object, FONT_NAME_INDEX);
XVECTOR (info)->contents[1] = AREF (font_object, FONT_FULLNAME_INDEX);
XVECTOR (info)->contents[2] = make_number (font->pixel_size);
XVECTOR (info)->contents[3] = make_number (font->height);
XVECTOR (info)->contents[4] = make_number (font->baseline_offset);
XVECTOR (info)->contents[5] = make_number (font->relative_compose);
XVECTOR (info)->contents[6] = make_number (font->default_ascent);
ASET (info, 0, AREF (font_object, FONT_NAME_INDEX));
ASET (info, 1, AREF (font_object, FONT_FULLNAME_INDEX));
ASET (info, 2, make_number (font->pixel_size));
ASET (info, 3, make_number (font->height));
ASET (info, 4, make_number (font->baseline_offset));
ASET (info, 5, make_number (font->relative_compose));
ASET (info, 6, make_number (font->default_ascent));
#if 0
/* As font_object is still in FONT_OBJLIST of the entity, we can't
......
......@@ -2366,7 +2366,7 @@ xbm_image_p (Lisp_Object object)
for one line of the image. */
for (i = 0; i < height; ++i)
{
Lisp_Object elt = XVECTOR (data)->contents[i];
Lisp_Object elt = AREF (data, i);
if (STRINGP (elt))
{
......@@ -2939,7 +2939,7 @@ xbm_load (struct frame *f, struct image *img)
p = bits = (char *) alloca (nbytes * img->height);
for (i = 0; i < img->height; ++i, p += nbytes)
{
Lisp_Object line = XVECTOR (data)->contents[i];
Lisp_Object line = AREF (data, i);
if (STRINGP (line))
memcpy (p, SDATA (line), nbytes);
else
......@@ -3749,7 +3749,7 @@ xpm_put_color_table_v (Lisp_Object color_table,
int chars_len,
Lisp_Object color)
{
XVECTOR (color_table)->contents[*chars_start] = color;
ASET (color_table, *chars_start, color);
}
static Lisp_Object
......@@ -3757,7 +3757,7 @@ xpm_get_color_table_v (Lisp_Object color_table,
const unsigned char *chars_start,
int chars_len)
{
return XVECTOR (color_table)->contents[*chars_start];
return AREF (color_table, *chars_start);
}
static Lisp_Object
......@@ -8503,7 +8503,7 @@ gs_image_p (Lisp_Object object)
if (ASIZE (tem) != 4)
return 0;
for (i = 0; i < 4; ++i)
if (!INTEGERP (XVECTOR (tem)->contents[i]))
if (!INTEGERP (AREF (tem, i)))
return 0;
}
else
......
......@@ -625,7 +625,7 @@ echo_now (void)
if (i == this_single_command_key_start)
before_command_echo_length = echo_length ();
c = XVECTOR (this_command_keys)->contents[i];
c = AREF (this_command_keys, i);
if (! (EVENT_HAS_PARAMETERS (c)
&& EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qmouse_movement)))
echo_char (c);
......@@ -4269,7 +4269,7 @@ timer_start_idle (void)
if (!VECTORP (timer) || ASIZE (timer) != 8)
continue;
XVECTOR (timer)->contents[0] = Qnil;
ASET (timer, 0, Qnil);
}
}
......@@ -6272,7 +6272,7 @@ lispy_modifier_list (int modifiers)
modifier_list = Qnil;
for (i = 0; (1<<i) <= modifiers && i < NUM_MOD_NAMES; i++)
if (modifiers & (1<<i))
modifier_list = Fcons (XVECTOR (modifier_symbols)->contents[i],
modifier_list = Fcons (AREF (modifier_symbols, i),
modifier_list);
return modifier_list;
......@@ -6503,7 +6503,7 @@ modify_event_symbol (ptrdiff_t symbol_num, int modifiers, Lisp_Object symbol_kin
*symbol_table = Fmake_vector (size, Qnil);
}
value = XVECTOR (*symbol_table)->contents[symbol_num];
value = AREF (*symbol_table, symbol_num);
}
/* Have we already used this symbol before? */
......@@ -6546,7 +6546,7 @@ modify_event_symbol (ptrdiff_t symbol_num, int modifiers, Lisp_Object symbol_kin
if (CONSP (*symbol_table))
*symbol_table = Fcons (Fcons (symbol_int, value), *symbol_table);
else
XVECTOR (*symbol_table)->contents[symbol_num] = value;
ASET (*symbol_table, symbol_num, value);
/* Fill in the cache entries for this symbol; this also
builds the Qevent_symbol_elements property, which the user
......@@ -7553,23 +7553,23 @@ menu_bar_items (Lisp_Object old)
int end = menu_bar_items_index;
for (i = 0; i < end; i += 4)
if (EQ (XCAR (tail), XVECTOR (menu_bar_items_vector)->contents[i]))
if (EQ (XCAR (tail), AREF (menu_bar_items_vector, i)))
{
Lisp_Object tem0, tem1, tem2, tem3;
/* Move the item at index I to the end,
shifting all the others forward. */
tem0 = XVECTOR (menu_bar_items_vector)->contents[i + 0];
tem1 = XVECTOR (menu_bar_items_vector)->contents[i + 1];
tem2 = XVECTOR (menu_bar_items_vector)->contents[i + 2];
tem3 = XVECTOR (menu_bar_items_vector)->contents[i + 3];
tem0 = AREF (menu_bar_items_vector, i + 0);
tem1 = AREF (menu_bar_items_vector, i + 1);
tem2 = AREF (menu_bar_items_vector, i + 2);
tem3 = AREF (menu_bar_items_vector, i + 3);
if (end > i + 4)
memmove (&XVECTOR (menu_bar_items_vector)->contents[i],
&XVECTOR (menu_bar_items_vector)->contents[i + 4],
memmove (&AREF (menu_bar_items_vector, i),
&AREF (menu_bar_items_vector, i + 4),
(end - i - 4) * sizeof (Lisp_Object));
XVECTOR (menu_bar_items_vector)->contents[end - 4] = tem0;
XVECTOR (menu_bar_items_vector)->contents[end - 3] = tem1;
XVECTOR (menu_bar_items_vector)->contents[end - 2] = tem2;
XVECTOR (menu_bar_items_vector)->contents[end - 1] = tem3;
ASET (menu_bar_items_vector, end - 4, tem0);
ASET (menu_bar_items_vector, end - 3, tem1);
ASET (menu_bar_items_vector, end - 2, tem2);
ASET (menu_bar_items_vector, end - 1, tem3);
break;
}
}
......@@ -7581,10 +7581,10 @@ menu_bar_items (Lisp_Object old)
menu_bar_items_vector =
larger_vector (menu_bar_items_vector, 4, -1);
/* Add this item. */
XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
ASET (menu_bar_items_vector, i, Qnil), i++;
ASET (menu_bar_items_vector, i, Qnil), i++;
ASET (menu_bar_items_vector, i, Qnil), i++;
ASET (menu_bar_items_vector, i, Qnil), i++;
menu_bar_items_index = i;
}
......@@ -7610,11 +7610,11 @@ menu_bar_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy1, void *dumm
discard any previously made menu bar item. */
for (i = 0; i < menu_bar_items_index; i += 4)
if (EQ (key, XVECTOR (menu_bar_items_vector)->contents[i]))
if (EQ (key, AREF (menu_bar_items_vector, i)))
{
if (menu_bar_items_index > i + 4)
memmove (&XVECTOR (menu_bar_items_vector)->contents[i],
&XVECTOR (menu_bar_items_vector)->contents[i + 4],
memmove (&AREF (menu_bar_items_vector, i),
&AREF (menu_bar_items_vector, i + 4),
(menu_bar_items_index - i - 4) * sizeof (Lisp_Object));
menu_bar_items_index -= 4;
}
......@@ -7638,11 +7638,11 @@ menu_bar_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy1, void *dumm
if (!i)
return;
item = XVECTOR (item_properties)->contents[ITEM_PROPERTY_DEF];
item = AREF (item_properties, ITEM_PROPERTY_DEF);
/* Find any existing item for this KEY. */
for (i = 0; i < menu_bar_items_index; i += 4)
if (EQ (key, XVECTOR (menu_bar_items_vector)->contents[i]))
if (EQ (key, AREF (menu_bar_items_vector, i)))
break;
/* If we did not find this KEY, add it at the end. */
......@@ -7652,22 +7652,22 @@ menu_bar_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy1, void *dumm
if (i + 4 > ASIZE (menu_bar_items_vector))
menu_bar_items_vector = larger_vector (menu_bar_items_vector, 4, -1);
/* Add this item. */
XVECTOR (menu_bar_items_vector)->contents[i++] = key;
XVECTOR (menu_bar_items_vector)->contents[i++]
= XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME];
XVECTOR (menu_bar_items_vector)->contents[i++] = Fcons (item, Qnil);
XVECTOR (menu_bar_items_vector)->contents[i++] = make_number (0);
ASET (menu_bar_items_vector, i, key), i++;
ASET (menu_bar_items_vector, i,
AREF (item_properties, ITEM_PROPERTY_NAME)), i++;
ASET (menu_bar_items_vector, i, Fcons (item, Qnil)), i++;
ASET (menu_bar_items_vector, i, make_number (0)), i++;
menu_bar_items_index = i;
}
/* We did find an item for this KEY. Add ITEM to its list of maps. */
else
{
Lisp_Object old;
old = XVECTOR (menu_bar_items_vector)->contents[i + 2];
old = AREF (menu_bar_items_vector, i + 2);
/* If the new and the old items are not both keymaps,
the lookup will only find `item'. */
item = Fcons (item, KEYMAPP (item) && KEYMAPP (XCAR (old)) ? old : Qnil);
XVECTOR (menu_bar_items_vector)->contents[i + 2] = item;
ASET (menu_bar_items_vector, i + 2, item);
}
}
......@@ -8184,7 +8184,7 @@ 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) XVECTOR (tool_bar_item_properties)->contents[IDX]
#define PROP(IDX) AREF (tool_bar_item_properties, (IDX))
Lisp_Object filter = Qnil;
Lisp_Object caption;
......@@ -8629,7 +8629,7 @@ read_char_minibuf_menu_prompt (int commandflag,
/* Look at the next element of the map. */
if (idx >= 0)
elt = XVECTOR (vector)->contents[idx];
elt = AREF (vector, idx);
else
elt = Fcar_safe (rest);
......@@ -8664,7 +8664,7 @@ read_char_minibuf_menu_prompt (int commandflag,
Lisp_Object upcased_event, downcased_event;
Lisp_Object desc = Qnil;
Lisp_Object s
= XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME];
= AREF (item_properties, ITEM_PROPERTY_NAME);
upcased_event = Fupcase (event);
downcased_event = Fdowncase (event);
......@@ -8682,12 +8682,12 @@ read_char_minibuf_menu_prompt (int commandflag,
s = concat2 (s, tem);
#endif
tem
= XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE];
= AREF (item_properties, ITEM_PROPERTY_TYPE);
if (EQ (tem, QCradio) || EQ (tem, QCtoggle))
{
/* Insert button prefix. */
Lisp_Object selected
= XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED];
= AREF (item_properties, ITEM_PROPERTY_SELECTED);
if (EQ (tem, QCradio))
tem = build_string (NILP (selected) ? "(*) " : "( ) ");
else
......@@ -9457,7 +9457,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
&& current_buffer != starting_buffer)
{
GROW_RAW_KEYBUF;
XVECTOR (raw_keybuf)->contents[raw_keybuf_count++] = key;
ASET (raw_keybuf, raw_keybuf_count, key), raw_keybuf_count++;
keybuf[t++] = key;
mock_input = t;
Vquit_flag = Qnil;
......@@ -9535,7 +9535,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
&& BUFFERP (XWINDOW (window)->buffer)
&& XBUFFER (XWINDOW (window)->buffer) != current_buffer)
{
XVECTOR (raw_keybuf)->contents[raw_keybuf_count++] = key;
ASET (raw_keybuf, raw_keybuf_count, key), raw_keybuf_count++;
keybuf[t] = key;
mock_input = t + 1;
......@@ -10566,7 +10566,7 @@ KEEP-RECORD is non-nil. */)
if (NILP (keep_record))
{
for (i = 0; i < ASIZE (recent_keys); ++i)
XVECTOR (recent_keys)->contents[i] = Qnil;
ASET (recent_keys, i, Qnil);
total_keys = 0;
recent_keys_index = 0;
}
......@@ -11585,7 +11585,7 @@ syms_of_keyboard (void)
modifier_symbols = Fmake_vector (make_number (len), Qnil);
for (i = 0; i < len; i++)
if (modifier_names[i])
XVECTOR (modifier_symbols)->contents[i] = intern_c_string (modifier_names[i]);
ASET (modifier_symbols, i, intern_c_string (modifier_names[i]));
staticpro (&modifier_symbols);
}
......
......@@ -3748,7 +3748,7 @@ it defaults to the value of `obarray'. */)
SET_SYMBOL_VAL (XSYMBOL (sym), sym);
}
ptr = &XVECTOR (obarray)->contents[XINT (tem)];
ptr = &AREF (obarray, XINT(tem));
if (SYMBOLP (*ptr))
XSYMBOL (sym)->next = XSYMBOL (*ptr);
else
......@@ -3827,18 +3827,18 @@ OBARRAY defaults to the value of the variable `obarray'. */)
hash = oblookup_last_bucket_number;
if (EQ (XVECTOR (obarray)->contents[hash], tem))
if (EQ (AREF (obarray, hash), tem))
{
if (XSYMBOL (tem)->next)
XSETSYMBOL (XVECTOR (obarray)->contents[hash], XSYMBOL (tem)->next);
XSETSYMBOL (AREF (obarray, hash), XSYMBOL (tem)->next);
else
XSETINT (XVECTOR (obarray)->contents[hash], 0);
XSETINT (AREF (obarray, hash), 0);
}
else
{
Lisp_Object tail, following;
for (tail = XVECTOR (obarray)->contents[hash];
for (tail = AREF (obarray, hash);
XSYMBOL (tail)->next;
tail = following)
{
......@@ -3877,7 +3877,7 @@ oblookup (Lisp_Object obarray, register const char *ptr, ptrdiff_t size, ptrdiff
/* This is sometimes needed in the middle of GC. */
obsize &= ~ARRAY_MARK_FLAG;
hash = hash_string (ptr, size_byte) % obsize;
bucket = XVECTOR (obarray)->contents[hash];
bucket = AREF (obarray, hash);
oblookup_last_bucket_number = hash;
if (EQ (bucket, make_number (0)))
;
......@@ -3905,7 +3905,7 @@ map_obarray (Lisp_Object obarray, void (*fn) (Lisp_Object, Lisp_Object), Lisp_Ob
CHECK_VECTOR (obarray);
for (i = ASIZE (obarray) - 1; i >= 0; i--)
{
tail = XVECTOR (obarray)->contents[i];
tail = AREF (obarray, i);
if (SYMBOLP (tail))
while (1)
{
......
......@@ -197,7 +197,7 @@ static void
push_submenu_start (void)
{
ensure_menu_items (1);
XVECTOR (menu_items)->contents[menu_items_used++] = Qnil;
ASET (menu_items, menu_items_used, Qnil), menu_items_used++;
menu_items_submenu_depth++;
}
......@@ -207,7 +207,7 @@ static void
push_submenu_end (void)
{
ensure_menu_items (1);
XVECTOR (menu_items)->contents[menu_items_used++] = Qlambda;
ASET (menu_items, menu_items_used, Qlambda), menu_items_used++;
menu_items_submenu_depth--;
}
......@@ -219,7 +219,7 @@ static void
push_left_right_boundary (void)
{
ensure_menu_items (1);
XVECTOR (menu_items)->contents[menu_items_used++] = Qquote;
ASET (menu_items, menu_items_used, Qquote), menu_items_used++;
}
/* Start a new menu pane in menu_items.
......@@ -231,9 +231,9 @@ push_menu_pane (Lisp_Object name, Lisp_Object prefix_vec)
ensure_menu_items (MENU_ITEMS_PANE_LENGTH);
if (menu_items_submenu_depth == 0)
menu_items_n_panes++;
XVECTOR (menu_items)->contents[menu_items_used++] = Qt;
XVECTOR (menu_items)->contents[menu_items_used++] = name;
XVECTOR (menu_items)->contents[menu_items_used++] = prefix_vec;
ASET (menu_items, menu_items_used, Qt), menu_items_used++;
ASET (menu_items, menu_items_used, name), menu_items_used++;
ASET (menu_items, menu_items_used, prefix_vec), menu_items_used++;
}
/* Push one menu item into the current pane. NAME is the string to
......@@ -343,10 +343,10 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
if (!res)
return; /* Not a menu item. */
map = XVECTOR (item_properties)->contents[ITEM_PROPERTY_MAP];
map = AREF (item_properties, ITEM_PROPERTY_MAP);
enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE];
item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME];
enabled = AREF (item_properties, ITEM_PROPERTY_ENABLE);
item_string = AREF (item_properties, ITEM_PROPERTY_NAME);
if (!NILP (map) && SREF (item_string, 0) == '@')
{
......@@ -363,11 +363,11 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
front of them. */
{
Lisp_Object prefix = Qnil;
Lisp_Object type = XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE];
Lisp_Object type = AREF (item_properties, ITEM_PROPERTY_TYPE);
if (!NILP (type))
{
Lisp_Object selected
= XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED];
= AREF (item_properties, ITEM_PROPERTY_SELECTED);
if (skp->notbuttons)
/* The first button. Line up previous items in this menu. */
......@@ -378,7 +378,7 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
while (idx < menu_items_used)
{
tem
= XVECTOR (menu_items)->contents[idx + MENU_ITEMS_ITEM_NAME];
= AREF (menu_items, idx + MENU_ITEMS_ITEM_NAME);
if (NILP (tem))
{
idx++;
......@@ -397,8 +397,8 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
{
if (!submenu && SREF (tem, 0) != '\0'
&& SREF (tem, 0) != '-')
XVECTOR (menu_items)->contents[idx + MENU_ITEMS_ITEM_NAME]
= concat2 (build_string (" "), tem);
ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME,
concat2 (build_string (" "), tem));
idx += MENU_ITEMS_ITEM_LENGTH;
}
}
......@@ -430,11 +430,11 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
#endif /* HAVE_X_WINDOWS || MSDOS */
push_menu_item (item_string, enabled, key,
XVECTOR (item_properties)->contents[ITEM_PROPERTY_DEF],
XVECTOR (item_properties)->contents[ITEM_PROPERTY_KEYEQ],
XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE],
XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED],
XVECTOR (item_properties)->contents[ITEM_PROPERTY_HELP]);
AREF (item_properties, ITEM_PROPERTY_DEF),
AREF (item_properties, ITEM_PROPERTY_KEYEQ),
AREF (item_properties, ITEM_PROPERTY_TYPE),
AREF (item_properties, ITEM_PROPERTY_SELECTED),
AREF (item_properties, ITEM_PROPERTY_HELP));
#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS) || defined (HAVE_NTGUI)
/* Display a submenu using the toolkit. */
......@@ -645,27 +645,27 @@ digest_single_submenu (int start, int end, int top_level_items)
i = start;
while (i < end)
{
if (EQ (XVECTOR (menu_items)->contents[i], Qnil))
if (EQ (AREF (menu_items, i), Qnil))
{
submenu_stack[submenu_depth++] = save_wv;
save_wv = prev_wv;
prev_wv = 0;
i++;
}
else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda))
else if (EQ (AREF (menu_items, i), Qlambda))
{
prev_wv = save_wv;
save_wv = submenu_stack[--submenu_depth];
i++;
}
else if (EQ (XVECTOR (menu_items)->contents[i], Qt)
else if (EQ (AREF (menu_items, i), Qt)
&& submenu_depth != 0)
i += MENU_ITEMS_PANE_LENGTH;
/* Ignore a nil in the item list.
It's meaningful only for dialog boxes. */
else if (EQ (XVECTOR (menu_items)->contents[i], Qquote))
else if (EQ (AREF (menu_items, i), Qquote))
i += 1;
else if (EQ (XVECTOR (menu_items)->contents[i], Qt))
else