summaryrefslogtreecommitdiff
path: root/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-gconv.patch
blob: 3d6df5bd45be0885cf96d9dada74f15afedf7d64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
Fixes
gconv_open.c: In function `__gconv_open':
gconv_open.c:186: error: invalid lvalue in assignment
when building glibc-2.3.2 with gcc-3.5.

wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/iconv/gconv_simple.c.diff?r1=1.59&r2=1.63&cvsroot=glibc'
        * (internal_ucs4_loop): Fix typo in last change.

        * (internal_ucs4le_loop): Remove cast used as lvalue.

        * Fix last commit.

	* iconv/gconv_simple.c (ucs4le_internal_loop): Remove cast used as lvalue.
	(internal_ucs4le_loop_single): Likewise.
	(ucs4_internal_loop): Likewise.
	(BODY): Likewise.
	(internal_ucs4_loop_single): Likewise.

wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/iconv/gconv_open.c.diff?r1=1.32&r2=1.33&cvsroot=glibc'
	* iconv/gconv_simple.c (ucs4le_internal_loop): Remove cast used as lvalue.
	(internal_ucs4le_loop_single): Likewise.
	(ucs4_internal_loop): Likewise.
	(BODY): Likewise.
	(internal_ucs4_loop_single): Likewise.


===================================================================
RCS file: /cvs/glibc/libc/iconv/gconv_open.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- libc/iconv/gconv_open.c	2001/11/29 04:51:58	1.32
+++ libc/iconv/gconv_open.c	2004/02/07 15:56:32	1.33
@@ -1,5 +1,5 @@
 /* Find matching transformation algorithms and initialize steps.
-   Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -182,8 +182,13 @@
 	      || __builtin_expect (__gconv_translit_find (runp), 0) == 0)
 	    lastp = runp;
 	  else
-	    /* This means we haven't found the module.  Remove it.  */
-	    (lastp == NULL ? trans : lastp->next) = runp->next;
+	    {
+	      /* This means we haven't found the module.  Remove it.  */
+	      if (lastp == NULL)
+		trans  = runp->next;
+	      else
+		lastp->next  = runp->next;
+	    }
 	}
 
       /* Allocate room for handle.  */
===================================================================
RCS file: /cvs/glibc/libc/iconv/gconv_simple.c,v
retrieving revision 1.59
retrieving revision 1.63
diff -u -r1.59 -r1.63
--- libc/iconv/gconv_simple.c	2003/06/11 21:36:37	1.59
+++ libc/iconv/gconv_simple.c	2004/03/09 10:00:31	1.63
@@ -1,5 +1,5 @@
 /* Simple transformations functions.
-   Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1997-2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -87,12 +87,13 @@
 #if __BYTE_ORDER == __LITTLE_ENDIAN
   /* Sigh, we have to do some real work.  */
   size_t cnt;
+  uint32_t *outptr32 = (uint32_t *) outptr;
 
   for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
-    *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr);
+    *outptr32++ = bswap_32 (*(const uint32_t *) inptr);
 
   *inptrp = inptr;
-  *outptrp = outptr;
+  *outptrp = (unsigned char *) outptr32;
 #elif __BYTE_ORDER == __BIG_ENDIAN
   /* Simply copy the data.  */
   *inptrp = inptr + n_convert * 4;
@@ -192,13 +193,16 @@
   (*outptrp)[2] = state->__value.__wchb[1];
   (*outptrp)[3] = state->__value.__wchb[0];
 
-  *outptrp += 4;
 #elif __BYTE_ORDER == __BIG_ENDIAN
   /* XXX unaligned */
-  *(*((uint32_t **) outptrp)++) = state->__value.__wch;
+  (*outptrp)[0] = state->__value.__wchb[0];
+  (*outptrp)[1] = state->__value.__wchb[1];
+  (*outptrp)[2] = state->__value.__wchb[2];
+  (*outptrp)[3] = state->__value.__wchb[3];
 #else
 # error "This endianess is not supported."
 #endif
+  *outptrp += 4;
 
   /* Clear the state buffer.  */
   state->__count &= ~7;
@@ -268,7 +272,8 @@
 	  return __GCONV_ILLEGAL_INPUT;
 	}
 
-      *((uint32_t *) outptr)++ = inval;
+      *((uint32_t *) outptr) = inval;
+      outptr += sizeof (uint32_t);
     }
 
   *inptrp = inptr;
@@ -447,9 +452,11 @@
 #if __BYTE_ORDER == __BIG_ENDIAN
   /* Sigh, we have to do some real work.  */
   size_t cnt;
+  uint32_t *outptr32 = (uint32_t *) outptr;
 
   for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
-    *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr);
+    *outptr32++ = bswap_32 (*(const uint32_t *) inptr);
+  outptr = (unsigned char *) outptr32;
 
   *inptrp = inptr;
   *outptrp = outptr;
@@ -555,12 +562,17 @@
   (*outptrp)[2] = state->__value.__wchb[1];
   (*outptrp)[3] = state->__value.__wchb[0];
 
-  *outptrp += 4;
 #else
   /* XXX unaligned */
-  *(*((uint32_t **) outptrp)++) = state->__value.__wch;
+  (*outptrp)[0] = state->__value.__wchb[0];
+  (*outptrp)[1] = state->__value.__wchb[1];
+  (*outptrp)[2] = state->__value.__wchb[2];
+  (*outptrp)[3] = state->__value.__wchb[3];
+
 #endif
 
+  *outptrp += 4;
+
   /* Clear the state buffer.  */
   state->__count &= ~7;
 
@@ -626,7 +638,8 @@
 	  return __GCONV_ILLEGAL_INPUT;
 	}
 
-      *((uint32_t *) outptr)++ = inval;
+      *((uint32_t *) outptr) = inval;
+      outptr += sizeof (uint32_t);
     }
 
   *inptrp = inptr;
@@ -808,7 +821,8 @@
       }									      \
     else								      \
       /* It's an one byte sequence.  */					      \
-      *((uint32_t *) outptr)++ = *inptr++;				      \
+      *((uint32_t *) outptr) = *inptr++;				      \
+      outptr += sizeof (uint32_t);					      \
   }
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
@@ -838,7 +852,8 @@
       }									      \
     else								      \
       /* It's an one byte sequence.  */					      \
-      *outptr++ = *((const uint32_t *) inptr)++;			      \
+      *outptr++ = *((const uint32_t *) inptr);				      \
+      inptr += sizeof (uint32_t);					      \
   }
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
@@ -1032,7 +1047,8 @@
       }									      \
 									      \
     /* Now adjust the pointers and store the result.  */		      \
-    *((uint32_t *) outptr)++ = ch;					      \
+    *((uint32_t *) outptr) = ch;					      \
+    outptr += sizeof (uint32_t);					      \
   }
 #define LOOP_NEED_FLAGS
 
@@ -1153,7 +1169,8 @@
 	STANDARD_FROM_LOOP_ERR_HANDLER (2);				      \
       }									      \
 									      \
-    *((uint32_t *) outptr)++ = u1;					      \
+    *((uint32_t *) outptr) = u1;					      \
+    outptr += sizeof (uint32_t);					      \
     inptr += 2;								      \
   }
 #define LOOP_NEED_FLAGS
@@ -1201,7 +1218,8 @@
       }									      \
     else								      \
       {									      \
-	*((uint16_t *) outptr)++ = val;					      \
+	*((uint16_t *) outptr) = val;					      \
+        outptr += sizeof (uint16_t);					      \
 	inptr += 4;							      \
       }									      \
   }
@@ -1242,7 +1260,8 @@
 	continue;							      \
       }									      \
 									      \
-    *((uint32_t *) outptr)++ = u1;					      \
+    *((uint32_t *) outptr) = u1;					      \
+    outptr += sizeof (uint32_t);					      \
     inptr += 2;								      \
   }
 #define LOOP_NEED_FLAGS
@@ -1291,7 +1310,8 @@
       }									      \
     else								      \
       {									      \
-	*((uint16_t *) outptr)++ = bswap_16 (val);			      \
+	*((uint16_t *) outptr) = bswap_16 (val);			      \
+	outptr += sizeof (uint16_t);					      \
 	inptr += 4;							      \
       }									      \
   }