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

Unified Diff: runtime/third_party/double-conversion/src/fixed-dtoa.cc

Issue 184153002: - Update runtime/third_party/double-conversion to version 1.1.5. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: runtime/third_party/double-conversion/src/fixed-dtoa.cc
===================================================================
--- runtime/third_party/double-conversion/src/fixed-dtoa.cc (revision 33139)
+++ runtime/third_party/double-conversion/src/fixed-dtoa.cc (working copy)
@@ -28,7 +28,7 @@
#include <math.h>
#include "fixed-dtoa.h"
-#include "double.h"
+#include "ieee.h"
namespace double_conversion {
@@ -133,7 +133,7 @@
while (number != 0) {
int digit = number % 10;
number /= 10;
- buffer[(*length) + number_length] = '0' + digit;
+ buffer[(*length) + number_length] = static_cast<char>('0' + digit);
number_length++;
}
// Exchange the digits.
@@ -150,7 +150,7 @@
}
-static void FillDigits64FixedLength(uint64_t number, int requested_length,
+static void FillDigits64FixedLength(uint64_t number,
Vector<char> buffer, int* length) {
const uint32_t kTen7 = 10000000;
// For efficiency cut the number into 3 uint32_t parts, and print those.
@@ -253,7 +253,8 @@
fractionals *= 5;
point--;
int digit = static_cast<int>(fractionals >> point);
- buffer[*length] = '0' + digit;
+ ASSERT(digit <= 9);
+ buffer[*length] = static_cast<char>('0' + digit);
(*length)++;
fractionals -= static_cast<uint64_t>(digit) << point;
}
@@ -274,7 +275,8 @@
fractionals128.Multiply(5);
point--;
int digit = fractionals128.DivModPowerOf2(point);
- buffer[*length] = '0' + digit;
+ ASSERT(digit <= 9);
+ buffer[*length] = static_cast<char>('0' + digit);
(*length)++;
}
if (fractionals128.BitAt(point - 1) == 1) {
@@ -358,7 +360,7 @@
remainder = (dividend % divisor) << exponent;
}
FillDigits32(quotient, buffer, length);
- FillDigits64FixedLength(remainder, divisor_power, buffer, length);
+ FillDigits64FixedLength(remainder, buffer, length);
*decimal_point = *length;
} else if (exponent >= 0) {
// 0 <= exponent <= 11
« no previous file with comments | « runtime/third_party/double-conversion/src/fast-dtoa.cc ('k') | runtime/third_party/double-conversion/src/ieee.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698