diff --git a/rakelib/vm.rake b/rakelib/vm.rake index d7b0e43..73a652b 100644 --- a/rakelib/vm.rake +++ b/rakelib/vm.rake @@ -40,7 +40,7 @@ OPTIONS = { } INCLUDES = (EX_INC + %w[vm/test/cxxtest vm .]).map { |f| "-I#{f}" } -FLAGS = %w(-Wall -ggdb -gdwarf-2) +FLAGS = %w(-Wall -Wmissing-declarations -ggdb -gdwarf-2) CC = ENV['CC'] || "gcc" diff --git a/vm/builtin/class.hpp b/vm/builtin/class.hpp index 8701436..a7f2814 100644 --- a/vm/builtin/class.hpp +++ b/vm/builtin/class.hpp @@ -91,7 +91,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 66b005c..b20d915 100644 --- a/vm/builtin/compiledmethod.hpp +++ b/vm/builtin/compiledmethod.hpp @@ -76,7 +76,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 e967d91..6f1be3e 100644 --- a/vm/builtin/contexts.hpp +++ b/vm/builtin/contexts.hpp @@ -63,7 +63,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 83552d6..a6de5d8 100644 --- a/vm/builtin/fixnum.hpp +++ b/vm/builtin/fixnum.hpp @@ -177,7 +177,7 @@ 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); } @@ -185,13 +185,13 @@ namespace rubinius { * 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/float.cpp b/vm/builtin/float.cpp index af2a09c..e139502 100644 --- a/vm/builtin/float.cpp +++ b/vm/builtin/float.cpp @@ -67,8 +67,8 @@ namespace rubinius { Float* Float::mod(STATE, Float* other) { double res = fmod(this->val, other->val); - if(other->val < 0.0 && this->val > 0.0 || - other->val > 0.0 && this->val < 0.0 ) { + if((other->val < 0.0 && this->val > 0.0) || + (other->val > 0.0 && this->val < 0.0) ) { res += other->val; } return Float::create(state, res); diff --git a/vm/builtin/immediates.hpp b/vm/builtin/immediates.hpp index 2e86ef5..0bdfa51 100644 --- a/vm/builtin/immediates.hpp +++ b/vm/builtin/immediates.hpp @@ -21,7 +21,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; } @@ -38,7 +38,7 @@ namespace rubinius { /* See t1 */ template <> - static bool kind_of(OBJECT obj) { + bool kind_of(OBJECT obj) { return obj == Qtrue; } @@ -55,7 +55,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 d53885b..fb5a339 100644 --- a/vm/builtin/symbol.hpp +++ b/vm/builtin/symbol.hpp @@ -32,7 +32,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 f951ddd..b867cbb 100644 --- a/vm/object.hpp +++ b/vm/object.hpp @@ -2,6 +2,7 @@ #define RBX_OOP_HPP #include +#include #include #include #include @@ -89,12 +90,12 @@ namespace rubinius { } 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; @@ -115,7 +116,7 @@ namespace rubinius { } 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.cpp b/vm/objects.cpp index 6993229..d7c5fbc 100644 --- a/vm/objects.cpp +++ b/vm/objects.cpp @@ -45,7 +45,7 @@ namespace rubinius { // TODO: double check that this links. Evan says it doesn't. I'll // check my Meiers books when I get home template <> - static bool kind_of(OBJECT obj) { + bool kind_of(OBJECT obj) { return obj->fixnum_p() || (obj->reference_p() && (obj->obj_type == Bignum::type || obj->obj_type == Float::type)); diff --git a/vm/objects.hpp b/vm/objects.hpp index e1e61a2..aaeab86 100644 --- a/vm/objects.hpp +++ b/vm/objects.hpp @@ -47,7 +47,7 @@ namespace rubinius { }; template <> - static inline NormalObject* as(OBJECT obj) { + inline NormalObject* as(OBJECT obj) { return (NormalObject*)obj; } };