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

Unified Diff: tools/gn/tokenizer.cc

Issue 382673002: Fixes for re-enabling more MSVC level 4 warnings: misc edition #2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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 | « sync/internal_api/sync_manager_impl_unittest.cc ('k') | tools/json_to_struct/json_to_struct.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/tokenizer.cc
diff --git a/tools/gn/tokenizer.cc b/tools/gn/tokenizer.cc
index c0890060b37e80cf931901abf0b2b3bb68aec344..87a4d909f35343c4b3f79fa0cc3cd42b636554eb 100644
--- a/tools/gn/tokenizer.cc
+++ b/tools/gn/tokenizer.cc
@@ -134,14 +134,13 @@ std::vector<Token> Tokenizer::Run() {
// static
size_t Tokenizer::ByteOffsetOfNthLine(const base::StringPiece& buf, int n) {
- int cur_line = 1;
- size_t cur_byte = 0;
-
- DCHECK(n > 0);
+ DCHECK_GT(n, 0);
if (n == 1)
return 0;
+ int cur_line = 1;
+ size_t cur_byte = 0;
while (cur_byte < buf.size()) {
if (IsNewline(buf, cur_byte)) {
cur_line++;
@@ -150,7 +149,7 @@ size_t Tokenizer::ByteOffsetOfNthLine(const base::StringPiece& buf, int n) {
}
cur_byte++;
}
- return -1;
+ return static_cast<size_t>(-1);
}
// static
« no previous file with comments | « sync/internal_api/sync_manager_impl_unittest.cc ('k') | tools/json_to_struct/json_to_struct.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698