| OLD | NEW |
| 1 /**************************************************************** | 1 /**************************************************************** |
| 2 * | 2 * |
| 3 * The author of this software is David M. Gay. | 3 * The author of this software is David M. Gay. |
| 4 * | 4 * |
| 5 * Copyright (c) 1991, 2000, 2001 by Lucent Technologies. | 5 * Copyright (c) 1991, 2000, 2001 by Lucent Technologies. |
| 6 * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. All rights
reserved. |
| 7 * | 7 * |
| 8 * Permission to use, copy, modify, and distribute this software for any | 8 * Permission to use, copy, modify, and distribute this software for any |
| 9 * purpose without fee is hereby granted, provided that this entire notice | 9 * purpose without fee is hereby granted, provided that this entire notice |
| 10 * is included in all copies of any software which is or includes a copy | 10 * is included in all copies of any software which is or includes a copy |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 #ifdef USE_LONG_LONG | 613 #ifdef USE_LONG_LONG |
| 614 unsigned long long borrow, carry, y, ys; | 614 unsigned long long borrow, carry, y, ys; |
| 615 #else | 615 #else |
| 616 uint32_t borrow, carry, y, ys; | 616 uint32_t borrow, carry, y, ys; |
| 617 uint32_t si, z, zs; | 617 uint32_t si, z, zs; |
| 618 #endif | 618 #endif |
| 619 ASSERT(b.size() <= 1 || b.words()[b.size() - 1]); | 619 ASSERT(b.size() <= 1 || b.words()[b.size() - 1]); |
| 620 ASSERT(s.size() <= 1 || s.words()[s.size() - 1]); | 620 ASSERT(s.size() <= 1 || s.words()[s.size() - 1]); |
| 621 | 621 |
| 622 n = s.size(); | 622 n = s.size(); |
| 623 ASSERT_WITH_MESSAGE(b.size() <= n, "oversize b in quorem"); | 623 DCHECK_LE(b.size(), n) << "oversize b in quorem"; |
| 624 if (b.size() < n) | 624 if (b.size() < n) |
| 625 return 0; | 625 return 0; |
| 626 sx = s.words(); | 626 sx = s.words(); |
| 627 sxe = sx + --n; | 627 sxe = sx + --n; |
| 628 bx = b.words(); | 628 bx = b.words(); |
| 629 bxe = bx + n; | 629 bxe = bx + n; |
| 630 q = *bxe / (*sxe + 1); /* ensure q <= true quotient */ | 630 q = *bxe / (*sxe + 1); /* ensure q <= true quotient */ |
| 631 ASSERT_WITH_MESSAGE(q <= 9, "oversized quotient in quorem"); | 631 DCHECK_LE(q, 9u) << "oversized quotient in quorem"; |
| 632 if (q) { | 632 if (q) { |
| 633 borrow = 0; | 633 borrow = 0; |
| 634 carry = 0; | 634 carry = 0; |
| 635 do { | 635 do { |
| 636 #ifdef USE_LONG_LONG | 636 #ifdef USE_LONG_LONG |
| 637 ys = *sx++ * (unsigned long long)q + carry; | 637 ys = *sx++ * (unsigned long long)q + carry; |
| 638 carry = ys >> 32; | 638 carry = ys >> 32; |
| 639 y = *bx - (ys & 0xffffffffUL) - borrow; | 639 y = *bx - (ys & 0xffffffffUL) - borrow; |
| 640 borrow = y >> 32 & (uint32_t)1; | 640 borrow = y >> 32 & (uint32_t)1; |
| 641 *bx++ = (uint32_t)y & 0xffffffffUL; | 641 *bx++ = (uint32_t)y & 0xffffffffUL; |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 { | 1309 { |
| 1310 Vector<LChar> conversionBuffer(length); | 1310 Vector<LChar> conversionBuffer(length); |
| 1311 for (size_t i = 0; i < length; ++i) | 1311 for (size_t i = 0; i < length; ++i) |
| 1312 conversionBuffer[i] = isASCII(string[i]) ? string[i] : 0; | 1312 conversionBuffer[i] = isASCII(string[i]) ? string[i] : 0; |
| 1313 return parseDouble(conversionBuffer.data(), length, parsedLength); | 1313 return parseDouble(conversionBuffer.data(), length, parsedLength); |
| 1314 } | 1314 } |
| 1315 | 1315 |
| 1316 } // namespace Internal | 1316 } // namespace Internal |
| 1317 | 1317 |
| 1318 } // namespace WTF | 1318 } // namespace WTF |
| OLD | NEW |