patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconvdata.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jul 28 21:34:41 2007 +0000 (2007-07-28)
changeset 301 2be7232a73ac
permissions -rw-r--r--
Bump version to 0.2.2.
     1 Fixes
     2 
     3 In file included from jis0208.c:23:
     4 jis0208.h:32: error: array type has incomplete element type
     5 when building with gcc-4.0
     6 
     7 In file included from cp1258.c:869:
     8 ../iconv/skeleton.c: In function 'gconv':
     9 ../iconv/skeleton.c:323: error: invalid lvalue in increment
    10 
    11 In file included from cp1255.c:550:
    12 ../iconv/skeleton.c: In function 'gconv':
    13 ../iconv/skeleton.c:323: error: invalid lvalue in increment
    14 
    15 In file included from gb18030.c:22114:
    16 ../iconv/loop.c: In function 'from_gb18030':
    17 ../iconv/loop.c:282: error: invalid lvalue in increment
    18 ../iconv/loop.c: In function 'from_gb18030_single':
    19 ../iconv/loop.c:384: error: invalid lvalue in increment
    20 
    21 In file included from iso8859-1.c:43:
    22 ../iconv/loop.c: In function 'from_iso8859_1':
    23 ../iconv/loop.c:311: error: invalid lvalue in increment
    24 
    25 Rediffed, updated for glibc-2.3.3, added:
    26 
    27 In file included from armscii-8.c:85:
    28 ../iconv/loop.c: In function 'from_armscii_8':
    29 ../iconv/loop.c:311: error: invalid lvalue in increment
    30 ../iconv/loop.c:311: error: invalid lvalue in increment
    31 
    32 --- glibc-2.3.3.orig/iconvdata/armscii-8.c	Mon Dec  2 14:07:52 2002
    33 +++ glibc-2.3.3/iconvdata/armscii-8.c	Thu Mar 17 16:01:23 2005
    34 @@ -57,11 +57,17 @@
    35      uint_fast8_t ch = *inptr;						      \
    36  									      \
    37      if (ch <= 0xa0)							      \
    38 -      /* Upto and including 0xa0 the ARMSCII-8 corresponds to Unicode.  */    \
    39 -      *((uint32_t *) outptr)++ = ch;					      \
    40 +      {									      \
    41 +        /* Upto and including 0xa0 the ARMSCII-8 corresponds to Unicode.  */  \
    42 +        *((uint32_t *) outptr) = ch;					      \
    43 +        outptr += sizeof (uint32_t);					      \
    44 +      }									      \
    45      else if (ch >= 0xa2 && ch <= 0xfe)					      \
    46 -      /* Use the table.  */						      \
    47 -      *((uint32_t *) outptr)++ = map_from_armscii_8[ch - 0xa2];		      \
    48 +      {									      \
    49 +        /* Use the table.  */						      \
    50 +        *((uint32_t *) outptr) = map_from_armscii_8[ch - 0xa2];		      \
    51 +        outptr += sizeof (uint32_t);					      \
    52 +      }									      \
    53      else								      \
    54        {									      \
    55  	/* This is an illegal character.  */				      \
    56 diff -ur glibc-2.3.3.orig/iconvdata/cp1255.c glibc-2.3.3/iconvdata/cp1255.c
    57 --- glibc-2.3.3.orig/iconvdata/cp1255.c	Mon Dec  2 14:07:52 2002
    58 +++ glibc-2.3.3/iconvdata/cp1255.c	Thu Mar 17 08:20:13 2005
    59 @@ -69,7 +69,8 @@
    60  	  if (__builtin_expect (outbuf + 4 <= outend, 1))		      \
    61  	    {								      \
    62  	      /* Write out the last character.  */			      \
    63 -	      *((uint32_t *) outbuf)++ = data->__statep->__count >> 3;	      \
    64 +	      *((uint32_t *) outbuf) = data->__statep->__count >> 3;	      \
    65 +	      outbuf += sizeof (uint32_t);				      \
    66  	      data->__statep->__count = 0;				      \
    67  	    }								      \
    68  	  else								      \
    69 diff -ur glibc-2.3.3.orig/iconvdata/cp1258.c glibc-2.3.3/iconvdata/cp1258.c
    70 --- glibc-2.3.3.orig/iconvdata/cp1258.c	Mon Dec  2 14:07:52 2002
    71 +++ glibc-2.3.3/iconvdata/cp1258.c	Thu Mar 17 08:20:13 2005
    72 @@ -70,7 +70,8 @@
    73  	  if (__builtin_expect (outbuf + 4 <= outend, 1))		      \
    74  	    {								      \
    75  	      /* Write out the last character.  */			      \
    76 -	      *((uint32_t *) outbuf)++ = data->__statep->__count >> 3;	      \
    77 +	      *((uint32_t *) outbuf) = data->__statep->__count >> 3;	      \
    78 +	      outbuf += sizeof (uint32_t);				      \
    79  	      data->__statep->__count = 0;				      \
    80  	    }								      \
    81  	  else								      \
    82 diff -ur glibc-2.3.3.orig/iconvdata/gb18030.c glibc-2.3.3/iconvdata/gb18030.c
    83 --- glibc-2.3.3.orig/iconvdata/gb18030.c	Mon Dec  2 14:07:54 2002
    84 +++ glibc-2.3.3/iconvdata/gb18030.c	Thu Mar 17 08:20:13 2005
    85 @@ -25769,7 +25769,8 @@
    86  	    }							      	      \
    87  	}								      \
    88  									      \
    89 -    *((uint32_t *) outptr)++ = ch;					      \
    90 +    *((uint32_t *) outptr) = ch;					      \
    91 +    outptr += sizeof (uint32_t);					      \
    92    }
    93  #define LOOP_NEED_FLAGS
    94  #define ONEBYTE_BODY \
    95 diff -ur glibc-2.3.3.orig/iconvdata/iso8859-1.c glibc-2.3.3/iconvdata/iso8859-1.c
    96 --- glibc-2.3.3.orig/iconvdata/iso8859-1.c	Mon Dec  2 14:07:56 2002
    97 +++ glibc-2.3.3/iconvdata/iso8859-1.c	Thu Mar 17 08:20:47 2005
    98 @@ -35,7 +35,8 @@
    99  #define MIN_NEEDED_OUTPUT	MIN_NEEDED_TO
   100  #define LOOPFCT			FROM_LOOP
   101  #define BODY \
   102 -  *((uint32_t *) outptr)++ = *inptr++;
   103 +  *((uint32_t *) outptr) = *inptr++;					      \
   104 +  outptr += sizeof (uint32_t);
   105  #define ONEBYTE_BODY \
   106    {									      \
   107      return c;								      \
   108 diff -ur glibc-2.3.3.orig/iconvdata/jis0208.h glibc-2.3.3/iconvdata/jis0208.h
   109 --- glibc-2.3.3.orig/iconvdata/jis0208.h	Wed Jun 11 14:40:42 2003
   110 +++ glibc-2.3.3/iconvdata/jis0208.h	Thu Mar 17 08:20:13 2005
   111 @@ -24,15 +24,6 @@
   112  #include <gconv.h>
   113  #include <stdint.h>
   114  
   115 -/* Conversion table.  */
   116 -extern const uint16_t __jis0208_to_ucs[];
   117 -
   118 -extern const char __jisx0208_from_ucs4_lat1[256][2];
   119 -extern const char __jisx0208_from_ucs4_greek[0xc1][2];
   120 -extern const struct jisx0208_ucs_idx __jisx0208_from_ucs_idx[];
   121 -extern const char __jisx0208_from_ucs_tab[][2];
   122 -
   123 -
   124  /* Struct for table with indeces in UCS mapping table.  */
   125  struct jisx0208_ucs_idx
   126  {
   127 @@ -40,6 +31,15 @@
   128    uint16_t end;
   129    uint16_t idx;
   130  };
   131 +
   132 +
   133 +/* Conversion table.  */
   134 +extern const uint16_t __jis0208_to_ucs[];
   135 +
   136 +extern const char __jisx0208_from_ucs4_lat1[256][2];
   137 +extern const char __jisx0208_from_ucs4_greek[0xc1][2];
   138 +extern const struct jisx0208_ucs_idx __jisx0208_from_ucs_idx[];
   139 +extern const char __jisx0208_from_ucs_tab[][2];
   140  
   141  
   142  static inline uint32_t