Lisp_Object
get_byte_code_arity (Lisp_Object args_template)
{
- if (INTEGERP (args_template))
- {
- ptrdiff_t at = XINT (args_template);
- bool rest = (at & 128) != 0;
- int mandatory = at & 127;
- ptrdiff_t nonrest = at >> 8;
-
- return Fcons (make_number (mandatory),
- rest ? Qmany : make_number (nonrest));
- }
- else
- error ("Unknown args template!");
+ eassert (NATNUMP (args_template));
+ EMACS_INT at = XINT (args_template);
+ bool rest = (at & 128) != 0;
+ int mandatory = at & 127;
+ EMACS_INT nonrest = at >> 8;
+
+ return Fcons (make_number (mandatory),
+ rest ? Qmany : make_number (nonrest));
}
void
Lisp_Object original;
Lisp_Object funcar;
Lisp_Object result;
- short minargs, maxargs;
original = function;
/* Optimize for no indirection. */
function = original;
- if (SYMBOLP (function) && !NILP (function)
- && (function = XSYMBOL (function)->function, SYMBOLP (function)))
- function = indirect_function (function);
+ if (SYMBOLP (function) && !NILP (function))
+ {
+ function = XSYMBOL (function)->function;
+ if (SYMBOLP (function))
+ function = indirect_function (function);
+ }
if (SUBRP (function))
result = Fsubr_arity (function);
static Lisp_Object
lambda_arity (Lisp_Object fun)
{
- Lisp_Object val, syms_left, next;
- ptrdiff_t minargs, maxargs;
- bool optional;
+ Lisp_Object syms_left;
if (CONSP (fun))
{
else
emacs_abort ();
- minargs = maxargs = optional = 0;
+ EMACS_INT minargs = 0, maxargs = 0;
+ bool optional = false;
for (; CONSP (syms_left); syms_left = XCDR (syms_left))
{
- next = XCAR (syms_left);
+ Lisp_Object next = XCAR (syms_left);
if (!SYMBOLP (next))
xsignal1 (Qinvalid_function, fun);
if (EQ (next, Qand_rest))
return Fcons (make_number (minargs), Qmany);
else if (EQ (next, Qand_optional))
- optional = 1;
+ optional = true;
else
{
if (!optional)
return Fcons (make_number (minargs), make_number (maxargs));
}
-
DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode,
1, 1, 0,
doc: /* If byte-compiled OBJECT is lazy-loaded, fetch it now. */)