gist: 4287 Download_button fork
public
Public Clone URL: git://gist.github.com/4287.git
Diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
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<Module>(OBJECT obj) {
+ bool kind_of<Module>(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<Executable>(OBJECT obj) {
+ bool kind_of<Executable>(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<MethodContext>(OBJECT obj) {
+ bool kind_of<MethodContext>(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<Integer>(OBJECT obj) {
+ bool kind_of<Integer>(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<Integer>(OBJECT obj) {
+ INTEGER as<Integer>(OBJECT obj) {
     if(kind_of<Integer>(obj)) return (Integer*)obj;
     throw TypeError(obj->obj_type, obj, "can't be cast as an Integer");
   }
 
   template <>
- static bool kind_of<Fixnum>(OBJECT obj) {
+ bool kind_of<Fixnum>(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<NilClass>(OBJECT obj) {
+ bool kind_of<NilClass>(OBJECT obj) {
       return obj == Qnil;
     }
 
@@ -38,7 +38,7 @@ namespace rubinius {
 
   /* See t1 */
   template <>
- static bool kind_of<TrueClass>(OBJECT obj) {
+ bool kind_of<TrueClass>(OBJECT obj) {
       return obj == Qtrue;
     }
 
@@ -55,7 +55,7 @@ namespace rubinius {
 
   /* See t1 */
   template <>
- static bool kind_of<FalseClass>(OBJECT obj) {
+ bool kind_of<FalseClass>(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<Symbol>(OBJECT obj) {
+ bool kind_of<Symbol>(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 <stdint.h>
+#include <stdlib.h>
 #include <sys/types.h>
 #include <sstream>
 #include <cstring>
@@ -89,12 +90,12 @@ namespace rubinius {
     }
 
   template <>
- static inline bool kind_of<Object>(OBJECT obj) {
+ inline bool kind_of<Object>(OBJECT obj) {
       return true;
     }
 
   template <>
- static inline bool kind_of<Class>(OBJECT obj) {
+ inline bool kind_of<Class>(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>(OBJECT obj) { return obj; }
+ inline Object* as<Object>(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<Numeric>(OBJECT obj) {
+ bool kind_of<Numeric>(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<NormalObject>(OBJECT obj) {
+ inline NormalObject* as<NormalObject>(OBJECT obj) {
     return (NormalObject*)obj;
   }
 };
 
 

Owner

Anonymous

Revisions

  • 38d504 Wed Aug 06 14:53:06 -0700 2008