summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-04-25 14:34:39 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-04-25 14:34:39 -0700
commit77b37c05572d1028d0ec2c264ac0ed3a89c0f4da (patch)
treecb5140f5f92f5f91bb9e8846e5254fc58df52cc4 /src
parentb102ceb110a9cd38f5c589c1869747b1e1c792cb (diff)
downloademacs-77b37c05572d1028d0ec2c264ac0ed3a89c0f4da.tar.gz
* lisp.h: (XVECTOR_SIZE): Remove. All uses replaced with ASIZE.
(ASIZE): Now contains previous implementation of XVECTOR_SIZE instead of invoking XVECTOR_SIZE.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/alloc.c2
-rw-r--r--src/buffer.c2
-rw-r--r--src/bytecode.c2
-rw-r--r--src/callint.c2
-rw-r--r--src/character.c4
-rw-r--r--src/coding.c2
-rw-r--r--src/composite.c6
-rw-r--r--src/data.c6
-rw-r--r--src/dispnew.c10
-rw-r--r--src/disptab.h2
-rw-r--r--src/doc.c2
-rw-r--r--src/font.c2
-rw-r--r--src/fringe.c2
-rw-r--r--src/image.c4
-rw-r--r--src/indent.c8
-rw-r--r--src/keyboard.c36
-rw-r--r--src/keymap.c10
-rw-r--r--src/lisp.h9
-rw-r--r--src/lread.c20
-rw-r--r--src/minibuf.c6
-rw-r--r--src/print.c10
-rw-r--r--src/syntax.c4
-rw-r--r--src/w32font.c2
-rw-r--r--src/w32menu.c8
-rw-r--r--src/xdisp.c2
-rw-r--r--src/xfaces.c2
-rw-r--r--src/xmenu.c6
-rw-r--r--src/xselect.c16
29 files changed, 97 insertions, 94 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e55010fdc9e..05d5c77e625 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
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.
diff --git a/src/alloc.c b/src/alloc.c
index 0de83f02f65..842088f4e92 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4772,7 +4772,7 @@ Does not copy symbols. Copies strings without text properties. */)
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));
diff --git a/src/buffer.c b/src/buffer.c
index aa50eff4fd0..ddaacd93707 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4178,7 +4178,7 @@ static int last_overlay_modification_hooks_used;
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
diff --git a/src/bytecode.c b/src/bytecode.c
index 839e0f7d54e..c3cd3d43072 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -467,7 +467,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
CHECK_NUMBER (maxdepth);
#ifdef BYTE_CODE_SAFE
- const_length = XVECTOR_SIZE (vector);
+ const_length = ASIZE (vector);
#endif
if (STRING_MULTIBYTE (bytestr))
diff --git a/src/callint.c b/src/callint.c
index 95b193ad91a..44d7a02f6bf 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -293,7 +293,7 @@ invoke it. If KEYS is omitted or nil, the return value of
else
{
CHECK_VECTOR (keys);
- key_count = XVECTOR_SIZE (keys);
+ key_count = ASIZE (keys);
}
/* Save this now, since use of minibuffer will clobber it. */
diff --git a/src/character.c b/src/character.c
index 8afe02b4700..12888e0f806 100644
--- a/src/character.c
+++ b/src/character.c
@@ -357,7 +357,7 @@ c_string_width (const unsigned char *str, EMACS_INT len, int precision,
{
val = DISP_CHAR_VECTOR (dp, c);
if (VECTORP (val))
- thiswidth = XVECTOR_SIZE (val);
+ thiswidth = ASIZE (val);
else
thiswidth = CHAR_WIDTH (c);
}
@@ -446,7 +446,7 @@ lisp_string_width (Lisp_Object string, int precision,
{
val = DISP_CHAR_VECTOR (dp, c);
if (VECTORP (val))
- thiswidth = XVECTOR_SIZE (val);
+ thiswidth = ASIZE (val);
else
thiswidth = CHAR_WIDTH (c);
}
diff --git a/src/coding.c b/src/coding.c
index efe4a7c34a1..6cd039a0903 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -7125,7 +7125,7 @@ handle_composition_annotation (EMACS_INT pos, EMACS_INT limit,
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));
}
diff --git a/src/composite.c b/src/composite.c
index aa6090084a0..f069acce1c0 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -293,7 +293,7 @@ get_composition_id (EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT nchars,
}
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)
@@ -326,8 +326,8 @@ get_composition_id (EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT nchars,
: 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;
diff --git a/src/data.c b/src/data.c
index 68ea503d619..577ae777d89 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2093,9 +2093,9 @@ or a byte-code object. IDX starts at 0. */)
{
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);
@@ -2120,7 +2120,7 @@ bool-vector. IDX starts at 0. */)
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;
}
diff --git a/src/dispnew.c b/src/dispnew.c
index 4b77040c266..13e920166c5 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6073,7 +6073,7 @@ pass nil for VARIABLE. */)
state = frame_and_buffer_state;
vecp = XVECTOR (state)->contents;
- end = vecp + XVECTOR_SIZE (state);
+ end = vecp + ASIZE (state);
FOR_EACH_FRAME (tail, frame)
{
@@ -6124,8 +6124,8 @@ pass nil for VARIABLE. */)
/* 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);
@@ -6155,11 +6155,11 @@ pass nil for VARIABLE. */)
/* 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;
}
diff --git a/src/disptab.h b/src/disptab.h
index 76fc586f137..e70079d2098 100644
--- a/src/disptab.h
+++ b/src/disptab.h
@@ -54,7 +54,7 @@ extern Lisp_Object Qdisplay_table;
/* 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. */
diff --git a/src/doc.c b/src/doc.c
index 8c84e045e76..29f232e666d 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -787,7 +787,7 @@ a new string, without any text properties, is returned. */)
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)
{
diff --git a/src/font.c b/src/font.c
index a393597e06c..12b280f6c36 100644
--- a/src/font.c
+++ b/src/font.c
@@ -253,7 +253,7 @@ font_intern_prop (const char *str, int len, int force_symbol)
/* 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)
diff --git a/src/fringe.c b/src/fringe.c
index e910152effa..f2d61225be7 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -1531,7 +1531,7 @@ If BITMAP already exists, the existing definition is replaced. */)
if (STRINGP (bits))
h = SCHARS (bits);
else if (VECTORP (bits))
- h = XVECTOR_SIZE (bits);
+ h = ASIZE (bits);
else
wrong_type_argument (Qsequencep, bits);
diff --git a/src/image.c b/src/image.c
index 2346bb002e3..6feeb75afd6 100644
--- a/src/image.c
+++ b/src/image.c
@@ -2359,7 +2359,7 @@ xbm_image_p (Lisp_Object object)
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
@@ -8398,7 +8398,7 @@ gs_image_p (Lisp_Object object)
}
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]))
diff --git a/src/indent.c b/src/indent.c
index a5ac2ab1d0c..0fdc45a33a4 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -93,7 +93,7 @@ character_width (int c, struct Lisp_Char_Table *dp)
/* 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')
@@ -284,7 +284,7 @@ skip_invisible (EMACS_INT pos, EMACS_INT *next_boundary_p, EMACS_INT to, Lisp_Ob
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); \
} \
@@ -766,7 +766,7 @@ string_display_width (string, beg, end)
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')
@@ -1127,7 +1127,7 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
: !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;
diff --git a/src/keyboard.c b/src/keyboard.c
index 8c4f7bdf804..86b1afc86ab 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -134,7 +134,7 @@ static Lisp_Object raw_keybuf;
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
@@ -2898,7 +2898,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
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)))
{
@@ -4198,7 +4198,7 @@ timer_start_idle (void)
timer = XCAR (timers);
- if (!VECTORP (timer) || XVECTOR_SIZE (timer) != 8)
+ if (!VECTORP (timer) || ASIZE (timer) != 8)
continue;
XVECTOR (timer)->contents[0] = Qnil;
}
@@ -4293,7 +4293,7 @@ timer_check_2 (void)
if (CONSP (timers))
{
timer = XCAR (timers);
- if (!VECTORP (timer) || XVECTOR_SIZE (timer) != 8)
+ if (!VECTORP (timer) || ASIZE (timer) != 8)
{
timers = XCDR (timers);
continue;
@@ -4311,7 +4311,7 @@ timer_check_2 (void)
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;
@@ -5459,7 +5459,7 @@ make_lispy_event (struct input_event *event)
/* 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);
@@ -5652,7 +5652,7 @@ make_lispy_event (struct input_event *event)
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,
@@ -5823,7 +5823,7 @@ make_lispy_event (struct input_event *event)
Qmouse_click,
Vlispy_mouse_stem,
NULL, &mouse_syms,
- XVECTOR_SIZE (mouse_syms));
+ ASIZE (mouse_syms));
return Fcons (head, Fcons (position, Qnil));
}
@@ -5943,7 +5943,7 @@ make_lispy_event (struct input_event *event)
Qmouse_click, Vlispy_mouse_stem,
NULL,
&mouse_syms,
- XVECTOR_SIZE (mouse_syms));
+ ASIZE (mouse_syms));
if (event->modifiers & drag_modifier)
return Fcons (head,
@@ -6422,7 +6422,7 @@ modify_event_symbol (EMACS_INT symbol_num, unsigned int modifiers, Lisp_Object s
else
{
if (! VECTORP (*symbol_table)
- || XVECTOR_SIZE (*symbol_table) != table_size)
+ || ASIZE (*symbol_table) != table_size)
{
Lisp_Object size;
@@ -7479,7 +7479,7 @@ menu_bar_items (Lisp_Object old)
/* 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. */
@@ -7551,7 +7551,7 @@ menu_bar_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy1, void *dumm
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;
@@ -8219,7 +8219,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
}
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;
@@ -8323,10 +8323,10 @@ append_tool_bar_item (void)
/* 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. */
@@ -8648,7 +8648,7 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps)
}
/* 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)
@@ -10292,7 +10292,7 @@ give to the command you invoke, if it asks for an argument. */)
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++)
@@ -10585,7 +10585,7 @@ KEEP-RECORD is non-nil. */)
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;
diff --git a/src/keymap.c b/src/keymap.c
index 110447b19ff..79481833bde 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -359,7 +359,7 @@ Return PARENT. PARENT should be nil or another keymap. */)
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]);
@@ -2226,7 +2226,7 @@ spaces are put between sequence elements, etc. */)
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
@@ -3125,7 +3125,7 @@ key binding\n\
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))
@@ -3168,7 +3168,7 @@ key binding\n\
/* 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
@@ -3592,7 +3592,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
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++)
{
diff --git a/src/lisp.h b/src/lisp.h
index fbfc91a46fe..9733dde33c0 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -554,9 +554,8 @@ extern Lisp_Object make_number (EMACS_INT);
#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)
@@ -634,7 +633,7 @@ extern Lisp_Object make_number (EMACS_INT);
/* 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)), \
@@ -1222,7 +1221,7 @@ struct Lisp_Hash_Table
/* 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. */
@@ -1640,7 +1639,7 @@ typedef struct {
#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)
diff --git a/src/lread.c b/src/lread.c
index 2ce2a4398a1..7ffc98b254f 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2430,7 +2430,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
{
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;
@@ -2449,7 +2449,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
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);
@@ -2499,7 +2499,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
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 == '(')
@@ -3356,7 +3356,7 @@ read_vector (Lisp_Object readcharfun, int bytecodeflag)
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++)
{
@@ -3621,7 +3621,7 @@ static int hash_string (const char *ptr, int len);
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;
@@ -3641,7 +3641,7 @@ intern (const char *str)
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))
@@ -3657,7 +3657,7 @@ intern_c_string (const char *str)
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))
@@ -3830,10 +3830,10 @@ oblookup (Lisp_Object obarray, register const char *ptr, EMACS_INT size, EMACS_I
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;
@@ -3881,7 +3881,7 @@ map_obarray (Lisp_Object obarray, void (*fn) (Lisp_Object, Lisp_Object), Lisp_Ob
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))
diff --git a/src/minibuf.c b/src/minibuf.c
index b73b2418cd6..3f8bd835211 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1227,7 +1227,7 @@ is used to further constrain the set of candidates. */)
if (type == obarray_table)
{
collection = check_obarray (collection);
- obsize = XVECTOR_SIZE (collection);
+ obsize = ASIZE (collection);
bucket = XVECTOR (collection)->contents[idx];
}
@@ -1490,7 +1490,7 @@ with a space are ignored unless STRING itself starts with a space. */)
if (type == 2)
{
collection = check_obarray (collection);
- obsize = XVECTOR_SIZE (collection);
+ obsize = ASIZE (collection);
bucket = XVECTOR (collection)->contents[idx];
}
@@ -1804,7 +1804,7 @@ the values STRING, PREDICATE and `lambda'. */)
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))
diff --git a/src/print.c b/src/print.c
index 8f559045f89..f0624d5d16e 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1198,7 +1198,7 @@ print_preprocess (Lisp_Object obj)
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++)
@@ -1786,7 +1786,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
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);
@@ -1797,7 +1797,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
#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))
@@ -1909,7 +1909,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
}
else
{
- EMACS_INT size = XVECTOR_SIZE (obj);
+ EMACS_INT size = ASIZE (obj);
if (COMPILEDP (obj))
{
PRINTCHAR ('#');
@@ -2025,7 +2025,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
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);
diff --git a/src/syntax.c b/src/syntax.c
index 6b8e0c72b2b..3bc9cdbd66d 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -979,7 +979,7 @@ text property. */)
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. */
@@ -3370,7 +3370,7 @@ init_syntax_once (void)
/* 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);
diff --git a/src/w32font.c b/src/w32font.c
index a9fa5256a43..985370c15c1 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -165,7 +165,7 @@ intern_font_name (char * string)
/* 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))
diff --git a/src/w32menu.c b/src/w32menu.c
index ef4f8d1485a..c8c6a319b40 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -427,11 +427,11 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
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)
{
diff --git a/src/xdisp.c b/src/xdisp.c
index 63c2e5b8148..b44c27335a6 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -18136,7 +18136,7 @@ display_menu_bar (struct window *w)
/* 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;
diff --git a/src/xfaces.c b/src/xfaces.c
index f20073f6e47..9721df04cab 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -1848,7 +1848,7 @@ the WIDTH times as wide as FACE on FRAME. */)
#define LFACEP(LFACE) \
(VECTORP (LFACE) \
- && XVECTOR_SIZE (LFACE) == LFACE_VECTOR_SIZE \
+ && ASIZE (LFACE) == LFACE_VECTOR_SIZE \
&& EQ (AREF (LFACE, 0), Qface))
#endif
diff --git a/src/xmenu.c b/src/xmenu.c
index aac7fd43056..2d6185c16e5 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1011,7 +1011,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
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));
@@ -1097,7 +1097,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
/* 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];
@@ -1123,7 +1123,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
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;
diff --git a/src/xselect.c b/src/xselect.c
index 27e2770f8ef..f11fc40fce8 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -423,7 +423,7 @@ x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type, in
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
@@ -1261,12 +1261,12 @@ copy_multiple_data (obj)
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);
@@ -1878,7 +1878,7 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj,
/* 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++)
@@ -1893,7 +1893,7 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj,
/* 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);
@@ -1901,7 +1901,7 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj,
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);
@@ -1923,7 +1923,7 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj,
/* 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++)
@@ -1976,7 +1976,7 @@ clean_local_selection_data (Lisp_Object obj)
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]);