diff --git a/vm/builtin_class.hpp b/vm/builtin_class.hpp index d4bed95..8590862 100644 --- a/vm/builtin_class.hpp +++ b/vm/builtin_class.hpp @@ -88,7 +88,7 @@ namespace rubinius { /* See t1 */ template <> - static bool kind_of(OBJECT obj) { + bool kind_of(OBJECT obj) { return obj->reference_p() && (obj->obj_type == Module::type || obj->obj_type == Class::type || diff --git a/vm/builtin_compiledmethod.hpp b/vm/builtin_compiledmethod.hpp index 0c0f6f3..d5ecc6e 100644 --- a/vm/builtin_compiledmethod.hpp +++ b/vm/builtin_compiledmethod.hpp @@ -71,7 +71,7 @@ namespace rubinius { }; template <> - static bool kind_of(OBJECT obj) { + bool kind_of(OBJECT obj) { if(obj->obj_type == Executable::type || obj->obj_type == CompiledMethod::type) { return true; diff --git a/vm/builtin_contexts.hpp b/vm/builtin_contexts.hpp index a8101c5..eb2b541 100644 --- a/vm/builtin_contexts.hpp +++ b/vm/builtin_contexts.hpp @@ -61,7 +61,7 @@ namespace rubinius { }; template <> - static bool kind_of(OBJECT obj) { + bool kind_of(OBJECT obj) { return obj->obj_type == MethodContext::type || obj->obj_type == BlockContext::type; } diff --git a/vm/builtin_fixnum.hpp b/vm/builtin_fixnum.hpp index 63a27f4..be02631 100644 --- a/vm/builtin_fixnum.hpp +++ b/vm/builtin_fixnum.hpp @@ -377,20 +377,20 @@ namespace rubinius { /* See t1 */ template <> - static bool kind_of(OBJECT obj) { + bool kind_of(OBJECT obj) { return obj->fixnum_p() || (obj->reference_p() && obj->obj_type == Bignum::type); } /* For some reason, the as<> template doesn't pick up the specialized kind_of<>, until * we figure out why, just special as<> too. */ template <> - static INTEGER as(OBJECT obj) { + INTEGER as(OBJECT obj) { if(kind_of(obj)) return (Integer*)obj; throw TypeError(obj->obj_type, obj, "can't be cast as an Integer"); } template <> - static bool kind_of(OBJECT obj) { + bool kind_of(OBJECT obj) { return obj->fixnum_p(); } diff --git a/vm/builtin_immediates.hpp b/vm/builtin_immediates.hpp index b860c94..42c7c71 100644 --- a/vm/builtin_immediates.hpp +++ b/vm/builtin_immediates.hpp @@ -18,7 +18,7 @@ namespace rubinius { * This makes kind_of smarter, letting us use it everywhere for * type checks. */ template <> - static bool kind_of(OBJECT obj) { + bool kind_of(OBJECT obj) { return obj == Qnil; } @@ -35,7 +35,7 @@ namespace rubinius { /* See t1 */ template <> - static bool kind_of(OBJECT obj) { + bool kind_of(OBJECT obj) { return obj == Qtrue; } @@ -52,7 +52,7 @@ namespace rubinius { /* See t1 */ template <> - static bool kind_of(OBJECT obj) { + bool kind_of(OBJECT obj) { return obj == Qfalse; } } diff --git a/vm/builtin_symbol.hpp b/vm/builtin_symbol.hpp index b753bd6..15f7625 100644 --- a/vm/builtin_symbol.hpp +++ b/vm/builtin_symbol.hpp @@ -31,7 +31,7 @@ namespace rubinius { /* See t1 */ template <> - static bool kind_of(OBJECT obj) { + bool kind_of(OBJECT obj) { return obj->symbol_p(); } diff --git a/vm/object.hpp b/vm/object.hpp index fea9857..11fc0e2 100644 --- a/vm/object.hpp +++ b/vm/object.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -428,12 +429,12 @@ to be a simple test for that bit pattern. } template <> - static inline bool kind_of(OBJECT obj) { + inline bool kind_of(OBJECT obj) { return true; } template <> - static inline bool kind_of(OBJECT obj) { + inline bool kind_of(OBJECT obj) { return obj->obj_type == ClassType || obj->obj_type == MetaclassType || obj->obj_type == IncModType; @@ -454,7 +455,7 @@ to be a simple test for that bit pattern. } template <> - static inline Object* as(OBJECT obj) { return obj; } + inline Object* as(OBJECT obj) { return obj; } /* Similar to as<>, but returns NULL if the type is invalid. ONLY * use this when doing a conditional cast. */ diff --git a/vm/objects.hpp b/vm/objects.hpp index 752a8ef..7e63177 100644 --- a/vm/objects.hpp +++ b/vm/objects.hpp @@ -72,7 +72,7 @@ namespace rubinius { }; template <> - static inline NormalObject* as(OBJECT obj) { return (NormalObject*)obj; } + inline NormalObject* as(OBJECT obj) { return (NormalObject*)obj; } }; #include "builtin_exception.hpp" @@ -96,7 +96,7 @@ namespace rubinius { namespace rubinius { template <> - static bool kind_of(OBJECT obj) { + bool kind_of(OBJECT obj) { return obj->fixnum_p() || (obj->reference_p() && ( obj->obj_type == Bignum::type ||