From b721a2c03c079f8939fae82823b6f75ef5b6639b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 12 Apr 2001 20:26:40 +0000 Subject: Update. 2001-04-12 Bruno Haible * iconvdata/TESTS2: New file. * iconvdata/run-iconv-test.sh: Also run tests from TESTS2. * iconvdata/testdata/alfabeta..UTF-8: New file. * iconvdata/testdata/alfabeta..UTF-16.BE: New file. * iconvdata/testdata/alfabeta..UTF-16.LE: New file. * iconvdata/testdata/alfabeta..UTF-32.BE: New file. * iconvdata/testdata/alfabeta..UTF-32.LE: New file. 2001-04-11 Bruno Haible * iconvdata/utf-32.c: New file. * iconvdata/gconv-modules: Add entries for UTF-32, UTF-32LE, UTF-32BE. * iconvdata/Makefile (modules): Add UTF-32. (distribute): Add utf-32.c. 2001-04-11 Bruno Haible * iconvdata/utf-16.c (PREPARE_LOOP): Initialize 'swap' after possibly changing it in the state. After incrementing 'inptr', store it back. * iconvdata/unicode.c (PREPARE_LOOP): After incrementing 'inptr', store it back. 2001-04-11 Bruno Haible * iconvdata/utf-16.c (gconv_init): Use MAX_NEEDED_FROM, not MIN_NEEDED_FROM. --- iconvdata/utf-16.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'iconvdata/utf-16.c') diff --git a/iconvdata/utf-16.c b/iconvdata/utf-16.c index c40e296..6001b36 100644 --- a/iconvdata/utf-16.c +++ b/iconvdata/utf-16.c @@ -1,5 +1,5 @@ /* Conversion module for UTF-16. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1999. @@ -44,7 +44,7 @@ #define PREPARE_LOOP \ enum direction dir = ((struct utf16_data *) step->__data)->dir; \ enum variant var = ((struct utf16_data *) step->__data)->var; \ - int swap = ((struct utf16_data *) step->__data)->swap; \ + int swap; \ if (FROM_DIRECTION && var == UTF_16) \ { \ if (data->__invocation_counter == 0) \ @@ -55,11 +55,11 @@ \ if (get16u (inptr) == BOM) \ /* Simply ignore the BOM character. */ \ - inptr += 2; \ + *inptrp = inptr += 2; \ else if (get16u (inptr) == BOM_OE) \ { \ ((struct utf16_data *) step->__data)->swap = 1; \ - inptr += 2; \ + *inptrp = inptr += 2; \ } \ } \ } \ @@ -72,7 +72,8 @@ \ put16u (outbuf, BOM); \ outbuf += 2; \ - } + } \ + swap = ((struct utf16_data *) step->__data)->swap; #define EXTRA_LOOP_ARGS , var, swap @@ -159,7 +160,7 @@ gconv_init (struct __gconv_step *step) if (dir == from_utf16) { step->__min_needed_from = MIN_NEEDED_FROM; - step->__max_needed_from = MIN_NEEDED_FROM; + step->__max_needed_from = MAX_NEEDED_FROM; step->__min_needed_to = MIN_NEEDED_TO; step->__max_needed_to = MIN_NEEDED_TO; } @@ -168,7 +169,7 @@ gconv_init (struct __gconv_step *step) step->__min_needed_from = MIN_NEEDED_TO; step->__max_needed_from = MIN_NEEDED_TO; step->__min_needed_to = MIN_NEEDED_FROM; - step->__max_needed_to = MIN_NEEDED_FROM; + step->__max_needed_to = MAX_NEEDED_FROM; } step->__stateful = 0; -- cgit v1.1