From 791355fd403eb1b9a73221e6ea586539ebdcb5e5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 23 Sep 2015 14:43:26 -0700 Subject: [PATCH] Prefer CALLN in a few more places * src/macfont.m (macfont_set_family_cache): * src/nsterm.m (append2): * src/xterm.c (x_cr_export_frames): Prefer CALLN to allocating the arg arrays by hand. --- src/macfont.m | 8 +------- src/nsterm.m | 5 +---- src/xterm.c | 6 ++---- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/macfont.m b/src/macfont.m index 23d272c9129..97a255bf018 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -945,13 +945,7 @@ macfont_set_family_cache (Lisp_Object symbol, CFStringRef string) Lisp_Object value; if (!HASH_TABLE_P (macfont_family_cache)) - { - Lisp_Object args[2]; - - args[0] = QCtest; - args[1] = Qeq; - macfont_family_cache = Fmake_hash_table (2, args); - } + macfont_family_cache = CALLN (Fmake_hash_table, QCtest, Qeq); h = XHASH_TABLE (macfont_family_cache); i = hash_lookup (h, symbol, &hash); diff --git a/src/nsterm.m b/src/nsterm.m index 14f2beb4489..7c6b9dc1744 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -440,10 +440,7 @@ append2 (Lisp_Object list, Lisp_Object item) Utility to append to a list -------------------------------------------------------------------------- */ { - Lisp_Object array[2]; - array[0] = list; - array[1] = list1 (item); - return Fnconc (2, &array[0]); + return CALLN (Fnconc, list, list1 (item)); } diff --git a/src/xterm.c b/src/xterm.c index 13e1902a0bb..dd54552510c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -575,7 +575,7 @@ x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type) cairo_t *cr; int width, height; void (*surface_set_size_func) (cairo_surface_t *, double, double) = NULL; - Lisp_Object acc = Qnil, args[2]; + Lisp_Object acc = Qnil; int count = SPECPDL_INDEX (); Fredisplay (Qt); @@ -659,9 +659,7 @@ x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type) #endif unbind_to (count, Qnil); - args[0] = intern ("concat"); - args[1] = Fnreverse (acc); - return Fapply (2, args); + return CALLN (Fapply, intern ("concat"), Fnreverse (acc)); } #endif /* USE_CAIRO */ -- 2.39.2