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

Unified Diff: tools/flags/SkCommandLineFlags.cpp

Issue 1127603003: ignore_result() (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 8 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: tools/flags/SkCommandLineFlags.cpp
diff --git a/tools/flags/SkCommandLineFlags.cpp b/tools/flags/SkCommandLineFlags.cpp
index 719e1634e4867284b8e72f65ce37bf6536ba7aa7..a7fe6bdc79c124d70e55b172bd0a9a717856d745 100644
--- a/tools/flags/SkCommandLineFlags.cpp
+++ b/tools/flags/SkCommandLineFlags.cpp
@@ -11,6 +11,8 @@
DEFINE_bool(undefok, false, "Silently ignore unknown flags instead of crashing.");
+template <typename T> static void ignore_result(const T&) {}
tfarina 2015/05/04 17:39:31 I checked in chromium, and this is equal how they
+
bool SkFlagInfo::CreateStringFlag(const char* name, const char* shortName,
SkCommandLineFlags::StringArray* pStrings,
const char* defaultValue, const char* helpString) {
@@ -284,7 +286,8 @@ void SkCommandLineFlags::Parse(int argc, char** argv) {
// Add all arguments until another flag is reached.
while (i+1 < argc) {
char* end = NULL;
- (void)strtod(argv[i+1], &end); // Negative numbers aren't flags.
+ // Negative numbers aren't flags.
+ ignore_result(strtod(argv[i+1], &end));
if (end == argv[i+1] && SkStrStartsWith(argv[i+1], '-')) {
break;
}
« 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