Skip to content

Commit

Permalink
Used UNUSED macro instead of (void) where applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz authored and gfgtdf committed Oct 7, 2018
1 parent ecaef55 commit 3d953aa
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/ai/formula/function_table.cpp
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/campaign_server/campaign_server.cpp
Expand Up @@ -452,7 +452,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
Expand Down
4 changes: 2 additions & 2 deletions src/formula/function.cpp
Expand Up @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions src/gui/dialogs/lua_interpreter.cpp
Expand Up @@ -232,7 +232,7 @@ class lua_interpreter::input_model {
#endif
void add_to_history (const std::string& str) {
prefix_ = "";
(void) str;
UNUSED(str);
#ifdef HAVE_HISTORY
add_history(str.c_str());
#endif
Expand Down Expand Up @@ -294,7 +294,7 @@ class lua_interpreter::input_model {

// 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;
Expand Down Expand Up @@ -358,7 +358,7 @@ class lua_interpreter::input_model {
cmd = expansion;
free(expansion);
#endif
(void) cmd;
UNUSED(cmd);
return false;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/scripting/game_lua_kernel.cpp
Expand Up @@ -1522,7 +1522,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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/wesnoth.cpp
Expand Up @@ -1020,8 +1020,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 =
Expand Down

0 comments on commit 3d953aa

Please sign in to comment.