Use calln instead of calling Ffuncall directly
* src/bytecode.c (bcall0): * src/comp.c (bcall0): * src/eval.c (apply1): * src/lisp.h (call0): * src/thread.c (invoke_thread_function): Use calln instead of calling Ffuncall directly. * admin/coccinelle/calln.cocci: New semantic patch.
This commit is contained in:
parent
2e937dc2b5
commit
16c89c5ae5
6 changed files with 26 additions and 5 deletions
21
admin/coccinelle/calln.cocci
Normal file
21
admin/coccinelle/calln.cocci
Normal file
|
@ -0,0 +1,21 @@
|
|||
// Use the calln macro where possible.
|
||||
@@
|
||||
@@
|
||||
- CALLN ( Ffuncall,
|
||||
+ calln (
|
||||
...)
|
||||
|
||||
@@
|
||||
constant c;
|
||||
expression e;
|
||||
@@
|
||||
- Ffuncall ( c, &e )
|
||||
+ calln ( e )
|
||||
|
||||
@@
|
||||
constant c;
|
||||
expression e;
|
||||
@@
|
||||
- Ffuncall ( c, &e,
|
||||
+ calln ( e,
|
||||
...)
|
|
@ -327,7 +327,7 @@ If the third argument is incorrect, Emacs may crash. */)
|
|||
static void
|
||||
bcall0 (Lisp_Object f)
|
||||
{
|
||||
Ffuncall (1, &f);
|
||||
calln (f);
|
||||
}
|
||||
|
||||
/* The bytecode stack size in bytes.
|
||||
|
|
|
@ -862,7 +862,7 @@ freloc_check_fill (void)
|
|||
static void
|
||||
bcall0 (Lisp_Object f)
|
||||
{
|
||||
Ffuncall (1, &f);
|
||||
calln (f);
|
||||
}
|
||||
|
||||
static gcc_jit_block *
|
||||
|
|
|
@ -2967,7 +2967,7 @@ run_hook_with_args_2 (Lisp_Object hook, Lisp_Object arg1, Lisp_Object arg2)
|
|||
Lisp_Object
|
||||
apply1 (Lisp_Object fn, Lisp_Object arg)
|
||||
{
|
||||
return NILP (arg) ? Ffuncall (1, &fn) : CALLN (Fapply, fn, arg);
|
||||
return NILP (arg) ? calln (fn) : CALLN (Fapply, fn, arg);
|
||||
}
|
||||
|
||||
DEFUN ("functionp", Ffunctionp, Sfunctionp, 1, 1, 0,
|
||||
|
|
|
@ -3528,7 +3528,7 @@ enum maxargs
|
|||
INLINE Lisp_Object
|
||||
call0 (Lisp_Object fn)
|
||||
{
|
||||
return Ffuncall (1, &fn);
|
||||
return calln (fn);
|
||||
}
|
||||
|
||||
extern void defvar_lisp (struct Lisp_Objfwd const *, char const *);
|
||||
|
|
|
@ -741,7 +741,7 @@ invoke_thread_function (void)
|
|||
{
|
||||
specpdl_ref count = SPECPDL_INDEX ();
|
||||
|
||||
current_thread->result = Ffuncall (1, ¤t_thread->function);
|
||||
current_thread->result = calln (current_thread->function);
|
||||
return unbind_to (count, Qnil);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue