Mercurial > emacs
comparison src/coding.c @ 40656:cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
| author | Pavel Jan?k <Pavel@Janik.cz> |
|---|---|
| date | Fri, 02 Nov 2001 20:46:55 +0000 |
| parents | c8caba9185a1 |
| children | 42351475da08 |
comparison
equal
deleted
inserted
replaced
| 40655:45453187feeb | 40656:cdfd4d09b79a |
|---|---|
| 5739 inhibit_pre_post_conversion = 1; | 5739 inhibit_pre_post_conversion = 1; |
| 5740 val = call1 (coding->post_read_conversion, make_number (inserted)); | 5740 val = call1 (coding->post_read_conversion, make_number (inserted)); |
| 5741 inhibit_pre_post_conversion = 0; | 5741 inhibit_pre_post_conversion = 0; |
| 5742 /* Discard the unwind protect. */ | 5742 /* Discard the unwind protect. */ |
| 5743 specpdl_ptr--; | 5743 specpdl_ptr--; |
| 5744 CHECK_NUMBER (val, 0); | 5744 CHECK_NUMBER (val); |
| 5745 inserted += Z - prev_Z; | 5745 inserted += Z - prev_Z; |
| 5746 } | 5746 } |
| 5747 | 5747 |
| 5748 if (orig_point >= from) | 5748 if (orig_point >= from) |
| 5749 { | 5749 { |
| 6146 It is valid if it is a symbol with a non-nil `coding-system' property.\n\ | 6146 It is valid if it is a symbol with a non-nil `coding-system' property.\n\ |
| 6147 The value of property should be a vector of length 5.") | 6147 The value of property should be a vector of length 5.") |
| 6148 (coding_system) | 6148 (coding_system) |
| 6149 Lisp_Object coding_system; | 6149 Lisp_Object coding_system; |
| 6150 { | 6150 { |
| 6151 CHECK_SYMBOL (coding_system, 0); | 6151 CHECK_SYMBOL (coding_system); |
| 6152 if (!NILP (Fcoding_system_p (coding_system))) | 6152 if (!NILP (Fcoding_system_p (coding_system))) |
| 6153 return coding_system; | 6153 return coding_system; |
| 6154 while (1) | 6154 while (1) |
| 6155 Fsignal (Qcoding_system_error, Fcons (coding_system, Qnil)); | 6155 Fsignal (Qcoding_system_error, Fcons (coding_system, Qnil)); |
| 6156 } | 6156 } |
| 6234 { | 6234 { |
| 6235 int from, to; | 6235 int from, to; |
| 6236 int from_byte, to_byte; | 6236 int from_byte, to_byte; |
| 6237 int include_anchor_byte = 0; | 6237 int include_anchor_byte = 0; |
| 6238 | 6238 |
| 6239 CHECK_NUMBER_COERCE_MARKER (start, 0); | 6239 CHECK_NUMBER_COERCE_MARKER (start); |
| 6240 CHECK_NUMBER_COERCE_MARKER (end, 1); | 6240 CHECK_NUMBER_COERCE_MARKER (end); |
| 6241 | 6241 |
| 6242 validate_region (&start, &end); | 6242 validate_region (&start, &end); |
| 6243 from = XINT (start), to = XINT (end); | 6243 from = XINT (start), to = XINT (end); |
| 6244 from_byte = CHAR_TO_BYTE (from); | 6244 from_byte = CHAR_TO_BYTE (from); |
| 6245 to_byte = CHAR_TO_BYTE (to); | 6245 to_byte = CHAR_TO_BYTE (to); |
| 6274 If optional argument HIGHEST is non-nil, return the coding system of\n\ | 6274 If optional argument HIGHEST is non-nil, return the coding system of\n\ |
| 6275 highest priority.") | 6275 highest priority.") |
| 6276 (string, highest) | 6276 (string, highest) |
| 6277 Lisp_Object string, highest; | 6277 Lisp_Object string, highest; |
| 6278 { | 6278 { |
| 6279 CHECK_STRING (string, 0); | 6279 CHECK_STRING (string); |
| 6280 | 6280 |
| 6281 return detect_coding_system (XSTRING (string)->data, | 6281 return detect_coding_system (XSTRING (string)->data, |
| 6282 /* "+ 1" is to include the anchor byte | 6282 /* "+ 1" is to include the anchor byte |
| 6283 `\0'. With this, code detectors can | 6283 `\0'. With this, code detectors can |
| 6284 handle the tailing bytes more | 6284 handle the tailing bytes more |
| 6384 } | 6384 } |
| 6385 else | 6385 else |
| 6386 { | 6386 { |
| 6387 int from, to, stop; | 6387 int from, to, stop; |
| 6388 | 6388 |
| 6389 CHECK_NUMBER_COERCE_MARKER (start, 0); | 6389 CHECK_NUMBER_COERCE_MARKER (start); |
| 6390 CHECK_NUMBER_COERCE_MARKER (end, 1); | 6390 CHECK_NUMBER_COERCE_MARKER (end); |
| 6391 if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end)) | 6391 if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end)) |
| 6392 args_out_of_range (start, end); | 6392 args_out_of_range (start, end); |
| 6393 if (NILP (current_buffer->enable_multibyte_characters)) | 6393 if (NILP (current_buffer->enable_multibyte_characters)) |
| 6394 return Qt; | 6394 return Qt; |
| 6395 from = CHAR_TO_BYTE (XINT (start)); | 6395 from = CHAR_TO_BYTE (XINT (start)); |
| 6451 int encodep; | 6451 int encodep; |
| 6452 { | 6452 { |
| 6453 struct coding_system coding; | 6453 struct coding_system coding; |
| 6454 int from, to; | 6454 int from, to; |
| 6455 | 6455 |
| 6456 CHECK_NUMBER_COERCE_MARKER (start, 0); | 6456 CHECK_NUMBER_COERCE_MARKER (start); |
| 6457 CHECK_NUMBER_COERCE_MARKER (end, 1); | 6457 CHECK_NUMBER_COERCE_MARKER (end); |
| 6458 CHECK_SYMBOL (coding_system, 2); | 6458 CHECK_SYMBOL (coding_system); |
| 6459 | 6459 |
| 6460 validate_region (&start, &end); | 6460 validate_region (&start, &end); |
| 6461 from = XFASTINT (start); | 6461 from = XFASTINT (start); |
| 6462 to = XFASTINT (end); | 6462 to = XFASTINT (end); |
| 6463 | 6463 |
| 6511 Lisp_Object string, coding_system, nocopy; | 6511 Lisp_Object string, coding_system, nocopy; |
| 6512 int encodep; | 6512 int encodep; |
| 6513 { | 6513 { |
| 6514 struct coding_system coding; | 6514 struct coding_system coding; |
| 6515 | 6515 |
| 6516 CHECK_STRING (string, 0); | 6516 CHECK_STRING (string); |
| 6517 CHECK_SYMBOL (coding_system, 1); | 6517 CHECK_SYMBOL (coding_system); |
| 6518 | 6518 |
| 6519 if (NILP (coding_system)) | 6519 if (NILP (coding_system)) |
| 6520 return (NILP (nocopy) ? Fcopy_sequence (string) : string); | 6520 return (NILP (nocopy) ? Fcopy_sequence (string) : string); |
| 6521 | 6521 |
| 6522 if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) | 6522 if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) |
| 6570 Lisp_Object string, coding_system; | 6570 Lisp_Object string, coding_system; |
| 6571 int encodep; | 6571 int encodep; |
| 6572 { | 6572 { |
| 6573 struct coding_system coding; | 6573 struct coding_system coding; |
| 6574 | 6574 |
| 6575 CHECK_STRING (string, 0); | 6575 CHECK_STRING (string); |
| 6576 CHECK_SYMBOL (coding_system, 1); | 6576 CHECK_SYMBOL (coding_system); |
| 6577 | 6577 |
| 6578 if (NILP (coding_system)) | 6578 if (NILP (coding_system)) |
| 6579 return string; | 6579 return string; |
| 6580 | 6580 |
| 6581 if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) | 6581 if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) |
| 6595 Lisp_Object code; | 6595 Lisp_Object code; |
| 6596 { | 6596 { |
| 6597 unsigned char c1, c2, s1, s2; | 6597 unsigned char c1, c2, s1, s2; |
| 6598 Lisp_Object val; | 6598 Lisp_Object val; |
| 6599 | 6599 |
| 6600 CHECK_NUMBER (code, 0); | 6600 CHECK_NUMBER (code); |
| 6601 s1 = (XFASTINT (code)) >> 8, s2 = (XFASTINT (code)) & 0xFF; | 6601 s1 = (XFASTINT (code)) >> 8, s2 = (XFASTINT (code)) & 0xFF; |
| 6602 if (s1 == 0) | 6602 if (s1 == 0) |
| 6603 { | 6603 { |
| 6604 if (s2 < 0x80) | 6604 if (s2 < 0x80) |
| 6605 XSETFASTINT (val, s2); | 6605 XSETFASTINT (val, s2); |
| 6626 Lisp_Object ch; | 6626 Lisp_Object ch; |
| 6627 { | 6627 { |
| 6628 int charset, c1, c2, s1, s2; | 6628 int charset, c1, c2, s1, s2; |
| 6629 Lisp_Object val; | 6629 Lisp_Object val; |
| 6630 | 6630 |
| 6631 CHECK_NUMBER (ch, 0); | 6631 CHECK_NUMBER (ch); |
| 6632 SPLIT_CHAR (XFASTINT (ch), charset, c1, c2); | 6632 SPLIT_CHAR (XFASTINT (ch), charset, c1, c2); |
| 6633 if (charset == CHARSET_ASCII) | 6633 if (charset == CHARSET_ASCII) |
| 6634 { | 6634 { |
| 6635 val = ch; | 6635 val = ch; |
| 6636 } | 6636 } |
| 6658 { | 6658 { |
| 6659 int charset; | 6659 int charset; |
| 6660 unsigned char b1, b2, c1, c2; | 6660 unsigned char b1, b2, c1, c2; |
| 6661 Lisp_Object val; | 6661 Lisp_Object val; |
| 6662 | 6662 |
| 6663 CHECK_NUMBER (code, 0); | 6663 CHECK_NUMBER (code); |
| 6664 b1 = (XFASTINT (code)) >> 8, b2 = (XFASTINT (code)) & 0xFF; | 6664 b1 = (XFASTINT (code)) >> 8, b2 = (XFASTINT (code)) & 0xFF; |
| 6665 if (b1 == 0) | 6665 if (b1 == 0) |
| 6666 { | 6666 { |
| 6667 if (b2 >= 0x80) | 6667 if (b2 >= 0x80) |
| 6668 error ("Invalid BIG5 code: %x", XFASTINT (code)); | 6668 error ("Invalid BIG5 code: %x", XFASTINT (code)); |
| 6686 Lisp_Object ch; | 6686 Lisp_Object ch; |
| 6687 { | 6687 { |
| 6688 int charset, c1, c2, b1, b2; | 6688 int charset, c1, c2, b1, b2; |
| 6689 Lisp_Object val; | 6689 Lisp_Object val; |
| 6690 | 6690 |
| 6691 CHECK_NUMBER (ch, 0); | 6691 CHECK_NUMBER (ch); |
| 6692 SPLIT_CHAR (XFASTINT (ch), charset, c1, c2); | 6692 SPLIT_CHAR (XFASTINT (ch), charset, c1, c2); |
| 6693 if (charset == CHARSET_ASCII) | 6693 if (charset == CHARSET_ASCII) |
| 6694 { | 6694 { |
| 6695 val = ch; | 6695 val = ch; |
| 6696 } | 6696 } |
| 6711 Fset_terminal_coding_system_internal, | 6711 Fset_terminal_coding_system_internal, |
| 6712 Sset_terminal_coding_system_internal, 1, 1, 0, "") | 6712 Sset_terminal_coding_system_internal, 1, 1, 0, "") |
| 6713 (coding_system) | 6713 (coding_system) |
| 6714 Lisp_Object coding_system; | 6714 Lisp_Object coding_system; |
| 6715 { | 6715 { |
| 6716 CHECK_SYMBOL (coding_system, 0); | 6716 CHECK_SYMBOL (coding_system); |
| 6717 setup_coding_system (Fcheck_coding_system (coding_system), &terminal_coding); | 6717 setup_coding_system (Fcheck_coding_system (coding_system), &terminal_coding); |
| 6718 /* We had better not send unsafe characters to terminal. */ | 6718 /* We had better not send unsafe characters to terminal. */ |
| 6719 terminal_coding.flags |= CODING_FLAG_ISO_SAFE; | 6719 terminal_coding.flags |= CODING_FLAG_ISO_SAFE; |
| 6720 /* Character composition should be disabled. */ | 6720 /* Character composition should be disabled. */ |
| 6721 terminal_coding.composing = COMPOSITION_DISABLED; | 6721 terminal_coding.composing = COMPOSITION_DISABLED; |
| 6730 Fset_safe_terminal_coding_system_internal, | 6730 Fset_safe_terminal_coding_system_internal, |
| 6731 Sset_safe_terminal_coding_system_internal, 1, 1, 0, "") | 6731 Sset_safe_terminal_coding_system_internal, 1, 1, 0, "") |
| 6732 (coding_system) | 6732 (coding_system) |
| 6733 Lisp_Object coding_system; | 6733 Lisp_Object coding_system; |
| 6734 { | 6734 { |
| 6735 CHECK_SYMBOL (coding_system, 0); | 6735 CHECK_SYMBOL (coding_system); |
| 6736 setup_coding_system (Fcheck_coding_system (coding_system), | 6736 setup_coding_system (Fcheck_coding_system (coding_system), |
| 6737 &safe_terminal_coding); | 6737 &safe_terminal_coding); |
| 6738 /* Character composition should be disabled. */ | 6738 /* Character composition should be disabled. */ |
| 6739 safe_terminal_coding.composing = COMPOSITION_DISABLED; | 6739 safe_terminal_coding.composing = COMPOSITION_DISABLED; |
| 6740 /* Error notification should be suppressed. */ | 6740 /* Error notification should be suppressed. */ |
| 6756 Fset_keyboard_coding_system_internal, | 6756 Fset_keyboard_coding_system_internal, |
| 6757 Sset_keyboard_coding_system_internal, 1, 1, 0, "") | 6757 Sset_keyboard_coding_system_internal, 1, 1, 0, "") |
| 6758 (coding_system) | 6758 (coding_system) |
| 6759 Lisp_Object coding_system; | 6759 Lisp_Object coding_system; |
| 6760 { | 6760 { |
| 6761 CHECK_SYMBOL (coding_system, 0); | 6761 CHECK_SYMBOL (coding_system); |
| 6762 setup_coding_system (Fcheck_coding_system (coding_system), &keyboard_coding); | 6762 setup_coding_system (Fcheck_coding_system (coding_system), &keyboard_coding); |
| 6763 /* Character composition should be disabled. */ | 6763 /* Character composition should be disabled. */ |
| 6764 keyboard_coding.composing = COMPOSITION_DISABLED; | 6764 keyboard_coding.composing = COMPOSITION_DISABLED; |
| 6765 return Qnil; | 6765 return Qnil; |
| 6766 } | 6766 } |
