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

Side by Side Diff: third_party/WebKit/Source/wtf/dtoa.cpp

Issue 1826733002: Remove ASSERT_WITH_MESSAGE family. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698