emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0d0703e9c4: Prefer CALLN


From: Paul Eggert
Subject: master 0d0703e9c4: Prefer CALLN
Date: Mon, 14 Mar 2022 12:06:27 -0400 (EDT)

branch: master
commit 0d0703e9c4fb5ebcd4a87e5ebe78e5f53496621e
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    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.
---
 src/bytecode.c  |  4 ++--
 src/composite.c |  4 ++--
 src/fns.c       | 24 ++++++++----------------
 3 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/src/bytecode.c b/src/bytecode.c
index 8704e6069d..65c3ad4da7 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 3659de8900..c2ade90d54 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 06a6456380..e8cf185755 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -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,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;
     }
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]