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

Side by Side Diff: tools/flags/SkCommandLineFlags.cpp

Issue 453333002: Fix string assert and dead code which caused it. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Clarify asserts, avoid potential overflow. Created 6 years, 4 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 | « src/core/SkString.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCommandLineFlags.h" 8 #include "SkCommandLineFlags.h"
9 #include "SkTDArray.h" 9 #include "SkTDArray.h"
10 10
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 flag->setDouble(atof(argv[i])); 280 flag->setDouble(atof(argv[i]));
281 break; 281 break;
282 default: 282 default:
283 SkDEBUGFAIL("Invalid flag type"); 283 SkDEBUGFAIL("Invalid flag type");
284 } 284 }
285 break; 285 break;
286 } 286 }
287 flag = flag->next(); 287 flag = flag->next();
288 } 288 }
289 if (!flagMatched) { 289 if (!flagMatched) {
290 SkString stripped(argv[i]);
291 while (stripped.startsWith('-')) {
292 stripped.remove(0, 1);
293 }
294 if (!FLAGS_undefok) { 290 if (!FLAGS_undefok) {
295 SkDebugf("Got unknown flag \"%s\". Exiting.\n", argv[i]); 291 SkDebugf("Got unknown flag \"%s\". Exiting.\n", argv[i]);
296 exit(-1); 292 exit(-1);
297 } 293 }
298 } 294 }
299 } 295 }
300 } 296 }
301 // Since all of the flags have been set, release the memory used by each 297 // Since all of the flags have been set, release the memory used by each
302 // flag. FLAGS_x can still be used after this. 298 // flag. FLAGS_x can still be used after this.
303 SkFlagInfo* flag = gHead; 299 SkFlagInfo* flag = gHead;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 343 }
348 344
349 } // namespace 345 } // namespace
350 346
351 bool SkCommandLineFlags::ShouldSkip(const SkTDArray<const char*>& strings, const char* name) { 347 bool SkCommandLineFlags::ShouldSkip(const SkTDArray<const char*>& strings, const char* name) {
352 return ShouldSkipImpl(strings, name); 348 return ShouldSkipImpl(strings, name);
353 } 349 }
354 bool SkCommandLineFlags::ShouldSkip(const StringArray& strings, const char* name ) { 350 bool SkCommandLineFlags::ShouldSkip(const StringArray& strings, const char* name ) {
355 return ShouldSkipImpl(strings, name); 351 return ShouldSkipImpl(strings, name);
356 } 352 }
OLDNEW
« no previous file with comments | « src/core/SkString.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698