diff options
| author | Paul Eggert | 2016-03-26 19:24:25 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-03-26 19:24:46 -0700 |
| commit | bc9cc21d34ae71dc38bd20f224c4b3ac073bcb50 (patch) | |
| tree | 259f54589caf61669955e0708b6800101db465b2 /src/bytecode.c | |
| parent | efb1883244f551cfb43fa9d85e3df8cc334fb232 (diff) | |
| download | emacs-bc9cc21d34ae71dc38bd20f224c4b3ac073bcb50.tar.gz emacs-bc9cc21d34ae71dc38bd20f224c4b3ac073bcb50.zip | |
func-arity minor improvements
* src/bytecode.c (get_byte_code_arity): Omit unnecessary
runtime test for integer argument, unless debugging.
Use EMACS_INT for Emacs integers.
* src/eval.c (Ffunc_arity): Omit unused locals.
Avoid side effects in ‘if’ expr.
(lambda_arity): Use bool for boolean, and EMACS_INT for Emacs ints.
Diffstat (limited to 'src/bytecode.c')
| -rw-r--r-- | src/bytecode.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/bytecode.c b/src/bytecode.c index 4ff15d2912a..fb9f617b514 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -1991,18 +1991,14 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 1991 | Lisp_Object | 1991 | Lisp_Object |
| 1992 | get_byte_code_arity (Lisp_Object args_template) | 1992 | get_byte_code_arity (Lisp_Object args_template) |
| 1993 | { | 1993 | { |
| 1994 | if (INTEGERP (args_template)) | 1994 | eassert (NATNUMP (args_template)); |
| 1995 | { | 1995 | EMACS_INT at = XINT (args_template); |
| 1996 | ptrdiff_t at = XINT (args_template); | 1996 | bool rest = (at & 128) != 0; |
| 1997 | bool rest = (at & 128) != 0; | 1997 | int mandatory = at & 127; |
| 1998 | int mandatory = at & 127; | 1998 | EMACS_INT nonrest = at >> 8; |
| 1999 | ptrdiff_t nonrest = at >> 8; | 1999 | |
| 2000 | 2000 | return Fcons (make_number (mandatory), | |
| 2001 | return Fcons (make_number (mandatory), | 2001 | rest ? Qmany : make_number (nonrest)); |
| 2002 | rest ? Qmany : make_number (nonrest)); | ||
| 2003 | } | ||
| 2004 | else | ||
| 2005 | error ("Unknown args template!"); | ||
| 2006 | } | 2002 | } |
| 2007 | 2003 | ||
| 2008 | void | 2004 | void |