summary refs log tree commit diff
path: root/iconvdata/gb18030.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-06-28 21:23:06 +0000
committerUlrich Drepper <drepper@redhat.com>2002-06-28 21:23:06 +0000
commite438a4684563c16b6d8bfb8e4066d277133e1912 (patch)
tree2b719edc95cbbb5a2f33f5588bb52a04daa9e717 /iconvdata/gb18030.c
parent8dae594a51bdac0e5a045196b1af25e8974812a8 (diff)
downloadglibc-e438a4684563c16b6d8bfb8e4066d277133e1912.tar.gz
glibc-e438a4684563c16b6d8bfb8e4066d277133e1912.tar.xz
glibc-e438a4684563c16b6d8bfb8e4066d277133e1912.zip
Update.
2002-05-26  Bruno Haible  <bruno@clisp.org>
	* iconv/loop.c (STANDARD_FROM_LOOP_ERR_HANDLER): New macro.
	(STANDARD_TO_LOOP_ERR_HANDLER): Renamed from STANDARD_ERR_HANDLER.
	All callers changed.
	* iconv/gconv_simple.c (ascii_internal_loop): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	(utf8_internal_loop): Likewise.
	(ucs2_internal_loop): Likewise.
	(internal_ucs2_loop): Perform error handling like in
	STANDARD_FROM_LOOP_ERR_HANDLER.
	* iconvdata/unicode.c (BODY for TO_LOOP): Perform error handling like
	in STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error
	handling.
	* iconvdata/utf-16.c (BODY for TO_LOOP): Perform error handling like
	in STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error
	handling.
	* iconvdata/utf-32.c (BODY for TO_LOOP): Perform error handling like
	in STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error
	handling.
	* iconvdata/big5.c (BODY for FROM_LOOP): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	* iconvdata/iso-2022-jp.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/8bit-gap.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/8bit-generic.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/ansi_x3.110.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/armscii-8.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/cp1255.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/cp1258.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/euc-cn.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/euc-jisx0213.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/euc-jp.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/euc-kr.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/euc-tw.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/big5hkscs.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/gb18030.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/gbk.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso-2022-cn-ext.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso-2022-cn.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso-2022-jp-3.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso-2022-kr.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso646.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso_6937-2.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso_6937.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/johab.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/shift_jisx0213.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/sjis.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/t.61.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/uhc.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/utf-7.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/gbbig5.c (BODY for FROM_LOOP): Likewise.  When ignoring
	an error, still set result = __GCONV_ILLEGAL_INPUT.
	(BODY for TO_LOOP): Likewise.
	* iconvdata/ibm930.c (BODY for FROM_LOOP): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/ibm932.c: Include <dlfcn.h> and <stdint.h>.
	(BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error
	handling.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/ibm933.c (BODY for FROM_LOOP): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/ibm935.c (BODY for FROM_LOOP): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/ibm937.c (BODY for FROM_LOOP): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/ibm939.c (BODY for FROM_LOOP): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/ibm943.c: Include <dlfcn.h> and <stdint.h>.
	(BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error
	handling.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/gbgbk.c (BODY for FROM_LOOP): Update.
	* iconvdata/iso8859-1.c (BODY for TO_LOOP): Update.
	* iconvdata/tcvn5712-1.c (BODY for TO_LOOP): Update.

2002-06-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/sh/dl-machine.h (elf_machine_load_address): Use local
	labels in assembler instructions.
Diffstat (limited to 'iconvdata/gb18030.c')
-rw-r--r--iconvdata/gb18030.c80
1 files changed, 8 insertions, 72 deletions
diff --git a/iconvdata/gb18030.c b/iconvdata/gb18030.c
index 9358b06494..f6b3576416 100644
--- a/iconvdata/gb18030.c
+++ b/iconvdata/gb18030.c
@@ -25671,15 +25671,7 @@ static const unsigned char __ucs_to_gb18030_tab2[8192][2] =
       if (ch < 0x81 || ch > 0xfe)					      \
 	{								      \
 	  /* This is illegal.  */					      \
-	  if (! ignore_errors_p ())					      \
-	    {								      \
-	      result = __GCONV_ILLEGAL_INPUT;				      \
-	      break;							      \
-	    }								      \
-									      \
-	  ++inptr;							      \
-	  ++*irreversible;						      \
-	  continue;							      \
+	  STANDARD_FROM_LOOP_ERR_HANDLER (1);				      \
 	}								      \
       else								      \
 	{								      \
@@ -25700,18 +25692,7 @@ static const unsigned char __ucs_to_gb18030_tab2[8192][2] =
 									      \
 	  /* All second bytes of a multibyte character must be >= 0x30. */    \
 	  if (ch2 < 0x30)						      \
-	    {								      \
-	      if (! ignore_errors_p ())					      \
-		{							      \
-		  /* This is an illegal character.  */			      \
-		  result = __GCONV_ILLEGAL_INPUT;			      \
-		  break;						      \
-		}							      \
-									      \
-	      inptr += 2;						      \
-	      ++*irreversible;						      \
-	      continue;							      \
-	    }								      \
+	    STANDARD_FROM_LOOP_ERR_HANDLER (2);				      \
 									      \
 	  if (ch2 >= 0x30 && ch2 <= 0x39)				      \
 	    {								      \
@@ -25732,16 +25713,7 @@ static const unsigned char __ucs_to_gb18030_tab2[8192][2] =
 	      if (ch3 < 0x81 || ch3 > 0xfe)				      \
 		{							      \
 		  /* This is an illegal character.  */			      \
-		  if (! ignore_errors_p ())				      \
-		    {							      \
-		      /* This is an illegal character.  */		      \
-		      result = __GCONV_ILLEGAL_INPUT;			      \
-		      break;						      \
-		    }							      \
-									      \
-		  inptr += 3;						      \
-		  ++*irreversible;					      \
-		  continue;						      \
+		  STANDARD_FROM_LOOP_ERR_HANDLER (3);			      \
 		}							      \
 									      \
 	      ch4 = inptr[3];						      \
@@ -25749,16 +25721,7 @@ static const unsigned char __ucs_to_gb18030_tab2[8192][2] =
 	      if (ch4 < 0x30 || ch4 > 0x39)				      \
 		{							      \
 		  /* This is an illegal character.  */			      \
-		  if (! ignore_errors_p ())				      \
-		    {							      \
-		      /* This is an illegal character.  */		      \
-		      result = __GCONV_ILLEGAL_INPUT;			      \
-		      break;						      \
-		    }							      \
-									      \
-		  inptr += 4;						      \
-		  ++*irreversible;					      \
-		  continue;						      \
+		  STANDARD_FROM_LOOP_ERR_HANDLER (4);			      \
 		}							      \
 	      idx = (((ch - 0x81) * 10 + (ch2 - 0x30)) * 126		      \
 		      + ch3 - 0x81) * 10 + ch4 - 0x30;			      \
@@ -25779,16 +25742,7 @@ static const unsigned char __ucs_to_gb18030_tab2[8192][2] =
 	      if (ch == 0 && *inptr != '\0')				      \
 		{							      \
 		  /* This is an illegal character.  */			      \
-		  if (! ignore_errors_p ())				      \
-		    {							      \
-		      /* This is an illegal character.  */		      \
-		      result = __GCONV_ILLEGAL_INPUT;			      \
-		      break;						      \
-		    }							      \
-									      \
-		  inptr += 4;						      \
-		  ++*irreversible;					      \
-		  continue;						      \
+		  STANDARD_FROM_LOOP_ERR_HANDLER (4);			      \
 		}							      \
 									      \
 	      inptr += 4;						      \
@@ -25803,16 +25757,7 @@ static const unsigned char __ucs_to_gb18030_tab2[8192][2] =
 		      ch == 0 && *inptr != '\0'))			      \
 		{							      \
 		  /* This is an illegal character.  */			      \
-		 if (! ignore_errors_p ())				      \
-		    {							      \
-		      /* This is an illegal character.  */		      \
-		      result = __GCONV_ILLEGAL_INPUT;			      \
-		      break;						      \
-		    }							      \
-									      \
-		  inptr += 2;						      \
-		  ++*irreversible;					      \
-		  continue;						      \
+		  STANDARD_FROM_LOOP_ERR_HANDLER (2);			      \
 		}							      \
 									      \
 	      inptr += 2;						      \
@@ -25820,16 +25765,7 @@ static const unsigned char __ucs_to_gb18030_tab2[8192][2] =
 	  else								      \
 	    {								      \
 	      /* This is an illegal character.  */			      \
-	      if (! ignore_errors_p ())					      \
-		{							      \
-		  /* This is an illegal character.  */			      \
-		  result = __GCONV_ILLEGAL_INPUT;			      \
-		  break;						      \
-		}							      \
-									      \
-	      inptr += 2;						      \
-	      ++*irreversible;						      \
-	      continue;							      \
+	      STANDARD_FROM_LOOP_ERR_HANDLER (2);			      \
 	    }							      	      \
 	}								      \
 									      \
@@ -25895,7 +25831,7 @@ static const unsigned char __ucs_to_gb18030_tab2[8192][2] =
 	    || (len == 2 && __builtin_expect (cp[0], '\1') == '\0'))          \
 	  {								      \
 	    /* Illegal character.  */					      \
-	    STANDARD_ERR_HANDLER (4);					      \
+	    STANDARD_TO_LOOP_ERR_HANDLER (4);				      \
 	  }								      \
 									      \
 	if (len == 2)							      \