aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorJoakim Verona2012-07-27 02:22:03 +0200
committerJoakim Verona2012-07-27 02:22:03 +0200
commit5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f (patch)
tree5c55f1096a656a9759f0b53a0b5d1a2289bd366f /src/coding.c
parent0c5c85cf2b350c965bb1ffa5b2d77c2adebc406b (diff)
parent562157c814037dcba58a20cd6908a95992c22283 (diff)
downloademacs-5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f.tar.gz
emacs-5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f.zip
upstream
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/coding.c b/src/coding.c
index 64826ae16b9..212eb8275fe 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1145,8 +1145,8 @@ coding_alloc_by_realloc (struct coding_system *coding, ptrdiff_t bytes)
1145{ 1145{
1146 if (STRING_BYTES_BOUND - coding->dst_bytes < bytes) 1146 if (STRING_BYTES_BOUND - coding->dst_bytes < bytes)
1147 string_overflow (); 1147 string_overflow ();
1148 coding->destination = (unsigned char *) xrealloc (coding->destination, 1148 coding->destination = xrealloc (coding->destination,
1149 coding->dst_bytes + bytes); 1149 coding->dst_bytes + bytes);
1150 coding->dst_bytes += bytes; 1150 coding->dst_bytes += bytes;
1151} 1151}
1152 1152
@@ -3189,7 +3189,7 @@ detect_coding_iso_2022 (struct coding_system *coding,
3189 break; 3189 break;
3190 check_extra_latin: 3190 check_extra_latin:
3191 if (! VECTORP (Vlatin_extra_code_table) 3191 if (! VECTORP (Vlatin_extra_code_table)
3192 || NILP (XVECTOR (Vlatin_extra_code_table)->contents[c])) 3192 || NILP (AREF (Vlatin_extra_code_table, c)))
3193 { 3193 {
3194 rejected = CATEGORY_MASK_ISO; 3194 rejected = CATEGORY_MASK_ISO;
3195 break; 3195 break;
@@ -5464,7 +5464,7 @@ detect_coding_charset (struct coding_system *coding,
5464 if (c < 0xA0 5464 if (c < 0xA0
5465 && check_latin_extra 5465 && check_latin_extra
5466 && (!VECTORP (Vlatin_extra_code_table) 5466 && (!VECTORP (Vlatin_extra_code_table)
5467 || NILP (XVECTOR (Vlatin_extra_code_table)->contents[c]))) 5467 || NILP (AREF (Vlatin_extra_code_table, c))))
5468 break; 5468 break;
5469 found = CATEGORY_MASK_CHARSET; 5469 found = CATEGORY_MASK_CHARSET;
5470 } 5470 }
@@ -7010,7 +7010,7 @@ produce_charset (struct coding_system *coding, int *charbuf, ptrdiff_t pos)
7010 coding->charbuf = NULL; \ 7010 coding->charbuf = NULL; \
7011 while (size > 1024) \ 7011 while (size > 1024) \
7012 { \ 7012 { \
7013 coding->charbuf = (int *) alloca (sizeof (int) * size); \ 7013 coding->charbuf = alloca (sizeof (int) * size); \
7014 if (coding->charbuf) \ 7014 if (coding->charbuf) \
7015 break; \ 7015 break; \
7016 size >>= 1; \ 7016 size >>= 1; \
@@ -7588,7 +7588,7 @@ code_conversion_restore (Lisp_Object arg)
7588 { 7588 {
7589 if (EQ (workbuf, Vcode_conversion_reused_workbuf)) 7589 if (EQ (workbuf, Vcode_conversion_reused_workbuf))
7590 reused_workbuf_in_use = 0; 7590 reused_workbuf_in_use = 0;
7591 else if (! NILP (Fbuffer_live_p (workbuf))) 7591 else
7592 Fkill_buffer (workbuf); 7592 Fkill_buffer (workbuf);
7593 } 7593 }
7594 set_buffer_internal (XBUFFER (current)); 7594 set_buffer_internal (XBUFFER (current));
@@ -8006,7 +8006,7 @@ encode_coding_object (struct coding_system *coding,
8006 { 8006 {
8007 ptrdiff_t dst_bytes = max (1, coding->src_chars); 8007 ptrdiff_t dst_bytes = max (1, coding->src_chars);
8008 coding->dst_object = Qnil; 8008 coding->dst_object = Qnil;
8009 coding->destination = (unsigned char *) xmalloc (dst_bytes); 8009 coding->destination = xmalloc (dst_bytes);
8010 coding->dst_bytes = dst_bytes; 8010 coding->dst_bytes = dst_bytes;
8011 coding->dst_multibyte = 0; 8011 coding->dst_multibyte = 0;
8012 } 8012 }
@@ -9568,7 +9568,7 @@ make_subsidiaries (Lisp_Object base)
9568{ 9568{
9569 Lisp_Object subsidiaries; 9569 Lisp_Object subsidiaries;
9570 ptrdiff_t base_name_len = SBYTES (SYMBOL_NAME (base)); 9570 ptrdiff_t base_name_len = SBYTES (SYMBOL_NAME (base));
9571 char *buf = (char *) alloca (base_name_len + 6); 9571 char *buf = alloca (base_name_len + 6);
9572 int i; 9572 int i;
9573 9573
9574 memcpy (buf, SDATA (SYMBOL_NAME (base)), base_name_len); 9574 memcpy (buf, SDATA (SYMBOL_NAME (base)), base_name_len);
@@ -9791,11 +9791,11 @@ usage: (define-coding-system-internal ...) */)
9791 9791
9792 val = args[coding_arg_ccl_valids]; 9792 val = args[coding_arg_ccl_valids];
9793 valids = Fmake_string (make_number (256), make_number (0)); 9793 valids = Fmake_string (make_number (256), make_number (0));
9794 for (tail = val; !NILP (tail); tail = Fcdr (tail)) 9794 for (tail = val; CONSP (tail); tail = XCDR (tail))
9795 { 9795 {
9796 int from, to; 9796 int from, to;
9797 9797
9798 val = Fcar (tail); 9798 val = XCAR (tail);
9799 if (INTEGERP (val)) 9799 if (INTEGERP (val))
9800 { 9800 {
9801 if (! (0 <= XINT (val) && XINT (val) <= 255)) 9801 if (! (0 <= XINT (val) && XINT (val) <= 255))
@@ -9892,12 +9892,12 @@ usage: (define-coding-system-internal ...) */)
9892 CHECK_NUMBER_CDR (reg_usage); 9892 CHECK_NUMBER_CDR (reg_usage);
9893 9893
9894 request = Fcopy_sequence (args[coding_arg_iso2022_request]); 9894 request = Fcopy_sequence (args[coding_arg_iso2022_request]);
9895 for (tail = request; ! NILP (tail); tail = Fcdr (tail)) 9895 for (tail = request; CONSP (tail); tail = XCDR (tail))
9896 { 9896 {
9897 int id; 9897 int id;
9898 Lisp_Object tmp1; 9898 Lisp_Object tmp1;
9899 9899
9900 val = Fcar (tail); 9900 val = XCAR (tail);
9901 CHECK_CONS (val); 9901 CHECK_CONS (val);
9902 tmp1 = XCAR (val); 9902 tmp1 = XCAR (val);
9903 CHECK_CHARSET_GET_ID (tmp1, id); 9903 CHECK_CHARSET_GET_ID (tmp1, id);
@@ -10350,7 +10350,7 @@ syms_of_coding (void)
10350 Vcode_conversion_reused_workbuf = Qnil; 10350 Vcode_conversion_reused_workbuf = Qnil;
10351 10351
10352 staticpro (&Vcode_conversion_workbuf_name); 10352 staticpro (&Vcode_conversion_workbuf_name);
10353 Vcode_conversion_workbuf_name = make_pure_c_string (" *code-conversion-work*"); 10353 Vcode_conversion_workbuf_name = build_pure_c_string (" *code-conversion-work*");
10354 10354
10355 reused_workbuf_in_use = 0; 10355 reused_workbuf_in_use = 0;
10356 10356
@@ -10413,7 +10413,7 @@ syms_of_coding (void)
10413 Fput (Qcoding_system_error, Qerror_conditions, 10413 Fput (Qcoding_system_error, Qerror_conditions,
10414 pure_cons (Qcoding_system_error, pure_cons (Qerror, Qnil))); 10414 pure_cons (Qcoding_system_error, pure_cons (Qerror, Qnil)));
10415 Fput (Qcoding_system_error, Qerror_message, 10415 Fput (Qcoding_system_error, Qerror_message,
10416 make_pure_c_string ("Invalid coding system")); 10416 build_pure_c_string ("Invalid coding system"));
10417 10417
10418 /* Intern this now in case it isn't already done. 10418 /* Intern this now in case it isn't already done.
10419 Setting this variable twice is harmless. 10419 Setting this variable twice is harmless.
@@ -10560,7 +10560,7 @@ Don't modify this variable directly, but use `set-coding-system-priority'. */);
10560 Vcoding_category_list = Qnil; 10560 Vcoding_category_list = Qnil;
10561 for (i = coding_category_max - 1; i >= 0; i--) 10561 for (i = coding_category_max - 1; i >= 0; i--)
10562 Vcoding_category_list 10562 Vcoding_category_list
10563 = Fcons (XVECTOR (Vcoding_category_table)->contents[i], 10563 = Fcons (AREF (Vcoding_category_table, i),
10564 Vcoding_category_list); 10564 Vcoding_category_list);
10565 } 10565 }
10566 10566
@@ -10686,22 +10686,22 @@ Also used for decoding keyboard input on X Window system. */);
10686 DEFVAR_LISP ("eol-mnemonic-unix", eol_mnemonic_unix, 10686 DEFVAR_LISP ("eol-mnemonic-unix", eol_mnemonic_unix,
10687 doc: /* 10687 doc: /*
10688*String displayed in mode line for UNIX-like (LF) end-of-line format. */); 10688*String displayed in mode line for UNIX-like (LF) end-of-line format. */);
10689 eol_mnemonic_unix = make_pure_c_string (":"); 10689 eol_mnemonic_unix = build_pure_c_string (":");
10690 10690
10691 DEFVAR_LISP ("eol-mnemonic-dos", eol_mnemonic_dos, 10691 DEFVAR_LISP ("eol-mnemonic-dos", eol_mnemonic_dos,
10692 doc: /* 10692 doc: /*
10693*String displayed in mode line for DOS-like (CRLF) end-of-line format. */); 10693*String displayed in mode line for DOS-like (CRLF) end-of-line format. */);
10694 eol_mnemonic_dos = make_pure_c_string ("\\"); 10694 eol_mnemonic_dos = build_pure_c_string ("\\");
10695 10695
10696 DEFVAR_LISP ("eol-mnemonic-mac", eol_mnemonic_mac, 10696 DEFVAR_LISP ("eol-mnemonic-mac", eol_mnemonic_mac,
10697 doc: /* 10697 doc: /*
10698*String displayed in mode line for MAC-like (CR) end-of-line format. */); 10698*String displayed in mode line for MAC-like (CR) end-of-line format. */);
10699 eol_mnemonic_mac = make_pure_c_string ("/"); 10699 eol_mnemonic_mac = build_pure_c_string ("/");
10700 10700
10701 DEFVAR_LISP ("eol-mnemonic-undecided", eol_mnemonic_undecided, 10701 DEFVAR_LISP ("eol-mnemonic-undecided", eol_mnemonic_undecided,
10702 doc: /* 10702 doc: /*
10703*String displayed in mode line when end-of-line format is not yet determined. */); 10703*String displayed in mode line when end-of-line format is not yet determined. */);
10704 eol_mnemonic_undecided = make_pure_c_string (":"); 10704 eol_mnemonic_undecided = build_pure_c_string (":");
10705 10705
10706 DEFVAR_LISP ("enable-character-translation", Venable_character_translation, 10706 DEFVAR_LISP ("enable-character-translation", Venable_character_translation,
10707 doc: /* 10707 doc: /*
@@ -10839,7 +10839,7 @@ internal character representation. */);
10839 plist[10] = intern_c_string (":for-unibyte"); 10839 plist[10] = intern_c_string (":for-unibyte");
10840 plist[11] = args[coding_arg_for_unibyte] = Qt; 10840 plist[11] = args[coding_arg_for_unibyte] = Qt;
10841 plist[12] = intern_c_string (":docstring"); 10841 plist[12] = intern_c_string (":docstring");
10842 plist[13] = make_pure_c_string ("Do no conversion.\n\ 10842 plist[13] = build_pure_c_string ("Do no conversion.\n\
10843\n\ 10843\n\
10844When you visit a file with this coding, the file is read into a\n\ 10844When you visit a file with this coding, the file is read into a\n\
10845unibyte buffer as is, thus each byte of a file is treated as a\n\ 10845unibyte buffer as is, thus each byte of a file is treated as a\n\
@@ -10857,7 +10857,7 @@ character.");
10857 plist[8] = intern_c_string (":charset-list"); 10857 plist[8] = intern_c_string (":charset-list");
10858 plist[9] = args[coding_arg_charset_list] = Fcons (Qascii, Qnil); 10858 plist[9] = args[coding_arg_charset_list] = Fcons (Qascii, Qnil);
10859 plist[11] = args[coding_arg_for_unibyte] = Qnil; 10859 plist[11] = args[coding_arg_for_unibyte] = Qnil;
10860 plist[13] = make_pure_c_string ("No conversion on encoding, automatic conversion on decoding."); 10860 plist[13] = build_pure_c_string ("No conversion on encoding, automatic conversion on decoding.");
10861 plist[15] = args[coding_arg_eol_type] = Qnil; 10861 plist[15] = args[coding_arg_eol_type] = Qnil;
10862 args[coding_arg_plist] = Flist (16, plist); 10862 args[coding_arg_plist] = Flist (16, plist);
10863 Fdefine_coding_system_internal (coding_arg_max, args); 10863 Fdefine_coding_system_internal (coding_arg_max, args);