Skip to content
Browse files

CallFrame#previous is already a CallFrame, no need to cast

  • Loading branch information...
1 parent cd6e0ec commit 422359a6e887fe88be7eaaf4aa14e597513142a6 @dbussink dbussink committed Aug 5, 2012
Showing with 14 additions and 14 deletions.
  1. +1 −1 vm/builtin/compiledcode.cpp
  2. +5 −5 vm/builtin/location.cpp
  3. +2 −2 vm/builtin/system.cpp
  4. +1 −1 vm/builtin/variable_scope.cpp
  5. +4 −4 vm/call_frame.cpp
  6. +1 −1 vm/gc/gc.cpp
View
2 vm/builtin/compiledcode.cpp
@@ -361,7 +361,7 @@ namespace rubinius {
}
CompiledCode* CompiledCode::of_sender(STATE, CallFrame* calling_environment) {
- CallFrame* caller = static_cast<CallFrame*>(calling_environment->previous);
+ CallFrame* caller = calling_environment->previous;
if(caller) {
if(caller->cm) {
return caller->cm;
View
10 vm/builtin/location.cpp
@@ -60,7 +60,7 @@ namespace rubinius {
}
Location* Location::of_closest_ruby_method(STATE, CallFrame* calling_environment) {
- CallFrame* dest = static_cast<CallFrame*>(calling_environment->previous);
+ CallFrame* dest = calling_environment->previous;
// Skip any frames for native methods
while(dest->native_method_p()) { dest = dest->previous; }
return Location::create(state, dest, false);
@@ -96,7 +96,7 @@ namespace rubinius {
// First the first normal frame
while(!call_frame->cm) {
- call_frame = static_cast<CallFrame*>(call_frame->previous);
+ call_frame = call_frame->previous;
// Weird edge case.
if(!call_frame) return bt;
}
@@ -106,7 +106,7 @@ namespace rubinius {
bt->append(state, loc);
- call_frame = static_cast<CallFrame*>(call_frame->previous);
+ call_frame = call_frame->previous;
while(call_frame) {
// Ignore synthetic frames
@@ -117,7 +117,7 @@ namespace rubinius {
if(loc) bt->append(state, loc);
}
- call_frame = static_cast<CallFrame*>(call_frame->previous);
+ call_frame = call_frame->previous;
}
return bt;
@@ -169,7 +169,7 @@ namespace rubinius {
Tuple::from(state, 4, call_frame->cm, line, block, name));
}
- call_frame = static_cast<CallFrame*>(call_frame->previous);
+ call_frame = call_frame->previous;
}
return bt;
View
4 vm/builtin/system.cpp
@@ -600,7 +600,7 @@ namespace rubinius {
bool include_vars = CBOOL(inc_vars);
for(native_int i = skip->to_native(); call_frame && i > 0; --i) {
- call_frame = static_cast<CallFrame*>(call_frame->previous);
+ call_frame = call_frame->previous;
}
return Location::from_call_stack(state, call_frame, include_vars);
@@ -611,7 +611,7 @@ namespace rubinius {
CallFrame* call_frame = calling_environment;
for(native_int i = skip->to_native(); call_frame && i > 0; --i) {
- call_frame = static_cast<CallFrame*>(call_frame->previous);
+ call_frame = call_frame->previous;
}
return Location::mri_backtrace(state, call_frame);
View
2 vm/builtin/variable_scope.cpp
@@ -30,7 +30,7 @@ namespace rubinius {
}
VariableScope* VariableScope::of_sender(STATE, CallFrame* call_frame) {
- CallFrame* dest = static_cast<CallFrame*>(call_frame->previous);
+ CallFrame* dest = call_frame->previous;
// Skip any frames for native methods
while(dest->native_method_p()) { dest = dest->previous; }
return dest->promote_scope(state);
View
8 vm/call_frame.cpp
@@ -91,12 +91,12 @@ namespace rubinius {
}
stream << std::endl;
- cf = static_cast<CallFrame*>(cf->previous);
+ cf = cf->previous;
continue;
}
if(!cf->cm) {
- cf = static_cast<CallFrame*>(cf->previous);
+ cf = cf->previous;
continue;
}
@@ -160,7 +160,7 @@ namespace rubinius {
stream << ")";
stream << std::endl;
- cf = static_cast<CallFrame*>(cf->previous);
+ cf = cf->previous;
}
}
@@ -175,7 +175,7 @@ namespace rubinius {
CallFrame* cur = this;
while(cur) {
if(cur->scope && cur->scope->on_heap() == scope) return true;
- cur = static_cast<CallFrame*>(cur->previous);
+ cur = cur->previous;
}
return false;
View
2 vm/gc/gc.cpp
@@ -245,7 +245,7 @@ namespace rubinius {
saw_variable_scope(call_frame, displace(call_frame->scope, offset));
- call_frame = static_cast<CallFrame*>(call_frame->previous);
+ call_frame = call_frame->previous;
}
}

0 comments on commit 422359a

Please sign in to comment.
Something went wrong with that request. Please try again.