summaryrefslogtreecommitdiff
path: root/include/swobject.h
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-03-29 10:53:49 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-03-29 10:53:49 -0400
commit8c8aa6b07e595cfac56838b5964ab3e96051f1b2 (patch)
treeda38e2c1979148dbd3b0c7b87f930746f5ba7f44 /include/swobject.h
parent8d3fc864d094eeadc721f8e93436b37a5fab173e (diff)
Imported Upstream version 1.5.7
Diffstat (limited to 'include/swobject.h')
-rw-r--r--include/swobject.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/swobject.h b/include/swobject.h
index 974f982..27eafd6 100644
--- a/include/swobject.h
+++ b/include/swobject.h
@@ -8,9 +8,9 @@
#endif
#include <defs.h>
-#include <string.h>
-#define SWDYNAMIC_CAST(className, object) (className *)((object->getClass()->isAssignableFrom(#className))?object:0)
+SWORD_NAMESPACE_START
+#define SWDYNAMIC_CAST(className, object) (className *)((object)?((object->getClass()->isAssignableFrom(#className))?object:0):0)
/**
* Class used for SWDYNAMIC_CAST to save the inheritance order.
@@ -20,13 +20,13 @@ private:
const char **descends;
public:
- SWClass (const char **descends) {
+ SWClass(const char **descends) {
this->descends = descends;
}
- bool isAssignableFrom (const char *className) const {
+ bool isAssignableFrom(const char *className) const {
for (int i = 0; descends[i]; i++) {
- if (!stricmp (descends[i], className))
+ if (!stricmp(descends[i], className))
return true;
}
return false;
@@ -51,4 +51,5 @@ public:
}
};
+SWORD_NAMESPACE_END
#endif