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

Unified Diff: base/json/json_writer.cc

Issue 1472083005: Remove kint64min. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kint5
Patch Set: rebase Created 5 years 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
« no previous file with comments | « base/basictypes.h ('k') | base/strings/string_number_conversions_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_writer.cc
diff --git a/base/json/json_writer.cc b/base/json/json_writer.cc
index abfead80070d4354f878c6a8419f6e4a315d2e26..2d3ae0fa855d863d6145947f3a23d911888806ef 100644
--- a/base/json/json_writer.cc
+++ b/base/json/json_writer.cc
@@ -4,7 +4,10 @@
#include "base/json/json_writer.h"
+#include <stdint.h>
+
#include <cmath>
+#include <limits>
#include "base/json/string_escape.h"
#include "base/logging.h"
@@ -79,10 +82,10 @@ bool JSONWriter::BuildJSONString(const Value& node, size_t depth) {
bool result = node.GetAsDouble(&value);
DCHECK(result);
if (omit_double_type_preservation_ &&
- value <= kint64max &&
- value >= kint64min &&
+ value <= std::numeric_limits<int64_t>::max() &&
+ value >= std::numeric_limits<int64_t>::min() &&
std::floor(value) == value) {
- json_string_->append(Int64ToString(static_cast<int64>(value)));
+ json_string_->append(Int64ToString(static_cast<int64_t>(value)));
return result;
}
std::string real = DoubleToString(value);
« no previous file with comments | « base/basictypes.h ('k') | base/strings/string_number_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698