summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-03-14 08:55:46 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2022-03-14 09:06:20 -0700
commit0d0703e9c4fb5ebcd4a87e5ebe78e5f53496621e (patch)
treec5040fbb06469c2f61935db74aeb2340c9ad2011 /src
parentf52dcfd03ad542704d9a43faab0c33be09ab442e (diff)
downloademacs-0d0703e9c4fb5ebcd4a87e5ebe78e5f53496621e.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/bytecode.c4
-rw-r--r--src/composite.c4
-rw-r--r--src/fns.c24
3 files changed, 12 insertions, 20 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index 8704e6069dd..65c3ad4da70 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -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
diff --git a/src/composite.c b/src/composite.c
index 3659de8900c..c2ade90d54a 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -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. */
diff --git a/src/fns.c b/src/fns.c
index 06a64563806..e8cf1857550 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -56,14 +56,6 @@ DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0,
}
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)
{
/* This is a naive transcription into bignums of the fixnum algorithm.
@@ -81,9 +73,9 @@ get_random_bignum (Lisp_Object limit)
EMACS_INT rand = get_random () >> 1;
Lisp_Object lrand = make_fixnum (rand);
bits += bitsperiteration;
- val = ccall2 (Flogior,
- Fash (val, make_fixnum (bitsperiteration)),
- lrand);
+ val = CALLN (Flogior,
+ Fash (val, make_fixnum (bitsperiteration)),
+ lrand);
lim = Fash (lim, make_fixnum (- bitsperiteration));
}
while (!EQ (lim, make_fixnum (0)));
@@ -91,11 +83,11 @@ 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,
- Fash (make_fixnum (1), make_fixnum (bits)),
- limit))))
+ if (!NILP (CALLN (Fleq,
+ CALLN (Fminus, val, remainder),
+ CALLN (Fminus,
+ Fash (make_fixnum (1), make_fixnum (bits)),
+ limit))))
return remainder;
}
}