* src/lisp.h (PVSIZE): New function.
* src/chartab.c (copy_char_table):
* src/data.c (Ftype_of, Finteractive_form, Faref, Faset):
* src/doc.c (Fdocumentation, store_function_docstring):
* src/eval.c (Fcommandp, funcall_lambda, lambda_arity, Ffetch_bytecode):
* src/fns.c (Flength, Fcopy_sequence):
* src/font.h (FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P):
* src/lread.c (substitute_object_recurse):
* src/src/print.c (print_object):
Use it.
copy_char_table (Lisp_Object table)
{
Lisp_Object copy;
- int size = XCHAR_TABLE (table)->header.size & PSEUDOVECTOR_SIZE_MASK;
+ int size = PVSIZE (table);
int i;
copy = Fmake_vector (make_number (size), Qnil);
case PVEC_RECORD:
{
Lisp_Object t = AREF (object, 0);
- if (RECORDP (t) && 1 < (ASIZE (t) & PSEUDOVECTOR_SIZE_MASK))
+ if (RECORDP (t) && 1 < PVSIZE (t))
/* Return the type name field of the class! */
return AREF (t, 1);
else
}
else if (COMPILEDP (fun))
{
- if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_INTERACTIVE)
+ if (PVSIZE (fun) > COMPILED_INTERACTIVE)
return list2 (Qinteractive, AREF (fun, COMPILED_INTERACTIVE));
}
else if (AUTOLOADP (fun))
if (VECTORP (array))
size = ASIZE (array);
else if (COMPILEDP (array) || RECORDP (array))
- size = ASIZE (array) & PSEUDOVECTOR_SIZE_MASK;
+ size = PVSIZE (array);
else
wrong_type_argument (Qarrayp, array);
}
else if (RECORDP (array))
{
- ptrdiff_t size = ASIZE (array) & PSEUDOVECTOR_SIZE_MASK;
- if (idxval < 0 || idxval >= size)
+ if (idxval < 0 || idxval >= PVSIZE (array))
args_out_of_range (array, idx);
ASET (array, idxval, newelt);
}
doc = make_number (XSUBR (fun)->doc);
else if (COMPILEDP (fun))
{
- if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING)
+ if (PVSIZE (fun) <= COMPILED_DOC_STRING)
return Qnil;
else
{
{
/* This bytecode object must have a slot for the
docstring, since we've found a docstring for it. */
- if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_DOC_STRING)
+ if (PVSIZE (fun) > COMPILED_DOC_STRING)
ASET (fun, COMPILED_DOC_STRING, make_number (offset));
else
{
have an element whose index is COMPILED_INTERACTIVE, which is
where the interactive spec is stored. */
else if (COMPILEDP (fun))
- return ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_INTERACTIVE
- ? Qt : if_prop);
+ return (PVSIZE (fun) > COMPILED_INTERACTIVE ? Qt : if_prop);
/* Strings and vectors are keyboard macros. */
if (STRINGP (fun) || VECTORP (fun))
}
else if (COMPILEDP (fun))
{
- ptrdiff_t size = ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK;
+ ptrdiff_t size = PVSIZE (fun);
if (size <= COMPILED_STACK_DEPTH)
xsignal1 (Qinvalid_function, fun);
syms_left = AREF (fun, COMPILED_ARGLIST);
}
else if (COMPILEDP (fun))
{
- ptrdiff_t size = ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK;
+ ptrdiff_t size = PVSIZE (fun);
if (size <= COMPILED_STACK_DEPTH)
xsignal1 (Qinvalid_function, fun);
syms_left = AREF (fun, COMPILED_ARGLIST);
if (COMPILEDP (object))
{
- ptrdiff_t size = ASIZE (object) & PSEUDOVECTOR_SIZE_MASK;
+ ptrdiff_t size = PVSIZE (object);
if (size <= COMPILED_STACK_DEPTH)
xsignal1 (Qinvalid_function, object);
if (CONSP (AREF (object, COMPILED_BYTECODE)))
else if (BOOL_VECTOR_P (sequence))
XSETFASTINT (val, bool_vector_size (sequence));
else if (COMPILEDP (sequence) || RECORDP (sequence))
- XSETFASTINT (val, ASIZE (sequence) & PSEUDOVECTOR_SIZE_MASK);
+ XSETFASTINT (val, PVSIZE (sequence));
else if (CONSP (sequence))
{
intptr_t i = 0;
if (RECORDP (arg))
{
- ptrdiff_t size = ASIZE (arg) & PSEUDOVECTOR_SIZE_MASK;
- return Frecord (size, XVECTOR (arg)->contents);
+ return Frecord (PVSIZE (arg), XVECTOR (arg)->contents);
}
if (CHAR_TABLE_P (arg))
INLINE bool
FONT_SPEC_P (Lisp_Object x)
{
- return FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_SPEC_MAX;
+ return FONTP (x) && PVSIZE (x) == FONT_SPEC_MAX;
}
/* Like FONT_SPEC_P, but can be used in the garbage collector. */
INLINE bool
FONT_ENTITY_P (Lisp_Object x)
{
- return FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_ENTITY_MAX;
+ return FONTP (x) && PVSIZE (x) == FONT_ENTITY_MAX;
}
/* Like FONT_ENTITY_P, but can be used in the garbage collector. */
INLINE bool
FONT_OBJECT_P (Lisp_Object x)
{
- return FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_OBJECT_MAX;
+ return FONTP (x) && PVSIZE (x) == FONT_OBJECT_MAX;
}
/* Like FONT_OBJECT_P, but can be used in the garbage collector. */
return size;
}
+INLINE ptrdiff_t
+PVSIZE (Lisp_Object pv)
+{
+ return ASIZE (pv) & PSEUDOVECTOR_SIZE_MASK;
+}
+
INLINE bool
VECTORP (Lisp_Object x)
{
else if (CHAR_TABLE_P (subtree) || SUB_CHAR_TABLE_P (subtree)
|| COMPILEDP (subtree) || HASH_TABLE_P (subtree)
|| RECORDP (subtree))
- length = ASIZE (subtree) & PSEUDOVECTOR_SIZE_MASK;
+ length = PVSIZE (subtree);
else if (VECTORP (subtree))
length = ASIZE (subtree);
else
case PVEC_RECORD:
{
- ptrdiff_t n, size = ASIZE (obj) & PSEUDOVECTOR_SIZE_MASK;
+ ptrdiff_t n, size = PVSIZE (obj);
int i;
/* Don't print more elements than the specified maximum. */