diff --git a/CMakeLists.txt b/CMakeLists.txt index e105e74..5500945 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ IF(MSVC) ENDIF() ELSE() # -Wno-missing-field-initializers is for boost on macos - ADD_DEFINITIONS(-Wall -Wextra -Wno-missing-field-initializers) + ADD_DEFINITIONS(-Wall -Wextra -Wno-missing-field-initializers -Wshadow) ENDIF() include_directories(include) diff --git a/include/chaiscript/dispatchkit/bad_boxed_cast.hpp b/include/chaiscript/dispatchkit/bad_boxed_cast.hpp index 3bf39f5..2d844a1 100644 --- a/include/chaiscript/dispatchkit/bad_boxed_cast.hpp +++ b/include/chaiscript/dispatchkit/bad_boxed_cast.hpp @@ -21,8 +21,8 @@ namespace chaiscript { public: bad_boxed_cast(const Type_Info &t_from, const std::type_info &t_to, - const std::string &what) throw() - : from(t_from), to(&t_to), m_what(what) + const std::string &t_what) throw() + : from(t_from), to(&t_to), m_what(t_what) { } @@ -31,8 +31,8 @@ namespace chaiscript { } - bad_boxed_cast(const std::string &w) throw() - : m_what(w) + bad_boxed_cast(const std::string &t_what) throw() + : m_what(t_what) { } diff --git a/include/chaiscript/dispatchkit/boxed_pod_value.hpp b/include/chaiscript/dispatchkit/boxed_pod_value.hpp index ab51c58..42785e4 100644 --- a/include/chaiscript/dispatchkit/boxed_pod_value.hpp +++ b/include/chaiscript/dispatchkit/boxed_pod_value.hpp @@ -203,14 +203,14 @@ namespace chaiscript throw exception::bad_boxed_cast(">> only valid for integer types"); } - Boxed_Value smart_size(boost::int64_t i) const + Boxed_Value smart_size(boost::int64_t t_i) const { - if (i < boost::integer_traits::const_min - || i > boost::integer_traits::const_max) + if (t_i < boost::integer_traits::const_min + || t_i > boost::integer_traits::const_max) { - return Boxed_Value(i); + return Boxed_Value(t_i); } else { - return Boxed_Value(static_cast(i)); + return Boxed_Value(static_cast(t_i)); } } diff --git a/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp b/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp index 129b963..ab0835b 100644 --- a/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp +++ b/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp @@ -76,17 +76,17 @@ namespace chaiscript { } - virtual Boxed_Value convert(const Boxed_Value &derived) + virtual Boxed_Value convert(const Boxed_Value &t_derived) { - if (derived.get_type_info().bare_equal(user_type())) + if (t_derived.get_type_info().bare_equal(user_type())) { - if (derived.is_pointer()) + if (t_derived.is_pointer()) { // Dynamic cast out the contained boxed value, which we know is the type we want - if (derived.is_const()) + if (t_derived.is_const()) { boost::shared_ptr data - = boost::dynamic_pointer_cast(detail::Cast_Helper >::cast(derived)); + = boost::dynamic_pointer_cast(detail::Cast_Helper >::cast(t_derived)); if (!data) { throw std::bad_cast(); @@ -95,7 +95,7 @@ namespace chaiscript return Boxed_Value(data); } else { boost::shared_ptr data - = boost::dynamic_pointer_cast(detail::Cast_Helper >::cast(derived)); + = boost::dynamic_pointer_cast(detail::Cast_Helper >::cast(t_derived)); if (!data) { @@ -106,19 +106,19 @@ namespace chaiscript } } else { // Pull the reference out of the contained boxed value, which we know is the type we want - if (derived.is_const()) + if (t_derived.is_const()) { - const Derived &d = detail::Cast_Helper::cast(derived); + const Derived &d = detail::Cast_Helper::cast(t_derived); const Base &data = dynamic_cast(d); return Boxed_Value(boost::cref(data)); } else { - Derived &d = detail::Cast_Helper::cast(derived); + Derived &d = detail::Cast_Helper::cast(t_derived); Base &data = dynamic_cast(d); return Boxed_Value(boost::ref(data)); } } } else { - throw exception::bad_boxed_dynamic_cast(derived.get_type_info(), typeid(Base), "Unknown dynamic_cast_conversion"); + throw exception::bad_boxed_dynamic_cast(t_derived.get_type_info(), typeid(Base), "Unknown dynamic_cast_conversion"); } } }; diff --git a/include/chaiscript/dispatchkit/proxy_functions_detail.hpp b/include/chaiscript/dispatchkit/proxy_functions_detail.hpp index 30a51cb..47bf480 100644 --- a/include/chaiscript/dispatchkit/proxy_functions_detail.hpp +++ b/include/chaiscript/dispatchkit/proxy_functions_detail.hpp @@ -69,7 +69,7 @@ namespace chaiscript { call_func(fun, params); return Handle_Return::handle(); - }; + } }; } } diff --git a/include/chaiscript/language/chaiscript_eval.hpp b/include/chaiscript/language/chaiscript_eval.hpp index f2c7ee7..66655c3 100644 --- a/include/chaiscript/language/chaiscript_eval.hpp +++ b/include/chaiscript/language/chaiscript_eval.hpp @@ -633,13 +633,13 @@ namespace chaiscript } try { - const std::string & function_name = this->children[0]->text; - const std::string & annotation = this->annotation?this->annotation->text:""; + const std::string & l_function_name = this->children[0]->text; + const std::string & l_annotation = this->annotation?this->annotation->text:""; t_ss.add(Proxy_Function (new Dynamic_Proxy_Function(boost::bind(&eval_function, boost::ref(t_ss), this->children.back(), t_param_names, _1), static_cast(numparams), this->children.back(), - annotation, guard)), function_name); + l_annotation, guard)), l_function_name); } catch (reserved_word_error &e) { throw Eval_Error("Reserved word used as function name '" + e.word + "'"); @@ -1069,8 +1069,8 @@ namespace chaiscript try { this->children.back()->children[0]->eval(t_ss); } - catch (Eval_Error &ee) { - ee.call_stack.push_back(this->children.back()->children[0]); + catch (Eval_Error &ee2) { + ee2.call_stack.push_back(this->children.back()->children[0]); t_ss.pop_scope(); throw; } @@ -1334,7 +1334,7 @@ namespace chaiscript } try { - const std::string & annotation = this->annotation?this->annotation->text:""; + const std::string & l_annotation = this->annotation?this->annotation->text:""; const std::string & class_name = this->children[0]->text; const std::string & function_name = this->children[1]->text; if (function_name == class_name) { @@ -1343,7 +1343,7 @@ namespace chaiscript (new Dynamic_Proxy_Function(boost::bind(&eval_function, boost::ref(t_ss), this->children.back(), t_param_names, _1), static_cast(numparams), this->children.back(), - annotation, guard)))), function_name); + l_annotation, guard)))), function_name); } else { @@ -1358,7 +1358,7 @@ namespace chaiscript (new Dynamic_Proxy_Function(boost::bind(&eval_function, boost::ref(t_ss), this->children.back(), t_param_names, _1), static_cast(numparams), this->children.back(), - annotation, guard)), ti)), function_name); + l_annotation, guard)), ti)), function_name); } }