Used UNUSED macro instead of (void) where applicable

This commit is contained in:
Charles Dang 2018-03-23 12:28:48 +11:00
parent b6c4f0f6ae
commit 7a9ed8d363
6 changed files with 10 additions and 10 deletions

View file

@ -892,7 +892,7 @@ DEFINE_WFL_FUNCTION(set_unit_var, 3, 3)
DEFINE_WFL_FUNCTION(fallback, 0, 1)
{
(void)fdb;
UNUSED(fdb);
// The parameter is not used, but is accepted for legacy compatibility
if(args().size() == 1 && args()[0]->evaluate(variables).as_string() != "human")
return variant();

View file

@ -428,7 +428,7 @@ void server::fire(const std::string& hook, const std::string& addon)
}
#if defined(_WIN32)
(void)addon;
UNUSED(addon);
ERR_CS << "Tried to execute a script on an unsupported platform\n";
return;
#else

View file

@ -608,8 +608,8 @@ DEFINE_WFL_FUNCTION(exp, 1, 1)
DEFINE_WFL_FUNCTION(pi, 0, 0)
{
(void)variables;
(void)fdb;
UNUSED(variables);
UNUSED(fdb);
return variant(pi<double>(), variant::DECIMAL_VARIANT);
}

View file

@ -231,7 +231,7 @@ public:
#endif
void add_to_history (const std::string& str) {
prefix_ = "";
(void) str;
UNUSED(str);
#ifdef HAVE_HISTORY
add_history(str.c_str());
#endif
@ -293,7 +293,7 @@ public:
// reset, set history to the end and prefix_ to empty, and return the current prefix_ for the user to edit
end_of_history_ = true;
(void) direction;
UNUSED(direction);
std::string temp = prefix_;
prefix_ = "";
return temp;
@ -357,7 +357,7 @@ public:
cmd = expansion;
free(expansion);
#endif
(void) cmd;
UNUSED(cmd);
return false;
}
};

View file

@ -1517,7 +1517,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));
(void)data; // Suppress an erroneous MSVC warning (a destructor call doesn't count as a reference)
UNUSED(data); // Suppress an erroneous MSVC warning (a destructor call doesn't count as a reference)
data->~end_level_data();
return 0;
}

View file

@ -1025,8 +1025,8 @@ int main(int argc, char** argv)
#endif
{
#ifdef _WIN32
(void)argc;
(void)argv;
UNUSED(argc);
UNUSED(argv);
// windows argv is ansi encoded by default
std::vector<std::string> args =