diff options
| author | Paul Eggert | 2015-01-25 08:33:41 -0800 |
|---|---|---|
| committer | Paul Eggert | 2015-01-25 09:11:25 -0800 |
| commit | a3689d3c661fe36df971c875760f8d500b5ae994 (patch) | |
| tree | 80521f91ec481457cb7f8fcb9f88b3a42e557c8e /src/process.c | |
| parent | c4e54f962714056df6c57c21f694544f237d5f4c (diff) | |
| download | emacs-a3689d3c661fe36df971c875760f8d500b5ae994.tar.gz emacs-a3689d3c661fe36df971c875760f8d500b5ae994.zip | |
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/process.c')
| -rw-r--r-- | src/process.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/process.c b/src/process.c index 0789f20f1d2..1d935ba8a3e 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1338,7 +1338,7 @@ Returns nil if format of ADDRESS is invalid. */) | |||
| 1338 | if (CONSP (address)) | 1338 | if (CONSP (address)) |
| 1339 | { | 1339 | { |
| 1340 | AUTO_STRING (format, "<Family %d>"); | 1340 | AUTO_STRING (format, "<Family %d>"); |
| 1341 | return Fformat (2, (Lisp_Object []) {format, Fcar (address)}); | 1341 | return CALLN (Fformat, format, Fcar (address)); |
| 1342 | } | 1342 | } |
| 1343 | 1343 | ||
| 1344 | return Qnil; | 1344 | return Qnil; |
| @@ -3422,7 +3422,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3422 | struct gcpro gcpro1; | 3422 | struct gcpro gcpro1; |
| 3423 | /* Qt denotes we have not yet called Ffind_operation_coding_system. */ | 3423 | /* Qt denotes we have not yet called Ffind_operation_coding_system. */ |
| 3424 | Lisp_Object coding_systems = Qt; | 3424 | Lisp_Object coding_systems = Qt; |
| 3425 | Lisp_Object fargs[5], val; | 3425 | Lisp_Object val; |
| 3426 | 3426 | ||
| 3427 | if (!NILP (tem)) | 3427 | if (!NILP (tem)) |
| 3428 | { | 3428 | { |
| @@ -3445,10 +3445,10 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3445 | coding_systems = Qnil; | 3445 | coding_systems = Qnil; |
| 3446 | else | 3446 | else |
| 3447 | { | 3447 | { |
| 3448 | fargs[0] = Qopen_network_stream, fargs[1] = name, | ||
| 3449 | fargs[2] = buffer, fargs[3] = host, fargs[4] = service; | ||
| 3450 | GCPRO1 (proc); | 3448 | GCPRO1 (proc); |
| 3451 | coding_systems = Ffind_operation_coding_system (5, fargs); | 3449 | coding_systems = CALLN (Ffind_operation_coding_system, |
| 3450 | Qopen_network_stream, name, buffer, | ||
| 3451 | host, service); | ||
| 3452 | UNGCPRO; | 3452 | UNGCPRO; |
| 3453 | } | 3453 | } |
| 3454 | if (CONSP (coding_systems)) | 3454 | if (CONSP (coding_systems)) |
| @@ -3478,10 +3478,10 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3478 | coding_systems = Qnil; | 3478 | coding_systems = Qnil; |
| 3479 | else | 3479 | else |
| 3480 | { | 3480 | { |
| 3481 | fargs[0] = Qopen_network_stream, fargs[1] = name, | ||
| 3482 | fargs[2] = buffer, fargs[3] = host, fargs[4] = service; | ||
| 3483 | GCPRO1 (proc); | 3481 | GCPRO1 (proc); |
| 3484 | coding_systems = Ffind_operation_coding_system (5, fargs); | 3482 | coding_systems = CALLN (Ffind_operation_coding_system, |
| 3483 | Qopen_network_stream, name, buffer, | ||
| 3484 | host, service); | ||
| 3485 | UNGCPRO; | 3485 | UNGCPRO; |
| 3486 | } | 3486 | } |
| 3487 | } | 3487 | } |
| @@ -4064,12 +4064,12 @@ server_accept_connection (Lisp_Object server, int channel) | |||
| 4064 | unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr; | 4064 | unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr; |
| 4065 | 4065 | ||
| 4066 | AUTO_STRING (ipv4_format, "%d.%d.%d.%d"); | 4066 | AUTO_STRING (ipv4_format, "%d.%d.%d.%d"); |
| 4067 | host = Fformat (5, ((Lisp_Object []) | 4067 | host = CALLN (Fformat, ipv4_format, |
| 4068 | { ipv4_format, make_number (ip[0]), | 4068 | make_number (ip[0]), make_number (ip[1]), |
| 4069 | make_number (ip[1]), make_number (ip[2]), make_number (ip[3]) })); | 4069 | make_number (ip[2]), make_number (ip[3])); |
| 4070 | service = make_number (ntohs (saddr.in.sin_port)); | 4070 | service = make_number (ntohs (saddr.in.sin_port)); |
| 4071 | AUTO_STRING (caller_format, " <%s:%d>"); | 4071 | AUTO_STRING (caller_format, " <%s:%d>"); |
| 4072 | caller = Fformat (3, (Lisp_Object []) {caller_format, host, service}); | 4072 | caller = CALLN (Fformat, caller_format, host, service); |
| 4073 | } | 4073 | } |
| 4074 | break; | 4074 | break; |
| 4075 | 4075 | ||
| @@ -4084,10 +4084,10 @@ server_accept_connection (Lisp_Object server, int channel) | |||
| 4084 | args[0] = ipv6_format; | 4084 | args[0] = ipv6_format; |
| 4085 | for (i = 0; i < 8; i++) | 4085 | for (i = 0; i < 8; i++) |
| 4086 | args[i + 1] = make_number (ntohs (ip6[i])); | 4086 | args[i + 1] = make_number (ntohs (ip6[i])); |
| 4087 | host = Fformat (9, args); | 4087 | host = CALLMANY (Fformat, args); |
| 4088 | service = make_number (ntohs (saddr.in.sin_port)); | 4088 | service = make_number (ntohs (saddr.in.sin_port)); |
| 4089 | AUTO_STRING (caller_format, " <[%s]:%d>"); | 4089 | AUTO_STRING (caller_format, " <[%s]:%d>"); |
| 4090 | caller = Fformat (3, (Lisp_Object []) {caller_format, host, service}); | 4090 | caller = CALLN (Fformat, caller_format, host, service); |
| 4091 | } | 4091 | } |
| 4092 | break; | 4092 | break; |
| 4093 | #endif | 4093 | #endif |