3 +++ dtoa.cc (working copy)
4 @@ -548,8 +548,10 @@ Balloc
6 /* The k > Kmax case does not need ACQUIRE_DTOA_LOCK(0), */
7 /* but this case seems very unlikely. */
8 - if (k <= Kmax && (rv = freelist[k]))
9 + if (k <= Kmax && freelist[k]) {
11 freelist[k] = rv->next;
15 #ifdef Omit_Private_Memory
16 @@ -834,7 +836,8 @@ mult
19 for(; xb < xbe; xc0++) {
26 @@ -916,16 +919,19 @@ pow5mult
28 static int p05[3] = { 5, 25, 125 };
33 b = multadd(b, p05[i-1], 0);
41 #ifdef MULTIPLE_THREADS
49 @@ -943,10 +949,12 @@ pow5mult
53 - if (!(p51 = p5->next)) {
56 #ifdef MULTIPLE_THREADS
58 - if (!(p51 = p5->next)) {
61 p51 = p5->next = mult(p5,p5);
64 @@ -997,7 +1005,8 @@ lshift
74 @@ -1299,21 +1308,25 @@ d2b
78 - if ((de = (int)(d0 >> Exp_shift)))
79 + de = (int)(d0 >> Exp_shift);
85 - if ((k = lo0bits(&y))) {
90 x[0] = y | z << (32 - k);
96 + b->wds = x[1] ? 2 : 1;
97 #ifndef Sudden_Underflow
101 - b->wds = (x[1] = z) ? 2 : 1;
105 @@ -1536,7 +1549,7 @@ match
109 - while((d = *t++)) {
110 + for(d = *t++; d; d = *t++) {
111 if ((c = *++s) >= 'A' && c <= 'Z')
114 @@ -1566,12 +1579,13 @@ hexnan
117 /* allow optional initial 0x or 0X */
118 - while((c = *(CONST unsigned char*)(s+1)) && c <= ' ')
119 + for(c = *(CONST unsigned char*)(s+1); c && c <= ' '; c = *(CONST unsigned char*)(s+1))
121 if (s[1] == '0' && (s[2] == 'x' || s[2] == 'X'))
123 - while((c = *(CONST unsigned char*)++s)) {
124 - if ((c1 = hexdig[c]))
125 + for(c = *(CONST unsigned char*)++s; c; c = *(CONST unsigned char*)++s) {
130 if (udx0 && havedig) {
131 @@ -1594,7 +1608,8 @@ hexnan
135 - } while((c = *++s));
141 @@ -2328,7 +2343,8 @@ bigcomp
142 /* Now b/d = exactly half-way between the two floating-point values */
143 /* on either side of the input string. Compute first digit of b/d. */
145 - if (!(dig = quorem(b,d))) {
148 b = multadd(b, 10, 0); /* very unlikely */
151 @@ -2336,7 +2352,8 @@ bigcomp
152 /* Compare b/d with s0 */
154 for(i = 0; i < nd0; ) {
155 - if ((dd = s0[i++] - '0' - dig))
156 + dd = s0[i++] - '0' - dig;
159 if (!b->x[0] && b->wds == 1) {
161 @@ -2347,7 +2364,8 @@ bigcomp
164 for(j = bc->dp1; i++ < nd;) {
165 - if ((dd = s0[j++] - '0' - dig))
166 + dd = s0[j++] - '0' - dig;
169 if (!b->x[0] && b->wds == 1) {
171 @@ -2747,7 +2765,8 @@ strtod
172 /* Get starting approximation = rv * 10**e1 */
178 dval(&rv) *= tens[i];
180 if (e1 > DBL_MAX_10_EXP) {
181 @@ -2805,7 +2824,8 @@ strtod
188 dval(&rv) /= tens[i];
190 if (e1 >= 1 << n_bigtens)
191 @@ -3456,7 +3476,7 @@ nrv_alloc(CONST char *s, char **rve, int
194 t = rv = rv_alloc(n);
195 - while((*t = *s++)) t++;
196 + for(*t = *s++; *t; *t = *s++) t++;
200 @@ -3569,7 +3589,7 @@ dtoa
204 - Bigint *b, *b1, *delta, *mlo, *mhi, *S;
205 + Bigint *b, *b1, *delta, *mlo = NULL, *mhi, *S;
209 @@ -3645,10 +3665,9 @@ dtoa
212 b = d2b(&u, &be, &bbits);
213 -#ifdef Sudden_Underflow
214 i = (int)(word0(&u) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
216 - if ((i = (int)(word0(&u) >> Exp_shift1 & (Exp_mask>>Exp_shift1)))) {
217 +#ifndef Sudden_Underflow
220 dval(&d2) = dval(&u);
221 word0(&d2) &= Frac_mask1;
222 @@ -3803,13 +3822,16 @@ dtoa
226 - else if ((j1 = -k)) {
227 - dval(&u) *= tens[j1 & 0xf];
228 - for(j = j1 >> 4; j; j >>= 1, i++)
231 - dval(&u) *= bigtens[i];
236 + dval(&u) *= tens[j1 & 0xf];
237 + for(j = j1 >> 4; j; j >>= 1, i++)
240 + dval(&u) *= bigtens[i];
244 if (k_check && dval(&u) < 1. && ilim > 0) {
246 @@ -3964,7 +3986,8 @@ dtoa
256 @@ -4002,7 +4025,8 @@ dtoa
257 * can do shifts and ors to compute the numerator for q.
260 - if ((i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f))
261 + i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f;
267 --- g_fmt.cc (old copy)
268 +++ g_fmt.cc (working copy)
269 @@ -46,14 +46,14 @@ g_fmt(register char *b, double x)
272 if (decpt == 9999) /* Infinity or Nan */ {
273 - while((*b++ = *s++)) {}
274 + for(*b = *s++; *b++; *b = *s++) {}
277 if (decpt <= -4 || decpt > se - s + 5) {
282 + for(*b = *s++; *b; *b = *s++)
286 @@ -79,10 +79,10 @@ g_fmt(register char *b, double x)
288 for(; decpt < 0; decpt++)
290 - while((*b++ = *s++)) {}
291 + for(*b = *s++; *b++; *b = *s++) {}
294 - while((*b = *s++)) {
295 + for(*b = *s++; *b; *b = *s++) {
297 if (--decpt == 0 && *s)