Skip to content

Commit

Permalink
Squash some MSVC warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Apr 19, 2017
1 parent 69a7d5a commit 8923978
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/ai/formula/callable_objects.cpp
Expand Up @@ -394,11 +394,8 @@ variant set_unit_var_callable::execute_self(variant ctxt) {
}

variant fallback_callable::execute_self(variant) {
// if(get_recursion_count() < recursion_counter::MAX_COUNTER_VALUE) {
//we want give control of the side to human for the rest of this turn
throw fallback_ai_to_human_exception();
// }
return variant(false);
// We want give control of the side to human for the rest of this turn
throw fallback_ai_to_human_exception();
}

}
2 changes: 1 addition & 1 deletion src/gui/dialogs/editor/custom_tod.cpp
Expand Up @@ -257,7 +257,7 @@ const time_of_day& custom_tod::get_selected_tod() const
try {
return times_.at(current_tod_);
} catch(std::out_of_range&) {
assert(false && "Attempted to fetch a non-existant ToD!");
throw std::string("Attempted to fetch a non-existant ToD!");
}
}

Expand Down
1 change: 1 addition & 0 deletions src/scripting/game_lua_kernel.cpp
Expand Up @@ -1461,6 +1461,7 @@ int game_lua_kernel::impl_end_level_data_set(lua_State* L)
static int impl_end_level_data_collect(lua_State* L)
{
end_level_data* data = static_cast<end_level_data*>(lua_touserdata(L, 1));
data; // Suppress an erroneous MSVC warning (a destructor call doesn't count as a reference)
data->~end_level_data();
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions src/scripting/lua_gui2.cpp
Expand Up @@ -435,10 +435,10 @@ int intf_set_dialog_value(lua_State* L)
std::vector<int> selected_vec = lua_check<std::vector<int>>(L, 1);
std::set<int> selected(selected_vec.begin(), selected_vec.end());
for(unsigned i = 0; i < list->get_item_count(); i++) {
list->select_row(i, selected.count(i + 1));
list->select_row(i, selected.count(i + 1) > 0);
}
for(unsigned i = 0; i < list->get_item_count(); i++) {
list->select_row(i, selected.count(i + 1));
list->select_row(i, selected.count(i + 1) > 0);
}
} else {
int v = luaL_checkinteger(L, 1);
Expand Down
4 changes: 2 additions & 2 deletions src/units/unit.hpp
Expand Up @@ -846,10 +846,10 @@ class unit
{
template<typename T>
typename std::enable_if<!std::is_same<int, T>::value, std::string>::type
operator()(T& v) const
operator()(T&) const
{
// Any special upkeep type should have an associated @ref type getter in its helper struct.
return v.type();
return T::type();
}

std::string operator()(int v) const
Expand Down

0 comments on commit 8923978

Please sign in to comment.