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; |
} |