comparison src/coding.c @ 34988:8cd5e6ad71a2

(detect_coding_iso2022, setup_coding_system): Remove unused variable `i'. (detect_coding_mask): Remove unused variable `idx'. (detect_coding): Remove unused variable `i'. (ccl_coding_driver): Remove unused variable `result'. (run_pre_post_conversion_on_str): Remove unused variable `prev'. (decode_coding_string): Remove unused variables `to' and `gcpro1'. (encode_coding_string): Remove unused variables `gcpro1' and `saved_coding_symbol'. (Ffind_coding_systems_region_internal): Remove function-local variable args[], leave only the block-local one. (code_convert_region1): Remove unused variable `len'.
author Eli Zaretskii <eliz@gnu.org>
date Tue, 02 Jan 2001 14:26:22 +0000
parents 3868f2e7355a
children e3e1ff3616fa
comparison
equal deleted inserted replaced
34987:cf1115a9c758 34988:8cd5e6ad71a2
1328 int multibytep; 1328 int multibytep;
1329 { 1329 {
1330 int mask = CODING_CATEGORY_MASK_ISO; 1330 int mask = CODING_CATEGORY_MASK_ISO;
1331 int mask_found = 0; 1331 int mask_found = 0;
1332 int reg[4], shift_out = 0, single_shifting = 0; 1332 int reg[4], shift_out = 0, single_shifting = 0;
1333 int c, c1, i, charset; 1333 int c, c1, charset;
1334 /* Dummy for ONE_MORE_BYTE. */ 1334 /* Dummy for ONE_MORE_BYTE. */
1335 struct coding_system dummy_coding; 1335 struct coding_system dummy_coding;
1336 struct coding_system *coding = &dummy_coding; 1336 struct coding_system *coding = &dummy_coding;
1337 Lisp_Object safe_chars; 1337 Lisp_Object safe_chars;
1338 1338
3381 Lisp_Object coding_system; 3381 Lisp_Object coding_system;
3382 struct coding_system *coding; 3382 struct coding_system *coding;
3383 { 3383 {
3384 Lisp_Object coding_spec, coding_type, eol_type, plist; 3384 Lisp_Object coding_spec, coding_type, eol_type, plist;
3385 Lisp_Object val; 3385 Lisp_Object val;
3386 int i;
3387 3386
3388 /* At first, zero clear all members. */ 3387 /* At first, zero clear all members. */
3389 bzero (coding, sizeof (struct coding_system)); 3388 bzero (coding, sizeof (struct coding_system));
3390 3389
3391 /* Initialize some fields required for all kinds of coding systems. */ 3390 /* Initialize some fields required for all kinds of coding systems. */
3926 int multibytep; 3925 int multibytep;
3927 { 3926 {
3928 register unsigned char c; 3927 register unsigned char c;
3929 unsigned char *src = source, *src_end = source + src_bytes; 3928 unsigned char *src = source, *src_end = source + src_bytes;
3930 unsigned int mask, utf16_examined_p, iso2022_examined_p; 3929 unsigned int mask, utf16_examined_p, iso2022_examined_p;
3931 int i, idx; 3930 int i;
3932 3931
3933 /* At first, skip all ASCII characters and control characters except 3932 /* At first, skip all ASCII characters and control characters except
3934 for three ISO2022 specific control characters. */ 3933 for three ISO2022 specific control characters. */
3935 ascii_skip_code[ISO_CODE_SO] = 0; 3934 ascii_skip_code[ISO_CODE_SO] = 0;
3936 ascii_skip_code[ISO_CODE_SI] = 0; 3935 ascii_skip_code[ISO_CODE_SI] = 0;
4088 struct coding_system *coding; 4087 struct coding_system *coding;
4089 unsigned char *src; 4088 unsigned char *src;
4090 int src_bytes; 4089 int src_bytes;
4091 { 4090 {
4092 unsigned int idx; 4091 unsigned int idx;
4093 int skip, mask, i; 4092 int skip, mask;
4094 Lisp_Object val; 4093 Lisp_Object val;
4095 4094
4096 val = Vcoding_category_list; 4095 val = Vcoding_category_list;
4097 mask = detect_coding_mask (src, src_bytes, coding_priorities, &skip, 4096 mask = detect_coding_mask (src, src_bytes, coding_priorities, &skip,
4098 coding->src_multibyte); 4097 coding->src_multibyte);
4420 unsigned char *source, *destination; 4419 unsigned char *source, *destination;
4421 int src_bytes, dst_bytes, encodep; 4420 int src_bytes, dst_bytes, encodep;
4422 { 4421 {
4423 struct ccl_program *ccl 4422 struct ccl_program *ccl
4424 = encodep ? &coding->spec.ccl.encoder : &coding->spec.ccl.decoder; 4423 = encodep ? &coding->spec.ccl.encoder : &coding->spec.ccl.decoder;
4425 int result;
4426 unsigned char *dst = destination; 4424 unsigned char *dst = destination;
4427 4425
4428 ccl->last_block = coding->mode & CODING_MODE_LAST_BLOCK; 4426 ccl->last_block = coding->mode & CODING_MODE_LAST_BLOCK;
4429 if (encodep) 4427 if (encodep)
4430 { 4428 {
5741 struct coding_system *coding; 5739 struct coding_system *coding;
5742 int encodep; 5740 int encodep;
5743 { 5741 {
5744 int count = specpdl_ptr - specpdl; 5742 int count = specpdl_ptr - specpdl;
5745 struct gcpro gcpro1; 5743 struct gcpro gcpro1;
5746 struct buffer *prev = current_buffer;
5747 int multibyte = STRING_MULTIBYTE (str); 5744 int multibyte = STRING_MULTIBYTE (str);
5748 5745
5749 record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); 5746 record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
5750 record_unwind_protect (code_convert_region_unwind, Qnil); 5747 record_unwind_protect (code_convert_region_unwind, Qnil);
5751 GCPRO1 (str); 5748 GCPRO1 (str);
5778 struct coding_system *coding; 5775 struct coding_system *coding;
5779 int nocopy; 5776 int nocopy;
5780 { 5777 {
5781 int len; 5778 int len;
5782 struct conversion_buffer buf; 5779 struct conversion_buffer buf;
5783 int from, to, to_byte; 5780 int from, to_byte;
5784 struct gcpro gcpro1; 5781 struct gcpro gcpro1;
5785 Lisp_Object saved_coding_symbol; 5782 Lisp_Object saved_coding_symbol;
5786 int result; 5783 int result;
5787 int require_decoding; 5784 int require_decoding;
5788 int shrinked_bytes = 0; 5785 int shrinked_bytes = 0;
5789 Lisp_Object newstr; 5786 Lisp_Object newstr;
5790 int consumed, consumed_char, produced, produced_char; 5787 int consumed, consumed_char, produced, produced_char;
5791 5788
5792 from = 0; 5789 from = 0;
5793 to = XSTRING (str)->size;
5794 to_byte = STRING_BYTES (XSTRING (str)); 5790 to_byte = STRING_BYTES (XSTRING (str));
5795 5791
5796 saved_coding_symbol = Qnil; 5792 saved_coding_symbol = Qnil;
5797 coding->src_multibyte = STRING_MULTIBYTE (str); 5793 coding->src_multibyte = STRING_MULTIBYTE (str);
5798 coding->dst_multibyte = 1; 5794 coding->dst_multibyte = 1;
5947 int nocopy; 5943 int nocopy;
5948 { 5944 {
5949 int len; 5945 int len;
5950 struct conversion_buffer buf; 5946 struct conversion_buffer buf;
5951 int from, to, to_byte; 5947 int from, to, to_byte;
5952 struct gcpro gcpro1;
5953 Lisp_Object saved_coding_symbol;
5954 int result; 5948 int result;
5955 int shrinked_bytes = 0; 5949 int shrinked_bytes = 0;
5956 Lisp_Object newstr; 5950 Lisp_Object newstr;
5957 int consumed, consumed_char, produced, produced_char; 5951 int consumed, consumed_char, produced, produced_char;
5958 5952
5961 str = run_pre_post_conversion_on_str (str, coding, 1); 5955 str = run_pre_post_conversion_on_str (str, coding, 1);
5962 5956
5963 from = 0; 5957 from = 0;
5964 to = XSTRING (str)->size; 5958 to = XSTRING (str)->size;
5965 to_byte = STRING_BYTES (XSTRING (str)); 5959 to_byte = STRING_BYTES (XSTRING (str));
5966
5967 saved_coding_symbol = Qnil;
5968 5960
5969 /* Encoding routines determine the multibyteness of the source text 5961 /* Encoding routines determine the multibyteness of the source text
5970 by coding->src_multibyte. */ 5962 by coding->src_multibyte. */
5971 coding->src_multibyte = STRING_MULTIBYTE (str); 5963 coding->src_multibyte = STRING_MULTIBYTE (str);
5972 coding->dst_multibyte = 0; 5964 coding->dst_multibyte = 0;
6308 { 6300 {
6309 Lisp_Object work_table, safe_codings; 6301 Lisp_Object work_table, safe_codings;
6310 int non_ascii_p = 0; 6302 int non_ascii_p = 0;
6311 int single_byte_char_found = 0; 6303 int single_byte_char_found = 0;
6312 unsigned char *p1, *p1end, *p2, *p2end, *p; 6304 unsigned char *p1, *p1end, *p2, *p2end, *p;
6313 Lisp_Object args[2];
6314 6305
6315 if (STRINGP (start)) 6306 if (STRINGP (start))
6316 { 6307 {
6317 if (!STRING_MULTIBYTE (start)) 6308 if (!STRING_MULTIBYTE (start))
6318 return Qt; 6309 return Qt;
6386 code_convert_region1 (start, end, coding_system, encodep) 6377 code_convert_region1 (start, end, coding_system, encodep)
6387 Lisp_Object start, end, coding_system; 6378 Lisp_Object start, end, coding_system;
6388 int encodep; 6379 int encodep;
6389 { 6380 {
6390 struct coding_system coding; 6381 struct coding_system coding;
6391 int from, to, len; 6382 int from, to;
6392 6383
6393 CHECK_NUMBER_COERCE_MARKER (start, 0); 6384 CHECK_NUMBER_COERCE_MARKER (start, 0);
6394 CHECK_NUMBER_COERCE_MARKER (end, 1); 6385 CHECK_NUMBER_COERCE_MARKER (end, 1);
6395 CHECK_SYMBOL (coding_system, 2); 6386 CHECK_SYMBOL (coding_system, 2);
6396 6387