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/coding.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/coding.c')
| -rw-r--r-- | src/coding.c | 106 |
1 files changed, 50 insertions, 56 deletions
diff --git a/src/coding.c b/src/coding.c index 43ebbe06856..54811588c6a 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -10776,12 +10776,7 @@ void | |||
| 10776 | syms_of_coding (void) | 10776 | syms_of_coding (void) |
| 10777 | { | 10777 | { |
| 10778 | staticpro (&Vcoding_system_hash_table); | 10778 | staticpro (&Vcoding_system_hash_table); |
| 10779 | { | 10779 | Vcoding_system_hash_table = CALLN (Fmake_hash_table, QCtest, Qeq); |
| 10780 | Lisp_Object args[2]; | ||
| 10781 | args[0] = QCtest; | ||
| 10782 | args[1] = Qeq; | ||
| 10783 | Vcoding_system_hash_table = Fmake_hash_table (2, args); | ||
| 10784 | } | ||
| 10785 | 10780 | ||
| 10786 | staticpro (&Vsjis_coding_system); | 10781 | staticpro (&Vsjis_coding_system); |
| 10787 | Vsjis_coding_system = Qnil; | 10782 | Vsjis_coding_system = Qnil; |
| @@ -11269,60 +11264,59 @@ See also `keyboard-translate-table'. | |||
| 11269 | Use of this variable for character code unification was rendered | 11264 | Use of this variable for character code unification was rendered |
| 11270 | obsolete in Emacs 23.1 and later, since Unicode is now the basis of | 11265 | obsolete in Emacs 23.1 and later, since Unicode is now the basis of |
| 11271 | internal character representation. */); | 11266 | internal character representation. */); |
| 11272 | Vtranslation_table_for_input = Qnil; | 11267 | Vtranslation_table_for_input = Qnil; |
| 11273 | 11268 | ||
| 11274 | { | 11269 | Lisp_Object args[coding_arg_undecided_max]; |
| 11275 | Lisp_Object args[coding_arg_undecided_max]; | 11270 | memclear (args, sizeof args); |
| 11276 | memclear (args, sizeof args); | 11271 | |
| 11277 | 11272 | Lisp_Object plist[] = | |
| 11278 | Lisp_Object plist[16]; | 11273 | { |
| 11279 | plist[0] = intern_c_string (":name"); | 11274 | intern_c_string (":name"), |
| 11280 | plist[1] = args[coding_arg_name] = Qno_conversion; | 11275 | args[coding_arg_name] = Qno_conversion, |
| 11281 | plist[2] = intern_c_string (":mnemonic"); | 11276 | intern_c_string (":mnemonic"), |
| 11282 | plist[3] = args[coding_arg_mnemonic] = make_number ('='); | 11277 | args[coding_arg_mnemonic] = make_number ('='), |
| 11283 | plist[4] = intern_c_string (":coding-type"); | 11278 | intern_c_string (":coding-type"), |
| 11284 | plist[5] = args[coding_arg_coding_type] = Qraw_text; | 11279 | args[coding_arg_coding_type] = Qraw_text, |
| 11285 | plist[6] = intern_c_string (":ascii-compatible-p"); | 11280 | intern_c_string (":ascii-compatible-p"), |
| 11286 | plist[7] = args[coding_arg_ascii_compatible_p] = Qt; | 11281 | args[coding_arg_ascii_compatible_p] = Qt, |
| 11287 | plist[8] = intern_c_string (":default-char"); | 11282 | intern_c_string (":default-char"), |
| 11288 | plist[9] = args[coding_arg_default_char] = make_number (0); | 11283 | args[coding_arg_default_char] = make_number (0), |
| 11289 | plist[10] = intern_c_string (":for-unibyte"); | 11284 | intern_c_string (":for-unibyte"), |
| 11290 | plist[11] = args[coding_arg_for_unibyte] = Qt; | 11285 | args[coding_arg_for_unibyte] = Qt, |
| 11291 | plist[12] = intern_c_string (":docstring"); | 11286 | intern_c_string (":docstring"), |
| 11292 | plist[13] = build_pure_c_string ("Do no conversion.\n\ | 11287 | (build_pure_c_string |
| 11293 | \n\ | 11288 | ("Do no conversion.\n" |
| 11294 | When you visit a file with this coding, the file is read into a\n\ | 11289 | "\n" |
| 11295 | unibyte buffer as is, thus each byte of a file is treated as a\n\ | 11290 | "When you visit a file with this coding, the file is read into a\n" |
| 11296 | character."); | 11291 | "unibyte buffer as is, thus each byte of a file is treated as a\n" |
| 11297 | plist[14] = intern_c_string (":eol-type"); | 11292 | "character.")), |
| 11298 | plist[15] = args[coding_arg_eol_type] = Qunix; | 11293 | intern_c_string (":eol-type"), |
| 11299 | args[coding_arg_plist] = Flist (16, plist); | 11294 | args[coding_arg_eol_type] = Qunix, |
| 11300 | Fdefine_coding_system_internal (coding_arg_max, args); | 11295 | }; |
| 11301 | 11296 | args[coding_arg_plist] = CALLMANY (Flist, plist); | |
| 11302 | plist[1] = args[coding_arg_name] = Qundecided; | 11297 | Fdefine_coding_system_internal (coding_arg_max, args); |
| 11303 | plist[3] = args[coding_arg_mnemonic] = make_number ('-'); | 11298 | |
| 11304 | plist[5] = args[coding_arg_coding_type] = Qundecided; | 11299 | plist[1] = args[coding_arg_name] = Qundecided; |
| 11305 | /* This is already set. | 11300 | plist[3] = args[coding_arg_mnemonic] = make_number ('-'); |
| 11306 | plist[7] = args[coding_arg_ascii_compatible_p] = Qt; */ | 11301 | plist[5] = args[coding_arg_coding_type] = Qundecided; |
| 11307 | plist[8] = intern_c_string (":charset-list"); | 11302 | /* This is already set. |
| 11308 | plist[9] = args[coding_arg_charset_list] = Fcons (Qascii, Qnil); | 11303 | plist[7] = args[coding_arg_ascii_compatible_p] = Qt; */ |
| 11309 | plist[11] = args[coding_arg_for_unibyte] = Qnil; | 11304 | plist[8] = intern_c_string (":charset-list"); |
| 11310 | plist[13] = build_pure_c_string ("No conversion on encoding, automatic conversion on decoding."); | 11305 | plist[9] = args[coding_arg_charset_list] = Fcons (Qascii, Qnil); |
| 11311 | plist[15] = args[coding_arg_eol_type] = Qnil; | 11306 | plist[11] = args[coding_arg_for_unibyte] = Qnil; |
| 11312 | args[coding_arg_plist] = Flist (16, plist); | 11307 | plist[13] = build_pure_c_string ("No conversion on encoding, " |
| 11313 | args[coding_arg_undecided_inhibit_null_byte_detection] = make_number (0); | 11308 | "automatic conversion on decoding."); |
| 11314 | args[coding_arg_undecided_inhibit_iso_escape_detection] = make_number (0); | 11309 | plist[15] = args[coding_arg_eol_type] = Qnil; |
| 11315 | Fdefine_coding_system_internal (coding_arg_undecided_max, args); | 11310 | args[coding_arg_plist] = CALLMANY (Flist, plist); |
| 11316 | } | 11311 | args[coding_arg_undecided_inhibit_null_byte_detection] = make_number (0); |
| 11312 | args[coding_arg_undecided_inhibit_iso_escape_detection] = make_number (0); | ||
| 11313 | Fdefine_coding_system_internal (coding_arg_undecided_max, args); | ||
| 11317 | 11314 | ||
| 11318 | setup_coding_system (Qno_conversion, &safe_terminal_coding); | 11315 | setup_coding_system (Qno_conversion, &safe_terminal_coding); |
| 11319 | 11316 | ||
| 11320 | { | 11317 | for (int i = 0; i < coding_category_max; i++) |
| 11321 | int i; | 11318 | Fset (AREF (Vcoding_category_table, i), Qno_conversion); |
| 11322 | 11319 | ||
| 11323 | for (i = 0; i < coding_category_max; i++) | ||
| 11324 | Fset (AREF (Vcoding_category_table, i), Qno_conversion); | ||
| 11325 | } | ||
| 11326 | #if defined (DOS_NT) | 11320 | #if defined (DOS_NT) |
| 11327 | system_eol_type = Qdos; | 11321 | system_eol_type = Qdos; |
| 11328 | #else | 11322 | #else |