Prefer CALLN

* src/bytecode.c (Fbyte_code):
* src/composite.c (Fclear_composition_cache):
Prefer CALLN to doing it by hand.
* src/fns.c (ccall2): Remove.  All uses replaced by CALLN.
This commit is contained in:
Paul Eggert 2022-03-14 08:55:46 -07:00
parent f52dcfd03a
commit 0d0703e9c4
3 changed files with 12 additions and 20 deletions

View file

@ -325,8 +325,8 @@ If the third argument is incorrect, Emacs may crash. */)
the original unibyte form. */
bytestr = Fstring_as_unibyte (bytestr);
}
Lisp_Object args[] = {0, bytestr, vector, maxdepth};
return exec_byte_code (Fmake_byte_code (4, args), 0, 0, NULL);
Lisp_Object fun = CALLN (Fmake_byte_code, 0, bytestr, vector, maxdepth);
return exec_byte_code (fun, 0, 0, NULL);
}
static void

View file

@ -704,8 +704,8 @@ DEFUN ("clear-composition-cache", Fclear_composition_cache,
Clear composition cache. */)
(void)
{
Lisp_Object args[] = {QCtest, Qequal, QCsize, make_fixnum (311)};
gstring_hash_table = CALLMANY (Fmake_hash_table, args);
gstring_hash_table = CALLN (Fmake_hash_table, QCtest, Qequal,
QCsize, make_fixnum (311));
/* Fixme: We call Fclear_face_cache to force complete re-building of
display glyphs. But, it may be better to call this function from
Fclear_face_cache instead. */

View file

@ -55,14 +55,6 @@ DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0,
return argument;
}
static Lisp_Object
ccall2 (Lisp_Object (f) (ptrdiff_t nargs, Lisp_Object *args),
Lisp_Object arg1, Lisp_Object arg2)
{
Lisp_Object args[2] = {arg1, arg2};
return f (2, args);
}
static Lisp_Object
get_random_bignum (Lisp_Object limit)
{
@ -81,7 +73,7 @@ get_random_bignum (Lisp_Object limit)
EMACS_INT rand = get_random () >> 1;
Lisp_Object lrand = make_fixnum (rand);
bits += bitsperiteration;
val = ccall2 (Flogior,
val = CALLN (Flogior,
Fash (val, make_fixnum (bitsperiteration)),
lrand);
lim = Fash (lim, make_fixnum (- bitsperiteration));
@ -91,9 +83,9 @@ get_random_bignum (Lisp_Object limit)
get_random returns a number so close to INTMASK that the
remainder isn't random. */
Lisp_Object remainder = Frem (val, limit);
if (!NILP (ccall2 (Fleq,
ccall2 (Fminus, val, remainder),
ccall2 (Fminus,
if (!NILP (CALLN (Fleq,
CALLN (Fminus, val, remainder),
CALLN (Fminus,
Fash (make_fixnum (1), make_fixnum (bits)),
limit))))
return remainder;