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

Side by Side Diff: tools/gn/err.cc

Issue 25153002: Enable compiling GN by default. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set:  Created 7 years, 2 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
« no previous file with comments | « build/all.gyp ('k') | tools/gn/function_exec_script.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "tools/gn/err.h" 5 #include "tools/gn/err.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "tools/gn/filesystem_utils.h" 9 #include "tools/gn/filesystem_utils.h"
10 #include "tools/gn/input_file.h" 10 #include "tools/gn/input_file.h"
(...skipping 23 matching lines...) Expand all
34 // Watch out, the char offsets in the location are 1-based, so we have to 34 // Watch out, the char offsets in the location are 1-based, so we have to
35 // subtract 1. 35 // subtract 1.
36 int begin_char; 36 int begin_char;
37 if (range.begin().line_number() < line_number) 37 if (range.begin().line_number() < line_number)
38 begin_char = 0; 38 begin_char = 0;
39 else 39 else
40 begin_char = range.begin().char_offset() - 1; 40 begin_char = range.begin().char_offset() - 1;
41 41
42 int end_char; 42 int end_char;
43 if (range.end().line_number() > line_number) 43 if (range.end().line_number() > line_number)
44 end_char = line->size(); // Ending is non-inclusive. 44 end_char = static_cast<int>(line->size()); // Ending is non-inclusive.
45 else 45 else
46 end_char = range.end().char_offset() - 1; 46 end_char = range.end().char_offset() - 1;
47 47
48 CHECK(end_char >= begin_char); 48 CHECK(end_char >= begin_char);
49 CHECK(begin_char >= 0 && begin_char <= static_cast<int>(line->size())); 49 CHECK(begin_char >= 0 && begin_char <= static_cast<int>(line->size()));
50 CHECK(end_char >= 0 && end_char <= static_cast<int>(line->size())); 50 CHECK(end_char >= 0 && end_char <= static_cast<int>(line->size()));
51 for (int i = begin_char; i < end_char; i++) 51 for (int i = begin_char; i < end_char; i++)
52 line->at(i) = '-'; 52 line->at(i) = '-';
53 } 53 }
54 54
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 183
184 // Optional help text. 184 // Optional help text.
185 if (!help_text_.empty()) 185 if (!help_text_.empty())
186 OutputString(help_text_ + "\n"); 186 OutputString(help_text_ + "\n");
187 187
188 // Sub errors. 188 // Sub errors.
189 for (size_t i = 0; i < sub_errs_.size(); i++) 189 for (size_t i = 0; i < sub_errs_.size(); i++)
190 sub_errs_[i].InternalPrintToStdout(true); 190 sub_errs_[i].InternalPrintToStdout(true);
191 } 191 }
OLDNEW
« no previous file with comments | « build/all.gyp ('k') | tools/gn/function_exec_script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698