X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=charset%2Fcharconv-gen.h;h=f4988548aedc3c19d3039f3343fb776e05ec96bf;hb=5403c0fab834f71416e627dfd7346a577a0ca6f5;hp=6740c1b4f279e310b8b5057e73942269fce74f3c;hpb=39359f268c445fa4a4defb38e644e519c58660f4;p=libucw.git diff --git a/charset/charconv-gen.h b/charset/charconv-gen.h index 6740c1b4..f4988548 100644 --- a/charset/charconv-gen.h +++ b/charset/charconv-gen.h @@ -13,9 +13,10 @@ do { /*** Header ***/ + const byte *s, *se; byte *d, *de; - uns code; + uint code; int e; #ifdef CONV_READ_STD @@ -27,7 +28,7 @@ do { #endif #ifdef CONV_READ_UTF8 - uns cc; + uint cc; #endif if (unlikely(c->state)) @@ -137,8 +138,8 @@ got_code: else { byte *k = string_table + code - 0x100; - uns len = *k++; - if (unlikely(de - d < len)) + uint len = *k++; + if (unlikely((uint)(de - d) < len)) { c->state = SEQ_WRITE; c->string_at = k; @@ -154,7 +155,7 @@ got_code: if (code < 0x80) { if (d >= de) - goto dend; + goto dend_utf; *d++ = code; } else if (code < 0x800) @@ -193,6 +194,7 @@ got_code: else { write_slow: + c->code = code; c->state = UTF16_BE_WRITE; goto go_slow; } @@ -217,6 +219,7 @@ write_slow: else { write_slow: + c->code = code; c->state = UTF16_LE_WRITE; goto go_slow; } @@ -247,10 +250,6 @@ write_slow: #endif #ifdef CONV_WRITE_UTF8 - dend: - c->source = s; - c->dest = d; - return CONV_DEST_END; dend_utf: c->state = UTF8_WRITE_START; c->code = code;