diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-01-25 08:33:41 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-01-25 09:11:25 -0800 |
commit | a3689d3c661fe36df971c875760f8d500b5ae994 (patch) | |
tree | 80521f91ec481457cb7f8fcb9f88b3a42e557c8e /src/eval.c | |
parent | c4e54f962714056df6c57c21f694544f237d5f4c (diff) | |
download | emacs-a3689d3c661fe36df971c875760f8d500b5ae994.tar.gz |
Count MANY function args more reliably
* alloc.c (Fgc_status, purecopy, unbind_to, garbage_collect_1):
* buffer.c (Fbuffer_list, Fkill_buffer):
* callint.c (read_file_name, Fcall_interactively):
* charset.c (Fset_charset_priority, syms_of_charset):
* chartab.c (uniprop_encode_value_numeric):
* coding.c (syms_of_coding):
* composite.c (syms_of_composite):
* data.c (wrong_range):
* dbusbind.c (syms_of_dbusbind):
* dired.c (file_attributes):
* editfns.c (Fdecode_time, update_buffer_properties, format2):
* eval.c (run_hook_with_args_2, apply1, call1, call2, call3)
(call4, call5, call6, call7):
* fileio.c (Finsert_file_contents, choose_write_coding_system)
(Fcar_less_than_car, build_annotations, auto_save_error):
* filelock.c (get_boot_time):
* fns.c (internal_equal, nconc2, Fyes_or_no_p, Fwidget_apply):
(maybe_resize_hash_table, secure_hash):
* font.c (font_style_to_value, font_open_by_name, Flist_fonts):
* fontset.c (fontset_add, Fset_fontset_font):
* ftfont.c (ftfont_lookup_cache):
* gtkutil.c (xg_get_font):
* insdel.c (signal_before_change, signal_after_change):
* keymap.c (append_key):
* lread.c (load_warn_old_style_backquotes, Fload, init_lread):
* minibuf.c (Fread_buffer):
* print.c (print_preprocess):
* process.c (Fformat_network_address, Fmake_network_process)
(server_accept_connection):
* sound.c (Fplay_sound_internal):
* term.c (Fsuspend_tty, Fresume_tty):
* window.c (window_list):
* xdisp.c (run_redisplay_end_trigger_hook, add_to_log)
(message_with_string):
* xfaces.c (Fx_list_fonts):
* xfont.c (syms_of_xfont):
* xselect.c (x_handle_selection_request)
(x_handle_selection_clear, x_clear_frame_selections)
(x_clipboard_manager_error_1):
Prefer CALLMANY and CALLN to counting args by hand.
* doc.c (reread_doc_file): Remove unused code.
* fns.c (concat2, concat3): Redo to avoid need for local-var vector.
(cmpfn_user_defined, hashfn_user_defined, Fmaphash):
Prefer call1 and call2 to Ffuncall.
* keyboard.c (safe_run_hook_funcall, safe_run_hooks):
Use struct literal rather than a local var, for simplicity.
* keymap.c (where_is_internal): Use NULL rather than a pointer
to unused args.
* lisp.h (CALLMANY, CALLN): New macros.
* sound.c (Fplay_sound_internal): Coalesce duplicate code.
Fixes: bug#19634
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/eval.c b/src/eval.c index e649c152a5d..b98b224e622 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2535,15 +2535,14 @@ run_hook (Lisp_Object hook) void run_hook_with_args_2 (Lisp_Object hook, Lisp_Object arg1, Lisp_Object arg2) { - Frun_hook_with_args (3, ((Lisp_Object []) { hook, arg1, arg2 })); + CALLN (Frun_hook_with_args, hook, arg1, arg2); } /* Apply fn to arg. */ Lisp_Object apply1 (Lisp_Object fn, Lisp_Object arg) { - return (NILP (arg) ? Ffuncall (1, &fn) - : Fapply (2, ((Lisp_Object []) { fn, arg }))); + return NILP (arg) ? Ffuncall (1, &fn) : CALLN (Fapply, fn, arg); } /* Call function fn on no arguments. */ @@ -2558,7 +2557,7 @@ call0 (Lisp_Object fn) Lisp_Object call1 (Lisp_Object fn, Lisp_Object arg1) { - return Ffuncall (2, ((Lisp_Object []) { fn, arg1 })); + return CALLN (Ffuncall, fn, arg1); } /* Call function fn with 2 arguments arg1, arg2. */ @@ -2566,7 +2565,7 @@ call1 (Lisp_Object fn, Lisp_Object arg1) Lisp_Object call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2) { - return Ffuncall (3, ((Lisp_Object []) { fn, arg1, arg2 })); + return CALLN (Ffuncall, fn, arg1, arg2); } /* Call function fn with 3 arguments arg1, arg2, arg3. */ @@ -2574,7 +2573,7 @@ call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2) Lisp_Object call3 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) { - return Ffuncall (4, ((Lisp_Object []) { fn, arg1, arg2, arg3 })); + return CALLN (Ffuncall, fn, arg1, arg2, arg3); } /* Call function fn with 4 arguments arg1, arg2, arg3, arg4. */ @@ -2583,7 +2582,7 @@ Lisp_Object call4 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4) { - return Ffuncall (5, ((Lisp_Object []) { fn, arg1, arg2, arg3, arg4 })); + return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4); } /* Call function fn with 5 arguments arg1, arg2, arg3, arg4, arg5. */ @@ -2592,7 +2591,7 @@ Lisp_Object call5 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4, Lisp_Object arg5) { - return Ffuncall (6, ((Lisp_Object []) { fn, arg1, arg2, arg3, arg4, arg5 })); + return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4, arg5); } /* Call function fn with 6 arguments arg1, arg2, arg3, arg4, arg5, arg6. */ @@ -2601,8 +2600,7 @@ Lisp_Object call6 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6) { - return Ffuncall (7, ((Lisp_Object []) - { fn, arg1, arg2, arg3, arg4, arg5, arg6 })); + return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4, arg5, arg6); } /* Call function fn with 7 arguments arg1, arg2, arg3, arg4, arg5, arg6, arg7. */ @@ -2611,8 +2609,7 @@ Lisp_Object call7 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6, Lisp_Object arg7) { - return Ffuncall (8, ((Lisp_Object []) - { fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7 })); + return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7); } /* The caller should GCPRO all the elements of ARGS. */ |