Mercurial > hg > xemacs-beta
comparison src/unicode.c @ 1887:1e5b7843dfa0
[xemacs-hg @ 2004-01-27 17:55:15 by james]
Shut up compiler warnings from ICC 8.0 about signed 1-bit fields.
author | james |
---|---|
date | Tue, 27 Jan 2004 17:55:18 +0000 |
parents | a8d8f419b459 |
children | 04bc9d2f42c7 |
comparison
equal
deleted
inserted
replaced
1886:ee0959363838 | 1887:1e5b7843dfa0 |
---|---|
1478 }; | 1478 }; |
1479 | 1479 |
1480 struct unicode_coding_system | 1480 struct unicode_coding_system |
1481 { | 1481 { |
1482 enum unicode_type type; | 1482 enum unicode_type type; |
1483 int little_endian :1; | 1483 unsigned int little_endian :1; |
1484 int need_bom :1; | 1484 unsigned int need_bom :1; |
1485 }; | 1485 }; |
1486 | 1486 |
1487 #define CODING_SYSTEM_UNICODE_TYPE(codesys) \ | 1487 #define CODING_SYSTEM_UNICODE_TYPE(codesys) \ |
1488 (CODING_SYSTEM_TYPE_DATA (codesys, unicode)->type) | 1488 (CODING_SYSTEM_TYPE_DATA (codesys, unicode)->type) |
1489 #define XCODING_SYSTEM_UNICODE_TYPE(codesys) \ | 1489 #define XCODING_SYSTEM_UNICODE_TYPE(codesys) \ |
1519 is not found, instead. | 1519 is not found, instead. |
1520 #### do something more appropriate (use blob?) | 1520 #### do something more appropriate (use blob?) |
1521 Danger, Will Robinson! Data loss. Should we signal user? */ | 1521 Danger, Will Robinson! Data loss. Should we signal user? */ |
1522 static void | 1522 static void |
1523 decode_unicode_char (int ch, unsigned_char_dynarr *dst, | 1523 decode_unicode_char (int ch, unsigned_char_dynarr *dst, |
1524 struct unicode_coding_stream *data, int ignore_bom) | 1524 struct unicode_coding_stream *data, |
1525 unsigned int ignore_bom) | |
1525 { | 1526 { |
1526 if (ch == 0xFEFF && !data->seen_char && ignore_bom) | 1527 if (ch == 0xFEFF && !data->seen_char && ignore_bom) |
1527 ; | 1528 ; |
1528 else | 1529 else |
1529 { | 1530 { |
1552 data->seen_char = 1; | 1553 data->seen_char = 1; |
1553 } | 1554 } |
1554 | 1555 |
1555 static void | 1556 static void |
1556 encode_unicode_char_1 (int code, unsigned_char_dynarr *dst, | 1557 encode_unicode_char_1 (int code, unsigned_char_dynarr *dst, |
1557 enum unicode_type type, int little_endian) | 1558 enum unicode_type type, unsigned int little_endian) |
1558 { | 1559 { |
1559 switch (type) | 1560 switch (type) |
1560 { | 1561 { |
1561 case UNICODE_UTF_16: | 1562 case UNICODE_UTF_16: |
1562 if (little_endian) | 1563 if (little_endian) |
1637 } | 1638 } |
1638 | 1639 |
1639 static void | 1640 static void |
1640 encode_unicode_char (Lisp_Object charset, int h, int l, | 1641 encode_unicode_char (Lisp_Object charset, int h, int l, |
1641 unsigned_char_dynarr *dst, enum unicode_type type, | 1642 unsigned_char_dynarr *dst, enum unicode_type type, |
1642 int little_endian) | 1643 unsigned int little_endian) |
1643 { | 1644 { |
1644 #ifdef MULE | 1645 #ifdef MULE |
1645 int code = ichar_to_unicode (make_ichar (charset, h & 127, l & 127)); | 1646 int code = ichar_to_unicode (make_ichar (charset, h & 127, l & 127)); |
1646 | 1647 |
1647 if (code == -1) | 1648 if (code == -1) |
1674 { | 1675 { |
1675 unsigned int ch = str->ch; | 1676 unsigned int ch = str->ch; |
1676 struct unicode_coding_stream *data = CODING_STREAM_TYPE_DATA (str, unicode); | 1677 struct unicode_coding_stream *data = CODING_STREAM_TYPE_DATA (str, unicode); |
1677 enum unicode_type type = | 1678 enum unicode_type type = |
1678 XCODING_SYSTEM_UNICODE_TYPE (str->codesys); | 1679 XCODING_SYSTEM_UNICODE_TYPE (str->codesys); |
1679 int little_endian = XCODING_SYSTEM_UNICODE_LITTLE_ENDIAN (str->codesys); | 1680 unsigned int little_endian = |
1680 int ignore_bom = XCODING_SYSTEM_UNICODE_NEED_BOM (str->codesys); | 1681 XCODING_SYSTEM_UNICODE_LITTLE_ENDIAN (str->codesys); |
1682 unsigned int ignore_bom = XCODING_SYSTEM_UNICODE_NEED_BOM (str->codesys); | |
1681 Bytecount orign = n; | 1683 Bytecount orign = n; |
1682 | 1684 |
1683 if (str->direction == CODING_DECODE) | 1685 if (str->direction == CODING_DECODE) |
1684 { | 1686 { |
1685 unsigned char counter = data->counter; | 1687 unsigned char counter = data->counter; |
2122 int seen_really_bogus_utf8; | 2124 int seen_really_bogus_utf8; |
2123 int seen_2byte_sequence; | 2125 int seen_2byte_sequence; |
2124 int seen_longer_sequence; | 2126 int seen_longer_sequence; |
2125 int seen_iso2022_esc; | 2127 int seen_iso2022_esc; |
2126 int seen_iso_shift; | 2128 int seen_iso_shift; |
2127 int seen_utf_bom:1; | 2129 unsigned int seen_utf_bom:1; |
2128 }; | 2130 }; |
2129 | 2131 |
2130 static void | 2132 static void |
2131 utf_8_detect (struct detection_state *st, const UExtbyte *src, | 2133 utf_8_detect (struct detection_state *st, const UExtbyte *src, |
2132 Bytecount n) | 2134 Bytecount n) |