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
diff --git a/src/utils/SkRTConf.cpp b/src/utils/SkRTConf.cpp
index c701552..29f0238 100644
--- a/src/utils/SkRTConf.cpp
+++ b/src/utils/SkRTConf.cpp
@@ -145,7 +145,7 @@
}
}
-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<> 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);
}