aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2022-03-14 08:55:46 -0700
committerPaul Eggert2022-03-14 09:06:20 -0700
commit0d0703e9c4fb5ebcd4a87e5ebe78e5f53496621e (patch)
treec5040fbb06469c2f61935db74aeb2340c9ad2011 /src
parentf52dcfd03ad542704d9a43faab0c33be09ab442e (diff)
downloademacs-0d0703e9c4fb5ebcd4a87e5ebe78e5f53496621e.tar.gz
emacs-0d0703e9c4fb5ebcd4a87e5ebe78e5f53496621e.zip
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. */)
325 the original unibyte form. */ 325 the original unibyte form. */
326 bytestr = Fstring_as_unibyte (bytestr); 326 bytestr = Fstring_as_unibyte (bytestr);
327 } 327 }
328 Lisp_Object args[] = {0, bytestr, vector, maxdepth}; 328 Lisp_Object fun = CALLN (Fmake_byte_code, 0, bytestr, vector, maxdepth);
329 return exec_byte_code (Fmake_byte_code (4, args), 0, 0, NULL); 329 return exec_byte_code (fun, 0, 0, NULL);
330} 330}
331 331
332static void 332static 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,
704Clear composition cache. */) 704Clear composition cache. */)
705 (void) 705 (void)
706{ 706{
707 Lisp_Object args[] = {QCtest, Qequal, QCsize, make_fixnum (311)}; 707 gstring_hash_table = CALLN (Fmake_hash_table, QCtest, Qequal,
708 gstring_hash_table = CALLMANY (Fmake_hash_table, args); 708 QCsize, make_fixnum (311));
709 /* Fixme: We call Fclear_face_cache to force complete re-building of 709 /* Fixme: We call Fclear_face_cache to force complete re-building of
710 display glyphs. But, it may be better to call this function from 710 display glyphs. But, it may be better to call this function from
711 Fclear_face_cache instead. */ 711 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,
56} 56}
57 57
58static Lisp_Object 58static Lisp_Object
59ccall2 (Lisp_Object (f) (ptrdiff_t nargs, Lisp_Object *args),
60 Lisp_Object arg1, Lisp_Object arg2)
61{
62 Lisp_Object args[2] = {arg1, arg2};
63 return f (2, args);
64}
65
66static Lisp_Object
67get_random_bignum (Lisp_Object limit) 59get_random_bignum (Lisp_Object limit)
68{ 60{
69 /* This is a naive transcription into bignums of the fixnum algorithm. 61 /* This is a naive transcription into bignums of the fixnum algorithm.
@@ -81,9 +73,9 @@ get_random_bignum (Lisp_Object limit)
81 EMACS_INT rand = get_random () >> 1; 73 EMACS_INT rand = get_random () >> 1;
82 Lisp_Object lrand = make_fixnum (rand); 74 Lisp_Object lrand = make_fixnum (rand);
83 bits += bitsperiteration; 75 bits += bitsperiteration;
84 val = ccall2 (Flogior, 76 val = CALLN (Flogior,
85 Fash (val, make_fixnum (bitsperiteration)), 77 Fash (val, make_fixnum (bitsperiteration)),
86 lrand); 78 lrand);
87 lim = Fash (lim, make_fixnum (- bitsperiteration)); 79 lim = Fash (lim, make_fixnum (- bitsperiteration));
88 } 80 }
89 while (!EQ (lim, make_fixnum (0))); 81 while (!EQ (lim, make_fixnum (0)));
@@ -91,11 +83,11 @@ get_random_bignum (Lisp_Object limit)
91 get_random returns a number so close to INTMASK that the 83 get_random returns a number so close to INTMASK that the
92 remainder isn't random. */ 84 remainder isn't random. */
93 Lisp_Object remainder = Frem (val, limit); 85 Lisp_Object remainder = Frem (val, limit);
94 if (!NILP (ccall2 (Fleq, 86 if (!NILP (CALLN (Fleq,
95 ccall2 (Fminus, val, remainder), 87 CALLN (Fminus, val, remainder),
96 ccall2 (Fminus, 88 CALLN (Fminus,
97 Fash (make_fixnum (1), make_fixnum (bits)), 89 Fash (make_fixnum (1), make_fixnum (bits)),
98 limit)))) 90 limit))))
99 return remainder; 91 return remainder;
100 } 92 }
101} 93}