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