]>
Commit | Line | Data |
---|---|---|
e7a0b6e3 ER |
1 | Submitted By: Michael (rabenkind at selfservix dot org) |
2 | Date: 2009-07-15 | |
3 | Initial Package Version: 3.5.10 | |
4 | Origin: http://de-mirror.org/distro/frugalware/frugalware-current/source/kde/kdelibs/ | |
5 | Upstream Status: Unknown | |
6 | Description: Fix compilation with gcc-4.4 | |
7 | ||
e7a0b6e3 ER |
8 | --- kdelibs-3.5.10/kjs/dtoa.cpp.orig 2009-05-26 17:20:54.673539511 +0200 |
9 | +++ kdelibs-3.5.10/kjs/dtoa.cpp 2009-05-26 17:24:20.117023777 +0200 | |
10 | @@ -207,11 +207,7 @@ typedef unsigned Long ULong; | |
11 | #endif | |
12 | ||
13 | #ifdef MALLOC | |
14 | -#ifdef KR_headers | |
15 | -extern char *MALLOC(); | |
16 | -#else | |
17 | extern void *MALLOC(size_t); | |
18 | -#endif | |
19 | #else | |
20 | #define MALLOC malloc | |
21 | #endif | |
22 | @@ -273,12 +269,8 @@ extern "C" { | |
23 | #endif | |
24 | ||
25 | #ifndef CONST | |
26 | -#ifdef KR_headers | |
27 | -#define CONST /* blank */ | |
28 | -#else | |
29 | #define CONST const | |
30 | #endif | |
31 | -#endif | |
32 | ||
33 | #if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1 | |
34 | Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined. | |
35 | @@ -286,37 +278,19 @@ Exactly one of IEEE_8087, IEEE_MC68k, VA | |
36 | ||
37 | typedef union { double d; ULong L[2]; } U; | |
38 | ||
39 | -#ifdef YES_ALIAS | |
40 | -#define dval(x) x | |
41 | +#define dval(x) (x).d | |
42 | #ifdef IEEE_8087 | |
43 | -#define word0(x) ((ULong *)&x)[1] | |
44 | -#define word1(x) ((ULong *)&x)[0] | |
45 | +#define word0(x) (x).L[1] | |
46 | +#define word1(x) (x).L[0] | |
47 | #else | |
48 | -#define word0(x) ((ULong *)&x)[0] | |
49 | -#define word1(x) ((ULong *)&x)[1] | |
50 | -#endif | |
51 | -#else | |
52 | -#ifdef IEEE_8087 | |
53 | -#define word0(x) ((U*)&x)->L[1] | |
54 | -#define word1(x) ((U*)&x)->L[0] | |
55 | -#else | |
56 | -#define word0(x) ((U*)&x)->L[0] | |
57 | -#define word1(x) ((U*)&x)->L[1] | |
58 | -#endif | |
59 | -#define dval(x) ((U*)&x)->d | |
60 | +#define word0(x) (x).L[0] | |
61 | +#define word1(x) (x).L[1] | |
62 | #endif | |
63 | ||
64 | /* The following definition of Storeinc is appropriate for MIPS processors. | |
65 | * An alternative that might be better on some machines is | |
66 | - * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff) | |
67 | */ | |
68 | -#if defined(IEEE_8087) + defined(VAX) | |
69 | -#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \ | |
70 | -((unsigned short *)a)[0] = (unsigned short)c, a++) | |
71 | -#else | |
72 | -#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \ | |
73 | -((unsigned short *)a)[1] = (unsigned short)c, a++) | |
74 | -#endif | |
75 | +#define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff) | |
76 | ||
77 | /* #define P DBL_MANT_DIG */ | |
78 | /* Ten_pmax = floor(P*log(2)/log(5)) */ | |
79 | @@ -440,11 +414,7 @@ typedef union { double d; ULong L[2]; } | |
80 | #ifdef RND_PRODQUOT | |
81 | #define rounded_product(a,b) a = rnd_prod(a, b) | |
82 | #define rounded_quotient(a,b) a = rnd_quot(a, b) | |
83 | -#ifdef KR_headers | |
84 | -extern double rnd_prod(), rnd_quot(); | |
85 | -#else | |
86 | extern double rnd_prod(double, double), rnd_quot(double, double); | |
87 | -#endif | |
88 | #else | |
89 | #define rounded_product(a,b) a *= b | |
90 | #define rounded_quotient(a,b) a /= b | |
91 | @@ -457,11 +427,7 @@ extern double rnd_prod(double, double), | |
92 | #define Pack_32 | |
93 | #endif | |
94 | ||
95 | -#ifdef KR_headers | |
96 | -#define FFFFFFFF ((((unsigned long)0xffff)<<16)|(unsigned long)0xffff) | |
97 | -#else | |
98 | #define FFFFFFFF 0xffffffffUL | |
99 | -#endif | |
100 | ||
101 | #ifdef NO_LONG_LONG | |
102 | #undef ULLong | |
103 | @@ -502,11 +468,7 @@ Bigint { | |
104 | ||
105 | static Bigint * | |
106 | Balloc | |
107 | -#ifdef KR_headers | |
108 | - (k) int k; | |
109 | -#else | |
110 | (int k) | |
111 | -#endif | |
112 | { | |
113 | int x; | |
114 | Bigint *rv; | |
115 | @@ -542,11 +504,7 @@ Balloc | |
116 | ||
117 | static void | |
118 | Bfree | |
119 | -#ifdef KR_headers | |
120 | - (v) Bigint *v; | |
121 | -#else | |
122 | (Bigint *v) | |
123 | -#endif | |
124 | { | |
125 | if (v) { | |
126 | ACQUIRE_DTOA_LOCK(0); | |
127 | @@ -561,11 +519,7 @@ y->wds*sizeof(Long) + 2*sizeof(int)) | |
128 | ||
129 | static Bigint * | |
130 | multadd | |
131 | -#ifdef KR_headers | |
132 | - (b, m, a) Bigint *b; int m, a; | |
133 | -#else | |
134 | (Bigint *b, int m, int a) /* multiply by m and add a */ | |
135 | -#endif | |
136 | { | |
137 | int i, wds; | |
138 | #ifdef ULLong | |
139 | @@ -618,11 +572,7 @@ multadd | |
140 | ||
141 | static Bigint * | |
142 | s2b | |
143 | -#ifdef KR_headers | |
144 | - (s, nd0, nd, y9) CONST char *s; int nd0, nd; ULong y9; | |
145 | -#else | |
146 | (CONST char *s, int nd0, int nd, ULong y9) | |
147 | -#endif | |
148 | { | |
149 | Bigint *b; | |
150 | int i, k; | |
151 | @@ -656,11 +606,7 @@ s2b | |
152 | ||
153 | static int | |
154 | hi0bits | |
155 | -#ifdef KR_headers | |
156 | - (x) register ULong x; | |
157 | -#else | |
158 | (register ULong x) | |
159 | -#endif | |
160 | { | |
161 | register int k = 0; | |
162 | ||
163 | @@ -690,11 +636,7 @@ hi0bits | |
164 | ||
165 | static int | |
166 | lo0bits | |
167 | -#ifdef KR_headers | |
168 | - (y) ULong *y; | |
169 | -#else | |
170 | (ULong *y) | |
171 | -#endif | |
172 | { | |
173 | register int k; | |
174 | register ULong x = *y; | |
175 | @@ -738,11 +680,7 @@ lo0bits | |
176 | ||
177 | static Bigint * | |
178 | i2b | |
179 | -#ifdef KR_headers | |
180 | - (i) int i; | |
181 | -#else | |
182 | (int i) | |
183 | -#endif | |
184 | { | |
185 | Bigint *b; | |
186 | ||
187 | @@ -754,11 +692,7 @@ i2b | |
188 | ||
189 | static Bigint * | |
190 | mult | |
191 | -#ifdef KR_headers | |
192 | - (a, b) Bigint *a, *b; | |
193 | -#else | |
194 | (Bigint *a, Bigint *b) | |
195 | -#endif | |
196 | { | |
197 | Bigint *c; | |
198 | int k, wa, wb, wc; | |
199 | @@ -866,11 +800,7 @@ mult | |
200 | ||
201 | static Bigint * | |
202 | pow5mult | |
203 | -#ifdef KR_headers | |
204 | - (b, k) Bigint *b; int k; | |
205 | -#else | |
206 | (Bigint *b, int k) | |
207 | -#endif | |
208 | { | |
209 | Bigint *b1, *p5, *p51; | |
210 | int i; | |
211 | @@ -923,11 +853,7 @@ pow5mult | |
212 | ||
213 | static Bigint * | |
214 | lshift | |
215 | -#ifdef KR_headers | |
216 | - (b, k) Bigint *b; int k; | |
217 | -#else | |
218 | (Bigint *b, int k) | |
219 | -#endif | |
220 | { | |
221 | int i, k1, n, n1; | |
222 | Bigint *b1; | |
223 | @@ -983,11 +909,7 @@ lshift | |
224 | ||
225 | static int | |
226 | cmp | |
227 | -#ifdef KR_headers | |
228 | - (a, b) Bigint *a, *b; | |
229 | -#else | |
230 | (Bigint *a, Bigint *b) | |
231 | -#endif | |
232 | { | |
233 | ULong *xa, *xa0, *xb, *xb0; | |
234 | int i, j; | |
235 | @@ -1017,11 +939,7 @@ cmp | |
236 | ||
237 | static Bigint * | |
238 | diff | |
239 | -#ifdef KR_headers | |
240 | - (a, b) Bigint *a, *b; | |
241 | -#else | |
242 | (Bigint *a, Bigint *b) | |
243 | -#endif | |
244 | { | |
245 | Bigint *c; | |
246 | int i, wa, wb; | |
247 | @@ -1111,15 +1029,12 @@ diff | |
248 | ||
249 | static double | |
250 | ulp | |
251 | -#ifdef KR_headers | |
252 | - (x) double x; | |
253 | -#else | |
254 | - (double x) | |
255 | -#endif | |
256 | + (double dx) | |
257 | { | |
258 | register Long L; | |
259 | - double a; | |
260 | + U x, a; | |
261 | ||
262 | + dval(x) = dx; | |
263 | L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1; | |
264 | #ifndef Avoid_Underflow | |
265 | #ifndef Sudden_Underflow | |
266 | @@ -1153,15 +1068,11 @@ ulp | |
267 | ||
268 | static double | |
269 | b2d | |
270 | -#ifdef KR_headers | |
271 | - (a, e) Bigint *a; int *e; | |
272 | -#else | |
273 | (Bigint *a, int *e) | |
274 | -#endif | |
275 | { | |
276 | ULong *xa, *xa0, w, y, z; | |
277 | int k; | |
278 | - double d; | |
279 | + U d; | |
280 | #ifdef VAX | |
281 | ULong d0, d1; | |
282 | #else | |
283 | @@ -1223,12 +1134,9 @@ b2d | |
284 | ||
285 | static Bigint * | |
286 | d2b | |
287 | -#ifdef KR_headers | |
288 | - (d, e, bits) double d; int *e, *bits; | |
289 | -#else | |
290 | - (double d, int *e, int *bits) | |
291 | -#endif | |
292 | + (double dd, int *e, int *bits) | |
293 | { | |
294 | + U d; | |
295 | Bigint *b; | |
296 | int de, k; | |
297 | ULong *x, y, z; | |
298 | @@ -1237,6 +1145,9 @@ d2b | |
299 | #endif | |
300 | #ifdef VAX | |
301 | ULong d0, d1; | |
302 | +#endif | |
303 | + dval(d) = dd; | |
304 | +#ifdef VAX | |
305 | d0 = word0(d) >> 16 | word0(d) << 16; | |
306 | d1 = word1(d) >> 16 | word1(d) << 16; | |
307 | #else | |
308 | @@ -1361,13 +1272,9 @@ d2b | |
309 | ||
310 | static double | |
311 | ratio | |
312 | -#ifdef KR_headers | |
313 | - (a, b) Bigint *a, *b; | |
314 | -#else | |
315 | (Bigint *a, Bigint *b) | |
316 | -#endif | |
317 | { | |
318 | - double da, db; | |
319 | + U da, db; | |
320 | int k, ka, kb; | |
321 | ||
322 | dval(da) = b2d(a, &ka); | |
323 | @@ -1453,11 +1360,7 @@ static CONST double tinytens[] = { 1e-16 | |
324 | ||
325 | static int | |
326 | match | |
327 | -#ifdef KR_headers | |
328 | - (sp, t) char **sp, *t; | |
329 | -#else | |
330 | (CONST char **sp, CONST char *t) | |
331 | -#endif | |
332 | { | |
333 | int c, d; | |
334 | CONST char *s = *sp; | |
335 | @@ -1475,11 +1378,7 @@ match | |
336 | #ifndef No_Hex_NaN | |
337 | static void | |
338 | hexnan | |
339 | -#ifdef KR_headers | |
340 | - (rvp, sp) double *rvp; CONST char **sp; | |
341 | -#else | |
342 | - (double *rvp, CONST char **sp) | |
343 | -#endif | |
344 | + (U *rvp, CONST char **sp) | |
345 | { | |
346 | ULong c, x[2]; | |
347 | CONST char *s; | |
348 | @@ -1529,11 +1428,7 @@ hexnan | |
349 | ||
350 | double | |
351 | kjs_strtod | |
352 | -#ifdef KR_headers | |
353 | - (s00, se) CONST char *s00; char **se; | |
354 | -#else | |
355 | (CONST char *s00, char **se) | |
356 | -#endif | |
357 | { | |
358 | #ifdef Avoid_Underflow | |
359 | int scale; | |
360 | @@ -1541,7 +1436,8 @@ kjs_strtod | |
361 | int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, | |
362 | e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; | |
363 | CONST char *s, *s0, *s1; | |
364 | - double aadj, aadj1, adj, rv, rv0; | |
365 | + double aadj, aadj1, adj; | |
366 | + U aadj2, rv, rv0; | |
367 | Long L; | |
368 | ULong y, z; | |
369 | Bigint *bb = NULL, *bb1 = NULL, *bd = NULL, *bd0 = NULL, *bs = NULL, *delta = NULL; | |
370 | @@ -2302,7 +2198,9 @@ kjs_strtod | |
371 | aadj = z; | |
372 | aadj1 = dsign ? aadj : -aadj; | |
373 | } | |
374 | - word0(aadj1) += (2*P+1)*Exp_msk1 - y; | |
375 | + dval(aadj2) = aadj1; | |
376 | + word0(aadj2) += (2*P+1)*Exp_msk1 - y; | |
377 | + aadj1 = dval(aadj2); | |
378 | } | |
379 | adj = aadj1 * ulp(dval(rv)); | |
380 | dval(rv) += adj; | |
381 | @@ -2419,11 +2317,7 @@ kjs_strtod | |
382 | ||
383 | static int | |
384 | quorem | |
385 | -#ifdef KR_headers | |
386 | - (b, S) Bigint *b, *S; | |
387 | -#else | |
388 | (Bigint *b, Bigint *S) | |
389 | -#endif | |
390 | { | |
391 | int n; | |
392 | ULong *bx, *bxe, q, *sx, *sxe; | |
393 | @@ -2540,11 +2434,7 @@ quorem | |
394 | #endif | |
395 | ||
396 | static char * | |
397 | -#ifdef KR_headers | |
398 | -rv_alloc(i) int i; | |
399 | -#else | |
400 | rv_alloc(int i) | |
401 | -#endif | |
402 | { | |
403 | int j, k, *r; | |
404 | ||
405 | @@ -2563,11 +2453,7 @@ rv_alloc(int i) | |
406 | } | |
407 | ||
408 | static char * | |
409 | -#ifdef KR_headers | |
410 | -nrv_alloc(s, rve, n) char *s, **rve; int n; | |
411 | -#else | |
412 | nrv_alloc(CONST char *s, char **rve, int n) | |
413 | -#endif | |
414 | { | |
415 | char *rv, *t; | |
416 | ||
417 | @@ -2585,11 +2471,7 @@ nrv_alloc(CONST char *s, char **rve, int | |
418 | */ | |
419 | ||
420 | void | |
421 | -#ifdef KR_headers | |
422 | -kjs_freedtoa(s) char *s; | |
423 | -#else | |
424 | kjs_freedtoa(char *s) | |
425 | -#endif | |
426 | { | |
427 | Bigint *b = (Bigint *)((int *)s - 1); | |
428 | b->maxwds = 1 << (b->k = *(int*)b); | |
429 | @@ -2636,12 +2518,7 @@ kjs_freedtoa(char *s) | |
430 | ||
431 | char * | |
432 | kjs_dtoa | |
433 | -#ifdef KR_headers | |
434 | - (d, mode, ndigits, decpt, sign, rve) | |
435 | - double d; int mode, ndigits, *decpt, *sign; char **rve; | |
436 | -#else | |
437 | - (double d, int mode, int ndigits, int *decpt, int *sign, char **rve) | |
438 | -#endif | |
439 | + (double dd, int mode, int ndigits, int *decpt, int *sign, char **rve) | |
440 | { | |
441 | /* Arguments ndigits, decpt, sign are similar to those | |
442 | of ecvt and fcvt; trailing zeros are suppressed from | |
443 | @@ -2686,7 +2563,8 @@ kjs_dtoa | |
444 | ULong x; | |
445 | #endif | |
446 | Bigint *b, *b1, *delta, *mlo = NULL, *mhi, *S; | |
447 | - double d2, ds, eps; | |
448 | + U d, d2, eps; | |
449 | + double ds; | |
450 | char *s, *s0; | |
451 | #ifdef Honor_FLT_ROUNDS | |
452 | int rounding; | |
453 | @@ -2702,6 +2580,7 @@ kjs_dtoa | |
454 | } | |
455 | #endif | |
456 | ||
457 | + dval(d) = dd; | |
458 | if (word0(d) & Sign_bit) { | |
459 | /* set sign for everything, including 0's and NaNs */ | |
460 | *sign = 1; | |
461 |