Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: base/third_party/dmg_fp/msvc_warnings.patch

Issue 385503002: Fixes for re-enabling more MSVC level 4 warnings: base/third_party/dmg_fp/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/third_party/dmg_fp/g_fmt.cc ('k') | base/third_party/dmg_fp/vs2013-optimization.patch » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 Index: dtoa.cc
2 --- dtoa.cc (old copy)
3 +++ dtoa.cc (working copy)
4 @@ -548,8 +548,10 @@ Balloc
5 ACQUIRE_DTOA_LOCK(0);
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]) {
10 + rv = freelist[k];
11 freelist[k] = rv->next;
12 + }
13 else {
14 x = 1 << k;
15 #ifdef Omit_Private_Memory
16 @@ -834,7 +836,8 @@ mult
17 xc0 = c->x;
18 #ifdef ULLong
19 for(; xb < xbe; xc0++) {
20 - if ((y = *xb++)) {
21 + y = *xb++;
22 + if (y) {
23 x = xa;
24 xc = xc0;
25 carry = 0;
26 @@ -916,16 +919,19 @@ pow5mult
27 int i;
28 static int p05[3] = { 5, 25, 125 };
29
30 - if ((i = k & 3))
31 + i = k & 3;
32 + if (i)
33 b = multadd(b, p05[i-1], 0);
34
35 if (!(k >>= 2))
36 return b;
37 - if (!(p5 = p5s)) {
38 + p5 = p5s;
39 + if (!p5) {
40 /* first time */
41 #ifdef MULTIPLE_THREADS
42 ACQUIRE_DTOA_LOCK(1);
43 - if (!(p5 = p5s)) {
44 + p5 = p5s;
45 + if (!p5) {
46 p5 = p5s = i2b(625);
47 p5->next = 0;
48 }
49 @@ -943,10 +949,12 @@ pow5mult
50 }
51 if (!(k >>= 1))
52 break;
53 - if (!(p51 = p5->next)) {
54 + p51 = p5->next;
55 + if (!p51) {
56 #ifdef MULTIPLE_THREADS
57 ACQUIRE_DTOA_LOCK(1);
58 - if (!(p51 = p5->next)) {
59 + p51 = p5->next;
60 + if (!p51) {
61 p51 = p5->next = mult(p5,p5);
62 p51->next = 0;
63 }
64 @@ -997,7 +1005,8 @@ lshift
65 z = *x++ >> k1;
66 }
67 while(x < xe);
68 - if ((*x1 = z))
69 + *x1 = z;
70 + if (*x1)
71 ++n1;
72 }
73 #else
74 @@ -1299,21 +1308,25 @@ d2b
75 z |= Exp_msk11;
76 #endif
77 #else
78 - if ((de = (int)(d0 >> Exp_shift)))
79 + de = (int)(d0 >> Exp_shift);
80 + if (de)
81 z |= Exp_msk1;
82 #endif
83 #ifdef Pack_32
84 - if ((y = d1)) {
85 - if ((k = lo0bits(&y))) {
86 + y = d1;
87 + if (y) {
88 + k = lo0bits(&y);
89 + if (k) {
90 x[0] = y | z << (32 - k);
91 z >>= k;
92 }
93 else
94 x[0] = y;
95 + x[1] = z;
96 + b->wds = x[1] ? 2 : 1;
97 #ifndef Sudden_Underflow
98 - i =
99 + i = b->wds;
100 #endif
101 - b->wds = (x[1] = z) ? 2 : 1;
102 }
103 else {
104 k = lo0bits(&z);
105 @@ -1536,7 +1549,7 @@ match
106 int c, d;
107 CONST char *s = *sp;
108
109 - while((d = *t++)) {
110 + for(d = *t++; d; d = *t++) {
111 if ((c = *++s) >= 'A' && c <= 'Z')
112 c += 'a' - 'A';
113 if (c != d)
114 @@ -1566,12 +1579,13 @@ hexnan
115 udx0 = 1;
116 s = *sp;
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 unsigne d char*)(s+1))
120 ++s;
121 if (s[1] == '0' && (s[2] == 'x' || s[2] == 'X'))
122 s += 2;
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) {
126 + c1 = hexdig[c];
127 + if (c1)
128 c = c1 & 0xf;
129 else if (c <= ' ') {
130 if (udx0 && havedig) {
131 @@ -1594,7 +1608,8 @@ hexnan
132 *sp = s + 1;
133 break;
134 }
135 - } while((c = *++s));
136 + c = *++s;
137 + } while(c);
138 break;
139 }
140 #endif
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. */
144
145 - if (!(dig = quorem(b,d))) {
146 + dig = quorem(b,d);
147 + if (!dig) {
148 b = multadd(b, 10, 0); /* very unlikely */
149 dig = quorem(b,d);
150 }
151 @@ -2336,7 +2352,8 @@ bigcomp
152 /* Compare b/d with s0 */
153
154 for(i = 0; i < nd0; ) {
155 - if ((dd = s0[i++] - '0' - dig))
156 + dd = s0[i++] - '0' - dig;
157 + if (dd)
158 goto ret;
159 if (!b->x[0] && b->wds == 1) {
160 if (i < nd)
161 @@ -2347,7 +2364,8 @@ bigcomp
162 dig = quorem(b,d);
163 }
164 for(j = bc->dp1; i++ < nd;) {
165 - if ((dd = s0[j++] - '0' - dig))
166 + dd = s0[j++] - '0' - dig;
167 + if (dd)
168 goto ret;
169 if (!b->x[0] && b->wds == 1) {
170 if (i < nd)
171 @@ -2747,7 +2765,8 @@ strtod
172 /* Get starting approximation = rv * 10**e1 */
173
174 if (e1 > 0) {
175 - if ((i = e1 & 15))
176 + i = e1 & 15;
177 + if (i)
178 dval(&rv) *= tens[i];
179 if (e1 &= ~15) {
180 if (e1 > DBL_MAX_10_EXP) {
181 @@ -2805,7 +2824,8 @@ strtod
182 }
183 else if (e1 < 0) {
184 e1 = -e1;
185 - if ((i = e1 & 15))
186 + i = e1 & 15;
187 + if (i)
188 dval(&rv) /= tens[i];
189 if (e1 >>= 4) {
190 if (e1 >= 1 << n_bigtens)
191 @@ -3456,7 +3476,7 @@ nrv_alloc(CONST char *s, char **rve, int
192 char *rv, *t;
193
194 t = rv = rv_alloc(n);
195 - while((*t = *s++)) t++;
196 + for(*t = *s++; *t; *t = *s++) t++;
197 if (rve)
198 *rve = t;
199 return rv;
200 @@ -3569,7 +3589,7 @@ dtoa
201 int denorm;
202 ULong x;
203 #endif
204 - Bigint *b, *b1, *delta, *mlo, *mhi, *S;
205 + Bigint *b, *b1, *delta, *mlo = NULL, *mhi, *S;
206 U d2, eps, u;
207 double ds;
208 char *s, *s0;
209 @@ -3645,10 +3665,9 @@ dtoa
210 #endif
211
212 b = d2b(&u, &be, &bbits);
213 -#ifdef Sudden_Underflow
214 i = (int)(word0(&u) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
215 -#else
216 - if ((i = (int)(word0(&u) >> Exp_shift1 & (Exp_mask>>Exp_shift1)))) {
217 +#ifndef Sudden_Underflow
218 + if (i) {
219 #endif
220 dval(&d2) = dval(&u);
221 word0(&d2) &= Frac_mask1;
222 @@ -3803,13 +3822,16 @@ dtoa
223 }
224 dval(&u) /= ds;
225 }
226 - else if ((j1 = -k)) {
227 - dval(&u) *= tens[j1 & 0xf];
228 - for(j = j1 >> 4; j; j >>= 1, i++)
229 - if (j & 1) {
230 - ieps++;
231 - dval(&u) *= bigtens[i];
232 - }
233 + else {
234 + j1 = -k;
235 + if (j1) {
236 + dval(&u) *= tens[j1 & 0xf];
237 + for(j = j1 >> 4; j; j >>= 1, i++)
238 + if (j & 1) {
239 + ieps++;
240 + dval(&u) *= bigtens[i];
241 + }
242 + }
243 }
244 if (k_check && dval(&u) < 1. && ilim > 0) {
245 if (ilim1 <= 0)
246 @@ -3964,7 +3986,8 @@ dtoa
247 Bfree(b);
248 b = b1;
249 }
250 - if ((j = b5 - m5))
251 + j = b5 - m5;
252 + if (j)
253 b = pow5mult(b, j);
254 }
255 else
256 @@ -4002,7 +4025,8 @@ dtoa
257 * can do shifts and ors to compute the numerator for q.
258 */
259 #ifdef Pack_32
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;
262 + if (i)
263 i = 32 - i;
264 #define iInc 28
265 #else
266 Index: g_fmt.cc
267 --- g_fmt.cc (old copy)
268 +++ g_fmt.cc (working copy)
269 @@ -46,14 +46,14 @@ g_fmt(register char *b, double x)
270 if (sign)
271 *b++ = '-';
272 if (decpt == 9999) /* Infinity or Nan */ {
273 - while((*b++ = *s++)) {}
274 + for(*b = *s++; *b++; *b = *s++) {}
275 goto done0;
276 }
277 if (decpt <= -4 || decpt > se - s + 5) {
278 *b++ = *s++;
279 if (*s) {
280 *b++ = '.';
281 - while((*b = *s++))
282 + for(*b = *s++; *b; *b = *s++)
283 b++;
284 }
285 *b++ = 'e';
286 @@ -79,10 +79,10 @@ g_fmt(register char *b, double x)
287 *b++ = '.';
288 for(; decpt < 0; decpt++)
289 *b++ = '0';
290 - while((*b++ = *s++)) {}
291 + for(*b = *s++; *b++; *b = *s++) {}
292 }
293 else {
294 - while((*b = *s++)) {
295 + for(*b = *s++; *b; *b = *s++) {
296 b++;
297 if (--decpt == 0 && *s)
298 *b++ = '.';
OLDNEW
« no previous file with comments | « base/third_party/dmg_fp/g_fmt.cc ('k') | base/third_party/dmg_fp/vs2013-optimization.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698