diff options
| author | Paul Eggert | 2022-03-14 08:55:46 -0700 |
|---|---|---|
| committer | Paul Eggert | 2022-03-14 09:06:20 -0700 |
| commit | 0d0703e9c4fb5ebcd4a87e5ebe78e5f53496621e (patch) | |
| tree | c5040fbb06469c2f61935db74aeb2340c9ad2011 /src | |
| parent | f52dcfd03ad542704d9a43faab0c33be09ab442e (diff) | |
| download | emacs-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.c | 4 | ||||
| -rw-r--r-- | src/composite.c | 4 | ||||
| -rw-r--r-- | src/fns.c | 24 |
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 | ||
| 332 | static void | 332 | 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, | |||
| 704 | Clear composition cache. */) | 704 | Clear 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. */ |
| @@ -56,14 +56,6 @@ DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0, | |||
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | static Lisp_Object | 58 | static Lisp_Object |
| 59 | ccall2 (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 | |||
| 66 | static Lisp_Object | ||
| 67 | get_random_bignum (Lisp_Object limit) | 59 | get_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 | } |