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

Side by Side Diff: base/json/json_parser.cc

Issue 12310041: experiment with -Wimplicit-fallthrough Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rebase 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/compiler_specific.h ('k') | base/process/process_metrics_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/json/json_parser.h" 5 #include "base/json/json_parser.h"
6 6
7 #include "base/float_util.h" 7 #include "base/float_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 398
399 void JSONParser::EatWhitespaceAndComments() { 399 void JSONParser::EatWhitespaceAndComments() {
400 while (pos_ < end_pos_) { 400 while (pos_ < end_pos_) {
401 switch (*pos_) { 401 switch (*pos_) {
402 case '\r': 402 case '\r':
403 case '\n': 403 case '\n':
404 index_last_line_ = index_; 404 index_last_line_ = index_;
405 // Don't increment line_number_ twice for "\r\n". 405 // Don't increment line_number_ twice for "\r\n".
406 if (!(*pos_ == '\n' && pos_ > start_pos_ && *(pos_ - 1) == '\r')) 406 if (!(*pos_ == '\n' && pos_ > start_pos_ && *(pos_ - 1) == '\r'))
407 ++line_number_; 407 ++line_number_;
408 // Fall through. 408 FALLTHROUGH_INTENDED;
409 case ' ': 409 case ' ':
410 case '\t': 410 case '\t':
411 NextChar(); 411 NextChar();
412 break; 412 break;
413 case '/': 413 case '/':
414 if (!EatComment()) 414 if (!EatComment())
415 return; 415 return;
416 break; 416 break;
417 default: 417 default:
418 return; 418 return;
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 const std::string& description) { 956 const std::string& description) {
957 if (line || column) { 957 if (line || column) {
958 return StringPrintf("Line: %i, column: %i, %s", 958 return StringPrintf("Line: %i, column: %i, %s",
959 line, column, description.c_str()); 959 line, column, description.c_str());
960 } 960 }
961 return description; 961 return description;
962 } 962 }
963 963
964 } // namespace internal 964 } // namespace internal
965 } // namespace base 965 } // namespace base
OLDNEW
« no previous file with comments | « base/compiler_specific.h ('k') | base/process/process_metrics_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698