diff options
author | sugoi@google.com <sugoi@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-04 21:03:17 +0000 |
---|---|---|
committer | sugoi@google.com <sugoi@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-04 21:03:17 +0000 |
commit | 8563d3089cd18464db181c16ad90271de16ba524 (patch) | |
tree | c238567e37bc7d6bedde3a681c049058e755ce73 | |
parent | 31ea3394a03f010f31d512e753a9f30ca3313e23 (diff) |
Fixed doParse functions
For some reason, "success" wasn't set in a bunch of template specializations, causing it to be invalid when used later on.
Review URL: https://codereview.appspot.com/7370052
git-svn-id: http://skia.googlecode.com/svn/trunk@7969 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/utils/SkRTConf.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/utils/SkRTConf.cpp b/src/utils/SkRTConf.cpp index c7015527c3..29f0238dd8 100644 --- a/src/utils/SkRTConf.cpp +++ b/src/utils/SkRTConf.cpp @@ -145,7 +145,7 @@ void SkRTConfRegistry::registerConf(SkRTConfBase *conf) { } } -template <typename T> T doParse(const char *s, bool *success ) { +template <typename T> T doParse(const char *, bool *success ) { SkDebugf("WARNING: Invoked non-specialized doParse function...\n"); if (success) { *success = false; @@ -177,18 +177,30 @@ template<> const char * doParse<const char *>(const char * s, bool *success) { } template<> int doParse<int>(const char * s, bool *success) { + if (success) { + *success = true; + } return atoi(s); } template<> unsigned int doParse<unsigned int>(const char * s, bool *success) { + if (success) { + *success = true; + } return (unsigned int) atoi(s); } template<> float doParse<float>(const char * s, bool *success) { + if (success) { + *success = true; + } return (float) atof(s); } template<> double doParse<double>(const char * s, bool *success) { + if (success) { + *success = true; + } return atof(s); } |