| Index: base/third_party/dmg_fp/msvc_warnings.patch
|
| diff --git a/base/third_party/dmg_fp/msvc_warnings.patch b/base/third_party/dmg_fp/msvc_warnings.patch
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9ad4761339da27a58c8b98037b3dc71b026ed4f5
|
| --- /dev/null
|
| +++ b/base/third_party/dmg_fp/msvc_warnings.patch
|
| @@ -0,0 +1,298 @@
|
| +Index: dtoa.cc
|
| +--- dtoa.cc (old copy)
|
| ++++ dtoa.cc (working copy)
|
| +@@ -548,8 +548,10 @@ Balloc
|
| + ACQUIRE_DTOA_LOCK(0);
|
| + /* The k > Kmax case does not need ACQUIRE_DTOA_LOCK(0), */
|
| + /* but this case seems very unlikely. */
|
| +- if (k <= Kmax && (rv = freelist[k]))
|
| ++ if (k <= Kmax && freelist[k]) {
|
| ++ rv = freelist[k];
|
| + freelist[k] = rv->next;
|
| ++ }
|
| + else {
|
| + x = 1 << k;
|
| + #ifdef Omit_Private_Memory
|
| +@@ -834,7 +836,8 @@ mult
|
| + xc0 = c->x;
|
| + #ifdef ULLong
|
| + for(; xb < xbe; xc0++) {
|
| +- if ((y = *xb++)) {
|
| ++ y = *xb++;
|
| ++ if (y) {
|
| + x = xa;
|
| + xc = xc0;
|
| + carry = 0;
|
| +@@ -916,16 +919,19 @@ pow5mult
|
| + int i;
|
| + static int p05[3] = { 5, 25, 125 };
|
| +
|
| +- if ((i = k & 3))
|
| ++ i = k & 3;
|
| ++ if (i)
|
| + b = multadd(b, p05[i-1], 0);
|
| +
|
| + if (!(k >>= 2))
|
| + return b;
|
| +- if (!(p5 = p5s)) {
|
| ++ p5 = p5s;
|
| ++ if (!p5) {
|
| + /* first time */
|
| + #ifdef MULTIPLE_THREADS
|
| + ACQUIRE_DTOA_LOCK(1);
|
| +- if (!(p5 = p5s)) {
|
| ++ p5 = p5s;
|
| ++ if (!p5) {
|
| + p5 = p5s = i2b(625);
|
| + p5->next = 0;
|
| + }
|
| +@@ -943,10 +949,12 @@ pow5mult
|
| + }
|
| + if (!(k >>= 1))
|
| + break;
|
| +- if (!(p51 = p5->next)) {
|
| ++ p51 = p5->next;
|
| ++ if (!p51) {
|
| + #ifdef MULTIPLE_THREADS
|
| + ACQUIRE_DTOA_LOCK(1);
|
| +- if (!(p51 = p5->next)) {
|
| ++ p51 = p5->next;
|
| ++ if (!p51) {
|
| + p51 = p5->next = mult(p5,p5);
|
| + p51->next = 0;
|
| + }
|
| +@@ -997,7 +1005,8 @@ lshift
|
| + z = *x++ >> k1;
|
| + }
|
| + while(x < xe);
|
| +- if ((*x1 = z))
|
| ++ *x1 = z;
|
| ++ if (*x1)
|
| + ++n1;
|
| + }
|
| + #else
|
| +@@ -1299,21 +1308,25 @@ d2b
|
| + z |= Exp_msk11;
|
| + #endif
|
| + #else
|
| +- if ((de = (int)(d0 >> Exp_shift)))
|
| ++ de = (int)(d0 >> Exp_shift);
|
| ++ if (de)
|
| + z |= Exp_msk1;
|
| + #endif
|
| + #ifdef Pack_32
|
| +- if ((y = d1)) {
|
| +- if ((k = lo0bits(&y))) {
|
| ++ y = d1;
|
| ++ if (y) {
|
| ++ k = lo0bits(&y);
|
| ++ if (k) {
|
| + x[0] = y | z << (32 - k);
|
| + z >>= k;
|
| + }
|
| + else
|
| + x[0] = y;
|
| ++ x[1] = z;
|
| ++ b->wds = x[1] ? 2 : 1;
|
| + #ifndef Sudden_Underflow
|
| +- i =
|
| ++ i = b->wds;
|
| + #endif
|
| +- b->wds = (x[1] = z) ? 2 : 1;
|
| + }
|
| + else {
|
| + k = lo0bits(&z);
|
| +@@ -1536,7 +1549,7 @@ match
|
| + int c, d;
|
| + CONST char *s = *sp;
|
| +
|
| +- while((d = *t++)) {
|
| ++ for(d = *t++; d; d = *t++) {
|
| + if ((c = *++s) >= 'A' && c <= 'Z')
|
| + c += 'a' - 'A';
|
| + if (c != d)
|
| +@@ -1566,12 +1579,13 @@ hexnan
|
| + udx0 = 1;
|
| + s = *sp;
|
| + /* allow optional initial 0x or 0X */
|
| +- while((c = *(CONST unsigned char*)(s+1)) && c <= ' ')
|
| ++ for(c = *(CONST unsigned char*)(s+1); c && c <= ' '; c = *(CONST unsigned char*)(s+1))
|
| + ++s;
|
| + if (s[1] == '0' && (s[2] == 'x' || s[2] == 'X'))
|
| + s += 2;
|
| +- while((c = *(CONST unsigned char*)++s)) {
|
| +- if ((c1 = hexdig[c]))
|
| ++ for(c = *(CONST unsigned char*)++s; c; c = *(CONST unsigned char*)++s) {
|
| ++ c1 = hexdig[c];
|
| ++ if (c1)
|
| + c = c1 & 0xf;
|
| + else if (c <= ' ') {
|
| + if (udx0 && havedig) {
|
| +@@ -1594,7 +1608,8 @@ hexnan
|
| + *sp = s + 1;
|
| + break;
|
| + }
|
| +- } while((c = *++s));
|
| ++ c = *++s;
|
| ++ } while(c);
|
| + break;
|
| + }
|
| + #endif
|
| +@@ -2328,7 +2343,8 @@ bigcomp
|
| + /* Now b/d = exactly half-way between the two floating-point values */
|
| + /* on either side of the input string. Compute first digit of b/d. */
|
| +
|
| +- if (!(dig = quorem(b,d))) {
|
| ++ dig = quorem(b,d);
|
| ++ if (!dig) {
|
| + b = multadd(b, 10, 0); /* very unlikely */
|
| + dig = quorem(b,d);
|
| + }
|
| +@@ -2336,7 +2352,8 @@ bigcomp
|
| + /* Compare b/d with s0 */
|
| +
|
| + for(i = 0; i < nd0; ) {
|
| +- if ((dd = s0[i++] - '0' - dig))
|
| ++ dd = s0[i++] - '0' - dig;
|
| ++ if (dd)
|
| + goto ret;
|
| + if (!b->x[0] && b->wds == 1) {
|
| + if (i < nd)
|
| +@@ -2347,7 +2364,8 @@ bigcomp
|
| + dig = quorem(b,d);
|
| + }
|
| + for(j = bc->dp1; i++ < nd;) {
|
| +- if ((dd = s0[j++] - '0' - dig))
|
| ++ dd = s0[j++] - '0' - dig;
|
| ++ if (dd)
|
| + goto ret;
|
| + if (!b->x[0] && b->wds == 1) {
|
| + if (i < nd)
|
| +@@ -2747,7 +2765,8 @@ strtod
|
| + /* Get starting approximation = rv * 10**e1 */
|
| +
|
| + if (e1 > 0) {
|
| +- if ((i = e1 & 15))
|
| ++ i = e1 & 15;
|
| ++ if (i)
|
| + dval(&rv) *= tens[i];
|
| + if (e1 &= ~15) {
|
| + if (e1 > DBL_MAX_10_EXP) {
|
| +@@ -2805,7 +2824,8 @@ strtod
|
| + }
|
| + else if (e1 < 0) {
|
| + e1 = -e1;
|
| +- if ((i = e1 & 15))
|
| ++ i = e1 & 15;
|
| ++ if (i)
|
| + dval(&rv) /= tens[i];
|
| + if (e1 >>= 4) {
|
| + if (e1 >= 1 << n_bigtens)
|
| +@@ -3456,7 +3476,7 @@ nrv_alloc(CONST char *s, char **rve, int
|
| + char *rv, *t;
|
| +
|
| + t = rv = rv_alloc(n);
|
| +- while((*t = *s++)) t++;
|
| ++ for(*t = *s++; *t; *t = *s++) t++;
|
| + if (rve)
|
| + *rve = t;
|
| + return rv;
|
| +@@ -3569,7 +3589,7 @@ dtoa
|
| + int denorm;
|
| + ULong x;
|
| + #endif
|
| +- Bigint *b, *b1, *delta, *mlo, *mhi, *S;
|
| ++ Bigint *b, *b1, *delta, *mlo = NULL, *mhi, *S;
|
| + U d2, eps, u;
|
| + double ds;
|
| + char *s, *s0;
|
| +@@ -3645,10 +3665,9 @@ dtoa
|
| + #endif
|
| +
|
| + b = d2b(&u, &be, &bbits);
|
| +-#ifdef Sudden_Underflow
|
| + i = (int)(word0(&u) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
|
| +-#else
|
| +- if ((i = (int)(word0(&u) >> Exp_shift1 & (Exp_mask>>Exp_shift1)))) {
|
| ++#ifndef Sudden_Underflow
|
| ++ if (i) {
|
| + #endif
|
| + dval(&d2) = dval(&u);
|
| + word0(&d2) &= Frac_mask1;
|
| +@@ -3803,13 +3822,16 @@ dtoa
|
| + }
|
| + dval(&u) /= ds;
|
| + }
|
| +- else if ((j1 = -k)) {
|
| +- dval(&u) *= tens[j1 & 0xf];
|
| +- for(j = j1 >> 4; j; j >>= 1, i++)
|
| +- if (j & 1) {
|
| +- ieps++;
|
| +- dval(&u) *= bigtens[i];
|
| +- }
|
| ++ else {
|
| ++ j1 = -k;
|
| ++ if (j1) {
|
| ++ dval(&u) *= tens[j1 & 0xf];
|
| ++ for(j = j1 >> 4; j; j >>= 1, i++)
|
| ++ if (j & 1) {
|
| ++ ieps++;
|
| ++ dval(&u) *= bigtens[i];
|
| ++ }
|
| ++ }
|
| + }
|
| + if (k_check && dval(&u) < 1. && ilim > 0) {
|
| + if (ilim1 <= 0)
|
| +@@ -3964,7 +3986,8 @@ dtoa
|
| + Bfree(b);
|
| + b = b1;
|
| + }
|
| +- if ((j = b5 - m5))
|
| ++ j = b5 - m5;
|
| ++ if (j)
|
| + b = pow5mult(b, j);
|
| + }
|
| + else
|
| +@@ -4002,7 +4025,8 @@ dtoa
|
| + * can do shifts and ors to compute the numerator for q.
|
| + */
|
| + #ifdef Pack_32
|
| +- if ((i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f))
|
| ++ i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f;
|
| ++ if (i)
|
| + i = 32 - i;
|
| + #define iInc 28
|
| + #else
|
| +Index: g_fmt.cc
|
| +--- g_fmt.cc (old copy)
|
| ++++ g_fmt.cc (working copy)
|
| +@@ -46,14 +46,14 @@ g_fmt(register char *b, double x)
|
| + if (sign)
|
| + *b++ = '-';
|
| + if (decpt == 9999) /* Infinity or Nan */ {
|
| +- while((*b++ = *s++)) {}
|
| ++ for(*b = *s++; *b++; *b = *s++) {}
|
| + goto done0;
|
| + }
|
| + if (decpt <= -4 || decpt > se - s + 5) {
|
| + *b++ = *s++;
|
| + if (*s) {
|
| + *b++ = '.';
|
| +- while((*b = *s++))
|
| ++ for(*b = *s++; *b; *b = *s++)
|
| + b++;
|
| + }
|
| + *b++ = 'e';
|
| +@@ -79,10 +79,10 @@ g_fmt(register char *b, double x)
|
| + *b++ = '.';
|
| + for(; decpt < 0; decpt++)
|
| + *b++ = '0';
|
| +- while((*b++ = *s++)) {}
|
| ++ for(*b = *s++; *b++; *b = *s++) {}
|
| + }
|
| + else {
|
| +- while((*b = *s++)) {
|
| ++ for(*b = *s++; *b; *b = *s++) {
|
| + b++;
|
| + if (--decpt == 0 && *s)
|
| + *b++ = '.';
|
|
|