2011-04-25 Paul Eggert <eggert@cs.ucla.edu>
+ * lisp.h: (XVECTOR_SIZE): Remove. All uses replaced with ASIZE.
+ (ASIZE): Now contains previous implementation of XVECTOR_SIZE
+ instead of invoking XVECTOR_SIZE.
+
* lisp.h: Say "vectorlike header" rather than "vector header.
(struct vectorlike_header): Rename from struct vector_header.
(XVECTORLIKE_HEADER_SIZE): Renamed from XVECTOR_HEADER_SIZE.
register EMACS_INT i;
EMACS_INT size;
- size = XVECTOR_SIZE (obj);
+ size = ASIZE (obj);
if (size & PSEUDOVECTOR_FLAG)
size &= PSEUDOVECTOR_SIZE_MASK;
vec = XVECTOR (make_pure_vector (size));
static void
add_overlay_mod_hooklist (Lisp_Object functionlist, Lisp_Object overlay)
{
- int oldsize = XVECTOR_SIZE (last_overlay_modification_hooks);
+ int oldsize = ASIZE (last_overlay_modification_hooks);
if (last_overlay_modification_hooks_used == oldsize)
last_overlay_modification_hooks = larger_vector
CHECK_NUMBER (maxdepth);
#ifdef BYTE_CODE_SAFE
- const_length = XVECTOR_SIZE (vector);
+ const_length = ASIZE (vector);
#endif
if (STRING_MULTIBYTE (bytestr))
else
{
CHECK_VECTOR (keys);
- key_count = XVECTOR_SIZE (keys);
+ key_count = ASIZE (keys);
}
/* Save this now, since use of minibuffer will clobber it. */
{
val = DISP_CHAR_VECTOR (dp, c);
if (VECTORP (val))
- thiswidth = XVECTOR_SIZE (val);
+ thiswidth = ASIZE (val);
else
thiswidth = CHAR_WIDTH (c);
}
{
val = DISP_CHAR_VECTOR (dp, c);
if (VECTORP (val))
- thiswidth = XVECTOR_SIZE (val);
+ thiswidth = ASIZE (val);
else
thiswidth = CHAR_WIDTH (c);
}
components = COMPOSITION_COMPONENTS (prop);
if (VECTORP (components))
{
- len = XVECTOR_SIZE (components);
+ len = ASIZE (components);
for (i = 0; i < len; i++)
*buf++ = XINT (AREF (components, i));
}
}
else if (VECTORP (components) || CONSP (components))
{
- EMACS_UINT len = XVECTOR_SIZE (key);
+ EMACS_UINT len = ASIZE (key);
/* The number of elements should be odd. */
if ((len % 2) == 0)
: COMPOSITION_WITH_RULE_ALTCHARS));
cmp->hash_index = hash_index;
glyph_len = (cmp->method == COMPOSITION_WITH_RULE_ALTCHARS
- ? (XVECTOR_SIZE (key) + 1) / 2
- : XVECTOR_SIZE (key));
+ ? (ASIZE (key) + 1) / 2
+ : ASIZE (key));
cmp->glyph_len = glyph_len;
cmp->offsets = (short *) xmalloc (sizeof (short) * glyph_len * 2);
cmp->font = NULL;
{
int size = 0;
if (VECTORP (array))
- size = XVECTOR_SIZE (array);
+ size = ASIZE (array);
else if (COMPILEDP (array))
- size = XVECTOR_SIZE (array) & PSEUDOVECTOR_SIZE_MASK;
+ size = ASIZE (array) & PSEUDOVECTOR_SIZE_MASK;
else
wrong_type_argument (Qarrayp, array);
if (VECTORP (array))
{
- if (idxval < 0 || idxval >= XVECTOR_SIZE (array))
+ if (idxval < 0 || idxval >= ASIZE (array))
args_out_of_range (array, idx);
XVECTOR (array)->contents[idxval] = newelt;
}
state = frame_and_buffer_state;
vecp = XVECTOR (state)->contents;
- end = vecp + XVECTOR_SIZE (state);
+ end = vecp + ASIZE (state);
FOR_EACH_FRAME (tail, frame)
{
/* Reallocate the vector if data has grown to need it,
or if it has shrunk a lot. */
if (! VECTORP (state)
- || n > XVECTOR_SIZE (state)
- || n + 20 < XVECTOR_SIZE (state) / 2)
+ || n > ASIZE (state)
+ || n + 20 < ASIZE (state) / 2)
/* Add 20 extra so we grow it less often. */
{
state = Fmake_vector (make_number (n + 20), Qlambda);
/* Fill up the vector with lambdas (always at least one). */
*vecp++ = Qlambda;
while (vecp - XVECTOR (state)->contents
- < XVECTOR_SIZE (state))
+ < ASIZE (state))
*vecp++ = Qlambda;
/* Make sure we didn't overflow the vector. */
if (vecp - XVECTOR (state)->contents
- > XVECTOR_SIZE (state))
+ > ASIZE (state))
abort ();
return Qt;
}
/* Return the current length of the GLYPH table,
or 0 if the table isn't currently valid. */
#define GLYPH_TABLE_LENGTH \
- ((VECTORP (Vglyph_table)) ? XVECTOR_SIZE (Vglyph_table) : 0)
+ ((VECTORP (Vglyph_table)) ? ASIZE (Vglyph_table) : 0)
/* Return the current base (for indexing) of the GLYPH table,
or 0 if the table isn't currently valid. */
do_remap:
tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qnil);
- if (VECTORP (tem) && XVECTOR_SIZE (tem) > 1
+ if (VECTORP (tem) && ASIZE (tem) > 1
&& EQ (AREF (tem, 0), Qremap) && SYMBOLP (AREF (tem, 1))
&& follow_remap)
{
/* The following code is copied from the function intern (in
lread.c), and modified to suite our purpose. */
obarray = Vobarray;
- if (!VECTORP (obarray) || XVECTOR_SIZE (obarray) == 0)
+ if (!VECTORP (obarray) || ASIZE (obarray) == 0)
obarray = check_obarray (obarray);
parse_str_as_multibyte ((unsigned char *) str, len, &nchars, &nbytes);
if (len == nchars || len != nbytes)
if (STRINGP (bits))
h = SCHARS (bits);
else if (VECTORP (bits))
- h = XVECTOR_SIZE (bits);
+ h = ASIZE (bits);
else
wrong_type_argument (Qsequencep, bits);
int i;
/* Number of elements of the vector must be >= height. */
- if (XVECTOR_SIZE (data) < height)
+ if (ASIZE (data) < height)
return 0;
/* Each string or bool-vector in data must be large enough
}
else if (VECTORP (tem))
{
- if (XVECTOR_SIZE (tem) != 4)
+ if (ASIZE (tem) != 4)
return 0;
for (i = 0; i < 4; ++i)
if (!INTEGERP (XVECTOR (tem)->contents[i]))
/* Everything can be handled by the display table, if it's
present and the element is right. */
if (dp && (elt = DISP_CHAR_VECTOR (dp, c), VECTORP (elt)))
- return XVECTOR_SIZE (elt);
+ return ASIZE (elt);
/* Some characters are special. */
if (c == '\n' || c == '\t' || c == '\015')
else \
{ \
if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, ch))) \
- width = XVECTOR_SIZE (DISP_CHAR_VECTOR (dp, ch)); \
+ width = ASIZE (DISP_CHAR_VECTOR (dp, ch)); \
else \
width = CHAR_WIDTH (ch); \
} \
c = *--ptr;
if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c)))
- col += XVECTOR_SIZE (DISP_CHAR_VECTOR (dp, c));
+ col += ASIZE (DISP_CHAR_VECTOR (dp, c));
else if (c >= 040 && c < 0177)
col++;
else if (c == '\n')
: !NILP (BVAR (current_buffer, selective_display)) ? -1 : 0);
int selective_rlen
= (selective && dp && VECTORP (DISP_INVIS_VECTOR (dp))
- ? XVECTOR_SIZE (DISP_INVIS_VECTOR (dp)) : 0);
+ ? ASIZE (DISP_INVIS_VECTOR (dp)) : 0);
/* The next location where the `invisible' property changes, or an
overlay starts or ends. */
EMACS_INT next_boundary = from;
static int raw_keybuf_count;
#define GROW_RAW_KEYBUF \
- if (raw_keybuf_count == XVECTOR_SIZE (raw_keybuf)) \
+ if (raw_keybuf_count == ASIZE (raw_keybuf)) \
raw_keybuf = larger_vector (raw_keybuf, raw_keybuf_count * 2, Qnil) \
/* Number of elements of this_command_keys
if ((STRINGP (KVAR (current_kboard, Vkeyboard_translate_table))
&& SCHARS (KVAR (current_kboard, Vkeyboard_translate_table)) > (unsigned) XFASTINT (c))
|| (VECTORP (KVAR (current_kboard, Vkeyboard_translate_table))
- && XVECTOR_SIZE (KVAR (current_kboard, Vkeyboard_translate_table)) > (unsigned) XFASTINT (c))
+ && ASIZE (KVAR (current_kboard, Vkeyboard_translate_table)) > (unsigned) XFASTINT (c))
|| (CHAR_TABLE_P (KVAR (current_kboard, Vkeyboard_translate_table))
&& CHARACTERP (c)))
{
timer = XCAR (timers);
- if (!VECTORP (timer) || XVECTOR_SIZE (timer) != 8)
+ if (!VECTORP (timer) || ASIZE (timer) != 8)
continue;
XVECTOR (timer)->contents[0] = Qnil;
}
if (CONSP (timers))
{
timer = XCAR (timers);
- if (!VECTORP (timer) || XVECTOR_SIZE (timer) != 8)
+ if (!VECTORP (timer) || ASIZE (timer) != 8)
{
timers = XCDR (timers);
continue;
if (CONSP (idle_timers))
{
timer = XCAR (idle_timers);
- if (!VECTORP (timer) || XVECTOR_SIZE (timer) != 8)
+ if (!VECTORP (timer) || ASIZE (timer) != 8)
{
idle_timers = XCDR (idle_timers);
continue;
/* Find the menu bar item under `column'. */
item = Qnil;
items = FRAME_MENU_BAR_ITEMS (f);
- for (i = 0; i < XVECTOR_SIZE (items); i += 4)
+ for (i = 0; i < ASIZE (items); i += 4)
{
Lisp_Object pos, string;
string = AREF (items, i + 1);
Qmouse_click, Vlispy_mouse_stem,
NULL,
&mouse_syms,
- XVECTOR_SIZE (mouse_syms));
+ ASIZE (mouse_syms));
if (event->modifiers & drag_modifier)
return Fcons (head,
Fcons (start_pos,
Qmouse_click,
Vlispy_mouse_stem,
NULL, &mouse_syms,
- XVECTOR_SIZE (mouse_syms));
+ ASIZE (mouse_syms));
return Fcons (head, Fcons (position, Qnil));
}
Qmouse_click, Vlispy_mouse_stem,
NULL,
&mouse_syms,
- XVECTOR_SIZE (mouse_syms));
+ ASIZE (mouse_syms));
if (event->modifiers & drag_modifier)
return Fcons (head,
else
{
if (! VECTORP (*symbol_table)
- || XVECTOR_SIZE (*symbol_table) != table_size)
+ || ASIZE (*symbol_table) != table_size)
{
Lisp_Object size;
/* Add nil, nil, nil, nil at the end. */
{
int i = menu_bar_items_index;
- if (i + 4 > XVECTOR_SIZE (menu_bar_items_vector))
+ if (i + 4 > ASIZE (menu_bar_items_vector))
menu_bar_items_vector =
larger_vector (menu_bar_items_vector, 2 * i, Qnil);
/* Add this item. */
if (i == menu_bar_items_index)
{
/* If vector is too small, get a bigger one. */
- if (i + 4 > XVECTOR_SIZE (menu_bar_items_vector))
+ if (i + 4 > ASIZE (menu_bar_items_vector))
menu_bar_items_vector = larger_vector (menu_bar_items_vector, 2 * i, Qnil);
/* Add this item. */
XVECTOR (menu_bar_items_vector)->contents[i++] = key;
}
else if (EQ (ikey, QCimage)
&& (CONSP (value)
- || (VECTORP (value) && XVECTOR_SIZE (value) == 4)))
+ || (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;
/* Enlarge tool_bar_items_vector if necessary. */
if (ntool_bar_items + TOOL_BAR_ITEM_NSLOTS
- >= XVECTOR_SIZE (tool_bar_items_vector))
+ >= ASIZE (tool_bar_items_vector))
tool_bar_items_vector
= larger_vector (tool_bar_items_vector,
- 2 * XVECTOR_SIZE (tool_bar_items_vector), Qnil);
+ 2 * ASIZE (tool_bar_items_vector), Qnil);
/* Append entries from tool_bar_item_properties to the end of
tool_bar_items_vector. */
}
/* Move past this element. */
- if (idx >= 0 && idx + 1 >= XVECTOR_SIZE (vector))
+ if (idx >= 0 && idx + 1 >= ASIZE (vector))
/* Handle reaching end of dense table. */
idx = -1;
if (idx >= 0)
this_single_command_key_start = 0;
keys = XVECTOR (saved_keys)->contents;
- for (i = 0; i < XVECTOR_SIZE (saved_keys); i++)
+ for (i = 0; i < ASIZE (saved_keys); i++)
add_command_key (keys[i]);
for (i = 0; i < SCHARS (function); i++)
if (NILP (keep_record))
{
- for (i = 0; i < XVECTOR_SIZE (recent_keys); ++i)
+ for (i = 0; i < ASIZE (recent_keys); ++i)
XVECTOR (recent_keys)->contents[i] = Qnil;
total_keys = 0;
recent_keys_index = 0;
XCDR (XCAR (list)));
if (VECTORP (XCAR (list)))
- for (i = 0; i < XVECTOR_SIZE (XCAR (list)); i++)
+ for (i = 0; i < ASIZE (XCAR (list)); i++)
if (CONSP (XVECTOR (XCAR (list))->contents[i]))
fix_submap_inheritance (keymap, make_number (i),
XVECTOR (XCAR (list))->contents[i]);
if (STRINGP (list))
size = SCHARS (list);
else if (VECTORP (list))
- size = XVECTOR_SIZE (list);
+ size = ASIZE (list);
else if (CONSP (list))
size = XINT (Flength (list));
else
elt = XCAR (list);
elt_prefix = Fcar (elt);
- if (XVECTOR_SIZE (elt_prefix) >= 1)
+ if (ASIZE (elt_prefix) >= 1)
{
tem = Faref (elt_prefix, make_number (0));
if (EQ (tem, Qmenu_bar))
/* If the sequence by which we reach this keymap is zero-length,
then the shadow map for this keymap is just SHADOW. */
if ((STRINGP (elt_prefix) && SCHARS (elt_prefix) == 0)
- || (VECTORP (elt_prefix) && XVECTOR_SIZE (elt_prefix) == 0))
+ || (VECTORP (elt_prefix) && ASIZE (elt_prefix) == 0))
;
/* If the sequence by which we reach this keymap actually has
some elements, then the sequence's definition in SHADOW is
if (CHAR_TABLE_P (vector))
stop = MAX_5_BYTE_CHAR + 1, to = MAX_CHAR + 1;
else
- stop = to = XVECTOR_SIZE (vector);
+ stop = to = ASIZE (vector);
for (i = from; ; i++)
{
#define XSYMBOL(a) (eassert (SYMBOLP(a)),(struct Lisp_Symbol *) XPNTR(a))
#define XFLOAT(a) (eassert (FLOATP(a)),(struct Lisp_Float *) XPNTR(a))
-/* Extract the size field of a vector or vector-like object. */
+/* Extract the size field of a vector-like object. */
-#define XVECTOR_SIZE(a) (XVECTOR (a)->header.size + 0)
#define XVECTORLIKE_HEADER_SIZE(a) \
(((struct vectorlike_header *) XPNTR (a))->size + 0)
/* Convenience macros for dealing with Lisp arrays. */
#define AREF(ARRAY, IDX) XVECTOR ((ARRAY))->contents[IDX]
-#define ASIZE(ARRAY) XVECTOR_SIZE (ARRAY)
+#define ASIZE(ARRAY) XVECTOR ((ARRAY))->header.size
/* The IDX==IDX tries to detect when the macro argument is side-effecting. */
#define ASET(ARRAY, IDX, VAL) \
(eassert ((IDX) == (IDX)), \
/* Value is the size of hash table H. */
-#define HASH_TABLE_SIZE(H) XVECTOR_SIZE ((H)->next)
+#define HASH_TABLE_SIZE(H) ASIZE ((H)->next)
/* Default size for hash tables if not specified. */
#define CONSP(x) (XTYPE ((x)) == Lisp_Cons)
#define FLOATP(x) (XTYPE ((x)) == Lisp_Float)
-#define VECTORP(x) (VECTORLIKEP (x) && !(XVECTOR_SIZE (x) & PSEUDOVECTOR_FLAG))
+#define VECTORP(x) (VECTORLIKEP (x) && !(ASIZE (x) & PSEUDOVECTOR_FLAG))
#define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
#define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
#define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value)
{
Lisp_Object tmp;
tmp = read_vector (readcharfun, 0);
- if (XVECTOR_SIZE (tmp) < CHAR_TABLE_STANDARD_SLOTS)
+ if (ASIZE (tmp) < CHAR_TABLE_STANDARD_SLOTS)
error ("Invalid size char-table");
XSETPVECTYPE (XVECTOR (tmp), PVEC_CHAR_TABLE);
return tmp;
depth = XINT (AREF (tmp, 0));
if (depth < 1 || depth > 3)
error ("Invalid depth in char-table");
- size = XVECTOR_SIZE (tmp) - 2;
+ size = ASIZE (tmp) - 2;
if (chartab_size [depth] != size)
error ("Invalid size char-table");
XSETPVECTYPE (XVECTOR (tmp), PVEC_SUB_CHAR_TABLE);
build them using function calls. */
Lisp_Object tmp;
tmp = read_vector (readcharfun, 1);
- return Fmake_byte_code (XVECTOR_SIZE (tmp),
+ return Fmake_byte_code (ASIZE (tmp),
XVECTOR (tmp)->contents);
}
if (c == '(')
len = Flength (tem);
vector = (read_pure ? make_pure_vector (XINT (len)) : Fmake_vector (len, Qnil));
- size = XVECTOR_SIZE (vector);
+ size = ASIZE (vector);
ptr = XVECTOR (vector)->contents;
for (i = 0; i < size; i++)
{
Lisp_Object
check_obarray (Lisp_Object obarray)
{
- if (!VECTORP (obarray) || XVECTOR_SIZE (obarray) == 0)
+ if (!VECTORP (obarray) || ASIZE (obarray) == 0)
{
/* If Vobarray is now invalid, force it to be valid. */
if (EQ (Vobarray, obarray)) Vobarray = initial_obarray;
Lisp_Object obarray;
obarray = Vobarray;
- if (!VECTORP (obarray) || XVECTOR_SIZE (obarray) == 0)
+ if (!VECTORP (obarray) || ASIZE (obarray) == 0)
obarray = check_obarray (obarray);
tem = oblookup (obarray, str, len, len);
if (SYMBOLP (tem))
Lisp_Object obarray;
obarray = Vobarray;
- if (!VECTORP (obarray) || XVECTOR_SIZE (obarray) == 0)
+ if (!VECTORP (obarray) || ASIZE (obarray) == 0)
obarray = check_obarray (obarray);
tem = oblookup (obarray, str, len, len);
if (SYMBOLP (tem))
Lisp_Object bucket, tem;
if (!VECTORP (obarray)
- || (obsize = XVECTOR_SIZE (obarray)) == 0)
+ || (obsize = ASIZE (obarray)) == 0)
{
obarray = check_obarray (obarray);
- obsize = XVECTOR_SIZE (obarray);
+ obsize = ASIZE (obarray);
}
/* This is sometimes needed in the middle of GC. */
obsize &= ~ARRAY_MARK_FLAG;
register int i;
register Lisp_Object tail;
CHECK_VECTOR (obarray);
- for (i = XVECTOR_SIZE (obarray) - 1; i >= 0; i--)
+ for (i = ASIZE (obarray) - 1; i >= 0; i--)
{
tail = XVECTOR (obarray)->contents[i];
if (SYMBOLP (tail))
if (type == obarray_table)
{
collection = check_obarray (collection);
- obsize = XVECTOR_SIZE (collection);
+ obsize = ASIZE (collection);
bucket = XVECTOR (collection)->contents[idx];
}
if (type == 2)
{
collection = check_obarray (collection);
- obsize = XVECTOR_SIZE (collection);
+ obsize = ASIZE (collection);
bucket = XVECTOR (collection)->contents[idx];
}
if (completion_ignore_case && !SYMBOLP (tem))
{
- for (i = XVECTOR_SIZE (collection) - 1; i >= 0; i--)
+ for (i = ASIZE (collection) - 1; i >= 0; i--)
{
tail = XVECTOR (collection)->contents[i];
if (SYMBOLP (tail))
goto loop;
case Lisp_Vectorlike:
- size = XVECTOR_SIZE (obj);
+ size = ASIZE (obj);
if (size & PSEUDOVECTOR_FLAG)
size &= PSEUDOVECTOR_SIZE_MASK;
for (i = 0; i < size; i++)
strout (SDATA (SYMBOL_NAME (h->weak)), -1, -1, printcharfun);
PRINTCHAR (' ');
sprintf (buf, "%ld/%ld", (long) h->count,
- (long) XVECTOR_SIZE (h->next));
+ (long) ASIZE (h->next));
strout (buf, -1, -1, printcharfun);
}
sprintf (buf, " 0x%lx", (unsigned long) h);
#s(hash-table size 2 test equal data (k1 v1 k2 v2)) */
/* Always print the size. */
sprintf (buf, "#s(hash-table size %ld",
- (long) XVECTOR_SIZE (h->next));
+ (long) ASIZE (h->next));
strout (buf, -1, -1, printcharfun);
if (!NILP (h->test))
}
else
{
- EMACS_INT size = XVECTOR_SIZE (obj);
+ EMACS_INT size = ASIZE (obj);
if (COMPILEDP (obj))
{
PRINTCHAR ('#');
if (MISCP (obj))
sprintf (buf, "(MISC 0x%04x)", (int) XMISCTYPE (obj));
else if (VECTORLIKEP (obj))
- sprintf (buf, "(PVEC 0x%08lx)", (unsigned long) XVECTOR_SIZE (obj));
+ sprintf (buf, "(PVEC 0x%08lx)", (unsigned long) ASIZE (obj));
else
sprintf (buf, "(0x%02x)", (int) XTYPE (obj));
strout (buf, -1, -1, printcharfun);
break;
}
- if (val < XVECTOR_SIZE (Vsyntax_code_object) && NILP (match))
+ if (val < ASIZE (Vsyntax_code_object) && NILP (match))
return XVECTOR (Vsyntax_code_object)->contents[val];
else
/* Since we can't use a shared object, let's make a new one. */
/* Create objects which can be shared among syntax tables. */
Vsyntax_code_object = Fmake_vector (make_number (Smax), Qnil);
- for (i = 0; i < XVECTOR_SIZE (Vsyntax_code_object); i++)
+ for (i = 0; i < ASIZE (Vsyntax_code_object); i++)
XVECTOR (Vsyntax_code_object)->contents[i]
= Fcons (make_number (i), Qnil);
/* The following code is copied from the function intern (in lread.c). */
obarray = Vobarray;
- if (!VECTORP (obarray) || XVECTOR_SIZE (obarray) == 0)
+ if (!VECTORP (obarray) || ASIZE (obarray) == 0)
obarray = check_obarray (obarray);
tem = oblookup (obarray, SDATA (str), len, len);
if (SYMBOLP (tem))
menu_items = f->menu_bar_vector;
menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
- submenu_start = (int *) alloca (XVECTOR_SIZE (items) * sizeof (int *));
- submenu_end = (int *) alloca (XVECTOR_SIZE (items) * sizeof (int *));
- submenu_n_panes = (int *) alloca (XVECTOR_SIZE (items) * sizeof (int));
+ submenu_start = (int *) alloca (ASIZE (items) * sizeof (int *));
+ submenu_end = (int *) alloca (ASIZE (items) * sizeof (int *));
+ submenu_n_panes = (int *) alloca (ASIZE (items) * sizeof (int));
submenu_top_level_items
- = (int *) alloca (XVECTOR_SIZE (items) * sizeof (int *));
+ = (int *) alloca (ASIZE (items) * sizeof (int *));
init_menu_items ();
for (i = 0; i < ASIZE (items); i += 4)
{
/* Display all items of the menu bar. */
items = FRAME_MENU_BAR_ITEMS (it.f);
- for (i = 0; i < XVECTOR_SIZE (items); i += 4)
+ for (i = 0; i < ASIZE (items); i += 4)
{
Lisp_Object string;
#define LFACEP(LFACE) \
(VECTORP (LFACE) \
- && XVECTOR_SIZE (LFACE) == LFACE_VECTOR_SIZE \
+ && ASIZE (LFACE) == LFACE_VECTOR_SIZE \
&& EQ (AREF (LFACE, 0), Qface))
#endif
menu_items = f->menu_bar_vector;
menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
- subitems = XVECTOR_SIZE (items) / 4;
+ subitems = ASIZE (items) / 4;
submenu_start = (int *) alloca (subitems * sizeof (int *));
submenu_end = (int *) alloca (subitems * sizeof (int *));
submenu_n_panes = (int *) alloca (subitems * sizeof (int));
/* Now GC cannot happen during the lifetime of the widget_value,
so it's safe to store data from a Lisp_String. */
wv = first_wv->contents;
- for (i = 0; i < XVECTOR_SIZE (items); i += 4)
+ for (i = 0; i < ASIZE (items); i += 4)
{
Lisp_Object string;
string = XVECTOR (items)->contents[i + 1];
first_wv = wv;
items = FRAME_MENU_BAR_ITEMS (f);
- for (i = 0; i < XVECTOR_SIZE (items); i += 4)
+ for (i = 0; i < ASIZE (items); i += 4)
{
Lisp_Object string;
int size;
int i;
pairs = XCDR (target_type);
- size = XVECTOR_SIZE (pairs);
+ size = ASIZE (pairs);
/* If the target is MULTIPLE, then target_type looks like
(MULTIPLE . [[SELECTION1 TARGET1] [SELECTION2 TARGET2] ... ])
We modify the second element of each pair in the vector and
return Fcons (XCAR (obj), copy_multiple_data (XCDR (obj)));
CHECK_VECTOR (obj);
- vec = Fmake_vector (size = XVECTOR_SIZE (obj), Qnil);
+ vec = Fmake_vector (size = ASIZE (obj), Qnil);
for (i = 0; i < size; i++)
{
Lisp_Object vec2 = XVECTOR (obj)->contents [i];
CHECK_VECTOR (vec2);
- if (XVECTOR_SIZE (vec2) != 2)
+ if (ASIZE (vec2) != 2)
/* ??? Confusing error message */
signal_error ("Vectors must be of length 2", vec2);
XVECTOR (vec)->contents [i] = Fmake_vector (2, Qnil);
/* This vector is an ATOM set */
{
if (NILP (type)) type = QATOM;
- *size_ret = XVECTOR_SIZE (obj);
+ *size_ret = ASIZE (obj);
*format_ret = 32;
*data_ret = (unsigned char *) xmalloc ((*size_ret) * sizeof (Atom));
for (i = 0; i < *size_ret; i++)
/* This vector is an ATOM_PAIR set */
{
if (NILP (type)) type = QATOM_PAIR;
- *size_ret = XVECTOR_SIZE (obj);
+ *size_ret = ASIZE (obj);
*format_ret = 32;
*data_ret = (unsigned char *)
xmalloc ((*size_ret) * sizeof (Atom) * 2);
if (VECTORP (XVECTOR (obj)->contents [i]))
{
Lisp_Object pair = XVECTOR (obj)->contents [i];
- if (XVECTOR_SIZE (pair) != 2)
+ if (ASIZE (pair) != 2)
signal_error (
"Elements of the vector must be vectors of exactly two elements",
pair);
/* This vector is an INTEGER set, or something like it */
{
int data_size = 2;
- *size_ret = XVECTOR_SIZE (obj);
+ *size_ret = ASIZE (obj);
if (NILP (type)) type = QINTEGER;
*format_ret = 16;
for (i = 0; i < *size_ret; i++)
if (VECTORP (obj))
{
int i;
- int size = XVECTOR_SIZE (obj);
+ int size = ASIZE (obj);
Lisp_Object copy;
if (size == 1)
return clean_local_selection_data (XVECTOR (obj)->contents [0]);