Update code style to C++11

master
Elias Fleckenstein 2021-05-15 21:32:06 +02:00
parent b41a2e9ba2
commit 107081988e
6 changed files with 154 additions and 156 deletions

View File

@ -269,7 +269,7 @@ public:
{
try{
return m_con.GetPeerAvgRTT(PEER_ID_SERVER);
} catch(con::PeerNotFoundException){
} catch(con::PeerNotFoundException &){
return 1337;
}
}

View File

@ -1215,7 +1215,7 @@ bool Connection::checkIncomingBuffers(Channel *channel, u16 &peer_id,
break;
}
// This happens if all packets are old
}catch(con::NotFoundException)
}catch(con::NotFoundException &)
{}
if(channel->incoming_reliables.empty() == false)

View File

@ -28,7 +28,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
// Get a dependency-sorted list of ModSpecs
core::list<ModSpec> getMods(core::list<std::string> &modspaths)
throw(ModError)
{
std::queue<ModSpec> mods_satisfied;
core::list<ModSpec> mods_unsorted;

View File

@ -59,8 +59,7 @@ struct ModSpec
};
// Get a dependency-sorted list of ModSpecs
core::list<ModSpec> getMods(core::list<std::string> &modspaths)
throw(ModError);
core::list<ModSpec> getMods(core::list<std::string> &modspaths);
#endif

View File

@ -139,14 +139,14 @@ static Server* get_server(lua_State *L)
return server;
}
static ServerEnvironment* get_env(lua_State *L)
/*static ServerEnvironment* get_env(lua_State *L)
{
// Get environment from registry
lua_getfield(L, LUA_REGISTRYINDEX, "minetest_env");
ServerEnvironment *env = (ServerEnvironment*)lua_touserdata(L, -1);
lua_pop(L, 1);
return env;
}
}*/
static void objectref_get(lua_State *L, u16 id)
{

View File

@ -265,7 +265,7 @@ void cmd_banunban(std::wostringstream &os, ServerCommandContext *ctx)
actionstream<<ctx->player->getName()<<" bans "
<<player->getName()<<" / "<<ip_string<<std::endl;
} catch(con::PeerNotFoundException){
} catch(con::PeerNotFoundException &){
dstream<<__FUNCTION_NAME<<": peer was not found"<<std::endl;
}
}