aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-14 19:20:28 +0000
committerGravatar humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-14 19:20:28 +0000
commit6d29eda49129893d8f5e385bfbe8473af154b82b (patch)
tree8fbcc0d817223154ac98e95e92a96f413a93a93d
parent61a972f11f60a84ec0faadd6c33f77e690317a98 (diff)
remove dynamic_cast because rtti is disabled on some platforms (but not all??)
BUG= Review URL: https://codereview.appspot.com/7102056 git-svn-id: http://skia.googlecode.com/svn/trunk@7161 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/utils/SkRTConf.h3
-rw-r--r--src/utils/SkRTConf.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/include/utils/SkRTConf.h b/include/utils/SkRTConf.h
index 22d7e606ee..efbd3c5dd3 100644
--- a/include/utils/SkRTConf.h
+++ b/include/utils/SkRTConf.h
@@ -124,7 +124,8 @@ void SkRTConf<T>::doPrint(char *s) const {
template<typename T>
bool SkRTConf<T>::equals(const SkRTConfBase *conf) const {
- const SkRTConf<T> *child_pointer = dynamic_cast<const SkRTConf<T> *>(conf);
+ // static_cast here is okay because there's only one kind of child class.
+ const SkRTConf<T> *child_pointer = static_cast<const SkRTConf<T> *>(conf);
return child_pointer &&
fName == child_pointer->fName &&
fDescription == child_pointer->fDescription &&
diff --git a/src/utils/SkRTConf.cpp b/src/utils/SkRTConf.cpp
index fcc51c33c3..2ccfd061cb 100644
--- a/src/utils/SkRTConf.cpp
+++ b/src/utils/SkRTConf.cpp
@@ -267,8 +267,8 @@ template <typename T> void SkRTConfRegistry::set(const char *name, T value) {
}
for (SkRTConfBase **confBase = confArray->begin(); confBase != confArray->end(); confBase++) {
-
- SkRTConf<bool> *concrete = dynamic_cast<SkRTConf<bool> *>(*confBase);
+ // static_cast here is okay because there's only one kind of child class.
+ SkRTConf<bool> *concrete = static_cast<SkRTConf<bool> *>(*confBase);
if (concrete) {
concrete->set(value);