1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 20:02:40 +01:00

Silence a lot of warnings

This commit is contained in:
darkf 2016-08-02 04:00:05 -07:00
parent f3151fe0b7
commit a574649dce
12 changed files with 19 additions and 13 deletions

View File

@ -314,6 +314,8 @@ private:
// Set state // Set state
void setBlend(bool enable) void setBlend(bool enable)
{ {
RW_UNUSED(enable);
/// @todo set blendEnabled, currently not possible because other functions keep trashing the state /// @todo set blendEnabled, currently not possible because other functions keep trashing the state
#if 0 #if 0
if (enable && !blendEnabled) { if (enable && !blendEnabled) {

View File

@ -166,7 +166,7 @@ void game_create_vehicle_generator(const ScriptArguments& args)
void game_set_vehicle_generator_count(const ScriptArguments& args) void game_set_vehicle_generator_count(const ScriptArguments& args)
{ {
RW_CHECK(args.getWorld()->state->vehicleGenerators.size() > *args[0].globalInteger, "VehicleGenerator out of range"); RW_CHECK(args.getWorld()->state->vehicleGenerators.size() > *args[0].globalInteger, "VehicleGenerator out of range");
if (args.getWorld()->state->vehicleGenerators.size() > *args[0].globalInteger) { if ((int)args.getWorld()->state->vehicleGenerators.size() > *args[0].globalInteger) {
VehicleGenerator& generator = args.getWorld()->state->vehicleGenerators.at(*args[0].globalInteger); VehicleGenerator& generator = args.getWorld()->state->vehicleGenerators.at(*args[0].globalInteger);
generator.remainingSpawns = args[1].integer; generator.remainingSpawns = args[1].integer;
} }

View File

@ -126,7 +126,7 @@ void drawPlayerInfo(PlayerController* player, GameWorld* world, GameRenderer* re
} }
std::string s; std::string s;
for (int i = 0; i < ui_maxWantedLevel; ++i) { for (size_t i = 0; i < ui_maxWantedLevel; ++i) {
s += "]"; s += "]";
} }
ti.text = s; ti.text = s;

View File

@ -232,7 +232,7 @@ void RWGame::newGame()
void RWGame::saveGame(const std::string& savename) void RWGame::saveGame(const std::string& savename)
{ {
RW_UNUSED(savename);
} }
void RWGame::loadGame(const std::string& savename) void RWGame::loadGame(const std::string& savename)
@ -290,7 +290,7 @@ void RWGame::startScript(const std::string& name)
std::stringstream ss; std::stringstream ss;
ss << " " << bp.function->description << "."; ss << " " << bp.function->description << ".";
ss << " Args:"; ss << " Args:";
for(int a = 0; a < bp.args->getParameters().size(); a++) for(size_t a = 0; a < bp.args->getParameters().size(); a++)
{ {
auto& arg = bp.args->getParameters()[a]; auto& arg = bp.args->getParameters()[a];
ss << " " << arg.integerValue(); ss << " " << arg.integerValue();
@ -457,7 +457,7 @@ void RWGame::tick(float dt)
} }
// Clean up old VisualFX // Clean up old VisualFX
for( int i = 0; i < world->effects.size(); ++i ) for( ssize_t i = 0; i < static_cast<ssize_t>(world->effects.size()); ++i )
{ {
VisualFX* effect = world->effects[i]; VisualFX* effect = world->effects[i];
if( effect->getType() == VisualFX::Particle ) if( effect->getType() == VisualFX::Particle )
@ -624,7 +624,7 @@ void RWGame::renderDebugStats(float time, Renderer::ProfileInfo& worldRenderTime
times_index = 0; times_index = 0;
time_average = 0; time_average = 0;
for (int i = 0; i < average_every_frame; ++i) { for (size_t i = 0; i < average_every_frame; ++i) {
time_average += times[i]; time_average += times[i];
} }
time_average /= average_every_frame; time_average /= average_every_frame;
@ -718,6 +718,8 @@ void RWGame::renderDebugStats(float time, Renderer::ProfileInfo& worldRenderTime
void RWGame::renderDebugPaths(float time) void RWGame::renderDebugPaths(float time)
{ {
RW_UNUSED(time);
btVector3 roadColour(1.f, 0.f, 0.f); btVector3 roadColour(1.f, 0.f, 0.f);
btVector3 pedColour(0.f, 0.f, 1.f); btVector3 pedColour(0.f, 0.f, 1.f);

View File

@ -27,12 +27,12 @@ class RWGame
// must be allocated after Logger setup. // must be allocated after Logger setup.
GameRenderer* renderer; GameRenderer* renderer;
ScriptMachine* script; ScriptMachine* script;
GameWindow *window;
// Background worker // Background worker
WorkContext *work; WorkContext *work;
bool debugScript; bool debugScript;
HttpServer* httpserver = nullptr; HttpServer* httpserver = nullptr;
std::thread* httpserver_thread = nullptr; std::thread* httpserver_thread = nullptr;
GameWindow *window;
std::chrono::steady_clock clock; std::chrono::steady_clock clock;
std::chrono::steady_clock::time_point last_clock_time; std::chrono::steady_clock::time_point last_clock_time;

View File

@ -320,8 +320,10 @@ std::string HttpServer::getState() const
} }
} }
std::string HttpServer::dispatch(std::string method, std::string path) std::string HttpServer::dispatch(const std::string& method, const std::string& path)
{ {
RW_UNUSED(method);
std::stringstream ss; std::stringstream ss;
std::string mime = "text/html"; std::string mime = "text/html";
if(path == "/debugger.js") { if(path == "/debugger.js") {

View File

@ -19,6 +19,6 @@ private:
bool paused; bool paused;
const SCMBreakpoint* lastBreakpoint; const SCMBreakpoint* lastBreakpoint;
std::string dispatch(std::string method, std::string path); std::string dispatch(const std::string& method, const std::string& path);
std::string getState() const; std::string getState() const;
}; };

View File

@ -74,7 +74,6 @@ void TcpSocket::disconnect()
char* TcpSocket::getRemoteAddress() const char* TcpSocket::getRemoteAddress() const
{ {
char buffer[INET_ADDRSTRLEN+1] = { };
return inet_ntoa(addr.sin_addr); return inet_ntoa(addr.sin_addr);
} }

View File

@ -101,7 +101,6 @@ IngameState::IngameState(RWGame* game, bool newgame, const std::string& save)
void IngameState::startTest() void IngameState::startTest()
{ {
auto playerChar = getWorld()->createPlayer({270.f, -605.f, 40.f}); auto playerChar = getWorld()->createPlayer({270.f, -605.f, 40.f});
auto player = new PlayerController(playerChar);
getWorld()->state->playerObject = playerChar->getGameObjectID(); getWorld()->state->playerObject = playerChar->getGameObjectID();

View File

@ -26,6 +26,8 @@ void LoadingState::exit()
void LoadingState::tick(float dt) void LoadingState::tick(float dt)
{ {
RW_UNUSED(dt);
// If background work is completed, switch to the next state // If background work is completed, switch to the next state
if( getWorld()->_work->isEmpty() ) { if( getWorld()->_work->isEmpty() ) {
StateManager::get().exec(next); StateManager::get().exec(next);

View File

@ -59,7 +59,7 @@ void MenuState::exit()
void MenuState::tick(float dt) void MenuState::tick(float dt)
{ {
RW_UNUSED(dt);
} }
void MenuState::handleEvent(const SDL_Event& e) void MenuState::handleEvent(const SDL_Event& e)

View File

@ -28,7 +28,7 @@ void PauseState::exit()
void PauseState::tick(float dt) void PauseState::tick(float dt)
{ {
RW_UNUSED(dt);
} }
void PauseState::draw(GameRenderer* r) void PauseState::draw(GameRenderer* r)