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

Unified Diff: base/i18n/build_utf8_validator_tables.cc

Issue 138143013: Fix compilation of build_utf8_validator_tables on Win64. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/build_utf8_validator_tables.cc
diff --git a/base/i18n/build_utf8_validator_tables.cc b/base/i18n/build_utf8_validator_tables.cc
index 756e215bf10200cdd4544626bcbbccd8f5baf3bf..de3aae6e5559f64d11725a61a22f60dc7228e699 100644
--- a/base/i18n/build_utf8_validator_tables.cc
+++ b/base/i18n/build_utf8_validator_tables.cc
@@ -40,6 +40,7 @@
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/logging.h"
+#include "base/safe_numerics.h"
#include "base/strings/stringprintf.h"
#include "third_party/icu/source/common/unicode/utf8.h"
@@ -317,7 +318,8 @@ uint8 MakeState(const StringSet& set,
states->push_back(
State(new_state_initializer,
new_state_initializer + arraysize(new_state_initializer)));
- const uint8 new_state_number = states->size() - 1;
+ const uint8 new_state_number =
+ base::checked_numeric_cast<uint8>(states->size() - 1);
CHECK(state_map->insert(std::make_pair(set, new_state_number)).second);
return new_state_number;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698