From: tomo Date: Sat, 11 Sep 1999 16:06:46 +0000 (+0000) Subject: (Fmake_coding_system): Don't set up `codesys->fixed.size'. X-Git-Tag: r21-2-19-utf-2000-0_7-0~36 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=042049cc7b9892b641c75d4033d25c972209dc8a;p=chise%2Fxemacs-chise.git (Fmake_coding_system): Don't set up `codesys->fixed.size'. (encode_coding_no_conversion): Use `if' instead of `switch'. --- diff --git a/src/text-coding.c b/src/text-coding.c index 1e12bd4..5a0ca98 100644 --- a/src/text-coding.c +++ b/src/text-coding.c @@ -869,10 +869,6 @@ if TYPE is 'ccl: CHECK_STRING (doc_string); CODING_SYSTEM_DOC_STRING (codesys) = doc_string; -#ifdef UTF2000 - if (ty == CODESYS_NO_CONVERSION) - codesys->fixed.size = 1; -#endif EXTERNAL_PROPERTY_LIST_LOOP (rest, key, value, props) { if (EQ (key, Qmnemonic)) @@ -4956,80 +4952,54 @@ encode_coding_no_conversion (Lstream *encoding, CONST unsigned char *src, { c = *src++; #ifdef UTF2000 - switch (char_boundary) + if (char_boundary == 0) + if ( c >= 0xfc ) + { + ch = c & 0x01; + char_boundary = 5; + } + else if ( c >= 0xf8 ) + { + ch = c & 0x03; + char_boundary = 4; + } + else if ( c >= 0xf0 ) + { + ch = c & 0x07; + char_boundary = 3; + } + else if ( c >= 0xe0 ) + { + ch = c & 0x0f; + char_boundary = 2; + } + else if ( c >= 0xc0 ) + { + ch = c & 0x1f; + char_boundary = 1; + } + else + { + ch = 0; + if (c == '\n') + { + if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT) + Dynarr_add (dst, '\r'); + if (eol_type != EOL_CR) + Dynarr_add (dst, c); + } + else + Dynarr_add (dst, c); + char_boundary = 0; + } + else if (char_boundary == 1) { - case 0: - if ( c >= 0xfc ) - { - ch = c & 0x01; - char_boundary = 5; - } - else if ( c >= 0xf8 ) - { - ch = c & 0x03; - char_boundary = 4; - } - else if ( c >= 0xf0 ) - { - ch = c & 0x07; - char_boundary = 3; - } - else if ( c >= 0xe0 ) - { - ch = c & 0x0f; - char_boundary = 2; - } - else if ( c >= 0xc0 ) - { - ch = c & 0x1f; - char_boundary = 1; - } - else - { - ch = 0; - - if (c == '\n') - { - if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT) - Dynarr_add (dst, '\r'); - if (eol_type != EOL_CR) - Dynarr_add (dst, c); - } - else - Dynarr_add (dst, c); - char_boundary = 0; - } - break; - case 1: ch = ( ch << 6 ) | ( c & 0x3f ); - switch ( str->codesys->fixed.size ) - { - case 1: - Dynarr_add (dst, ch & 0xff); - break; - case 2: - Dynarr_add (dst, (ch >> 8) & 0xff); - Dynarr_add (dst, ch & 0xff); - break; - case 3: - Dynarr_add (dst, (ch >> 16) & 0xff); - Dynarr_add (dst, (ch >> 8) & 0xff); - Dynarr_add (dst, ch & 0xff); - break; - case 4: - Dynarr_add (dst, (ch >> 24) & 0xff); - Dynarr_add (dst, (ch >> 16) & 0xff); - Dynarr_add (dst, (ch >> 8) & 0xff); - Dynarr_add (dst, ch & 0xff); - break; - default: - fprintf(stderr, "It seems %d bytes stream.\n", - str->codesys->fixed.size); - abort (); - } + Dynarr_add (dst, ch & 0xff); char_boundary = 0; - break; - default: + } + else + { ch = ( ch << 6 ) | ( c & 0x3f ); char_boundary--; }