From 7bbb36a7085576958993cc6c394d5af8455a948d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 4 Dec 2010 22:54:17 +0000 Subject: Make resp_lift const-correct. git-svn-id: http://svn.drobilla.net/resp/resp@294 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/lift.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/lift.cpp') diff --git a/src/lift.cpp b/src/lift.cpp index 979f3c1..e98ddc6 100644 --- a/src/lift.cpp +++ b/src/lift.cpp @@ -91,8 +91,8 @@ lift_fn(CEnv& cenv, Code& code, ATuple* fn) throw() // Lift body const AType* implRetT = NULL; for (ATuple::const_iterator i = fn->iter_at(2); i != fn->end(); ++i) { - AST* lifted = resp_lift(cenv, code, const_cast(*i)); - impl.push_back(lifted); + const AST* lifted = resp_lift(cenv, code, *i); + impl.push_back(const_cast(lifted)); implRetT = cenv.type(lifted); } @@ -142,7 +142,7 @@ lift_call(CEnv& cenv, Code& code, ATuple* call) throw() // Lift all children (callee and arguments, recursively) for (ATuple::const_iterator i = call->begin(); i != call->end(); ++i) - copy.push_back(const_cast(resp_lift(cenv, code, const_cast(*i)))); + copy.push_back(const_cast(resp_lift(cenv, code, *i))); copy.head->loc = call->loc; @@ -197,9 +197,9 @@ lift_def(CEnv& cenv, Code& code, ATuple* def) throw() assert(def->list_ref(1)->to_symbol()); List copy; copy.push_back(def->head()); - copy.push_back(resp_lift(cenv, code, const_cast(def->list_ref(1)))); + copy.push_back(const_cast(resp_lift(cenv, code, def->list_ref(1)))); for (ATuple::const_iterator t = def->iter_at(2); t != def->end(); ++t) - copy.push_back(resp_lift(cenv, code, const_cast(*t))); + copy.push_back(const_cast(resp_lift(cenv, code, *t))); cenv.setTypeSameAs(copy, def); @@ -221,20 +221,20 @@ lift_builtin_call(CEnv& cenv, Code& code, ATuple* call) throw() // Lift all arguments for (ATuple::const_iterator i = call->iter_at(1); i != call->end(); ++i) - copy.push_back(resp_lift(cenv, code, const_cast(*i))); + copy.push_back(const_cast(resp_lift(cenv, code, *i))); cenv.setTypeSameAs(copy, call); return copy; } -AST* -resp_lift(CEnv& cenv, Code& code, AST* ast) throw() +const AST* +resp_lift(CEnv& cenv, Code& code, const AST* ast) throw() { const ASymbol* const sym = ast->to_symbol(); if (sym) return lift_symbol(cenv, code, sym); - ATuple* const call = ast->to_tuple(); + ATuple* const call = const_cast(ast->to_tuple()); if (call) { const ASymbol* const sym = call->head()->to_symbol(); const std::string form = sym ? sym->cppstr : ""; -- cgit v1.2.1