From: Ingo Ruhnke Date: Mon, 11 Aug 2014 21:53:48 +0000 (+0200) Subject: Fixed compiler warnings due to new loglevel aware log macro X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=d7f9751b33eb80b789aabee8c1cac97a237e9d25;p=supertux.git Fixed compiler warnings due to new loglevel aware log macro --- diff --git a/src/addon/addon.cpp b/src/addon/addon.cpp index c4bc5adcb..0bbe885b5 100644 --- a/src/addon/addon.cpp +++ b/src/addon/addon.cpp @@ -30,7 +30,7 @@ std::string Addon::get_md5() const { if (!installed) { - if (stored_md5 == "") log_warning << "Add-on not installed and no stored MD5 available" << std::endl; + if (stored_md5 == "") { log_warning << "Add-on not installed and no stored MD5 available" << std::endl; } return stored_md5; } diff --git a/src/badguy/darttrap.cpp b/src/badguy/darttrap.cpp index b31f2e81e..cfbc06e87 100644 --- a/src/badguy/darttrap.cpp +++ b/src/badguy/darttrap.cpp @@ -40,7 +40,7 @@ DartTrap::DartTrap(const Reader& reader) : reader.get("ammo", ammo); countMe = false; sound_manager->preload("sounds/dartfire.wav"); - if (start_dir == AUTO) log_warning << "Setting a DartTrap's direction to AUTO is no good idea" << std::endl; + if (start_dir == AUTO) { log_warning << "Setting a DartTrap's direction to AUTO is no good idea" << std::endl; } state = IDLE; set_colgroup_active(COLGROUP_DISABLED); if (initial_delay == 0) initial_delay = 0.1f; diff --git a/src/object/gradient.cpp b/src/object/gradient.cpp index 9d1efeacb..ef86b11a3 100644 --- a/src/object/gradient.cpp +++ b/src/object/gradient.cpp @@ -57,12 +57,17 @@ Gradient::set_gradient(Color top, Color bottom) gradient_top = top; gradient_bottom = bottom; - if (gradient_top.red > 1.0 || gradient_top.green > 1.0 - || gradient_top.blue > 1.0 || gradient_top.alpha > 1.0) + if (gradient_top.red > 1.0 || gradient_top.green > 1.0 || + gradient_top.blue > 1.0 || gradient_top.alpha > 1.0) + { log_warning << "top gradient color has values above 1.0" << std::endl; - if (gradient_bottom.red > 1.0 || gradient_bottom.green > 1.0 - || gradient_bottom.blue > 1.0 || gradient_bottom.alpha > 1.0) + } + + if (gradient_bottom.red > 1.0 || gradient_bottom.green > 1.0 || + gradient_bottom.blue > 1.0 || gradient_bottom.alpha > 1.0) + { log_warning << "bottom gradient color has values above 1.0" << std::endl; + } } void diff --git a/src/object/ispy.cpp b/src/object/ispy.cpp index fe6f403f1..2e760b371 100644 --- a/src/object/ispy.cpp +++ b/src/object/ispy.cpp @@ -43,7 +43,7 @@ Ispy::Ispy(const Reader& reader) : if( dir_str == "right" ) dir = RIGHT; reader.get("facing-down", facing_down); if (facing_down) dir = DOWN; - if (dir == AUTO) log_warning << "Setting an Ispy's direction to AUTO is no good idea" << std::endl; + if (dir == AUTO) { log_warning << "Setting an Ispy's direction to AUTO is no good idea" << std::endl; } // set initial sprite action sprite->set_action((dir == DOWN) ? "idle-down" : ((dir == LEFT) ? "idle-left" : "idle-right")); diff --git a/src/object/tilemap.cpp b/src/object/tilemap.cpp index 23b3fee07..3a4520ac4 100644 --- a/src/object/tilemap.cpp +++ b/src/object/tilemap.cpp @@ -129,7 +129,9 @@ TileMap::TileMap(const Reader& reader) : } if(empty) + { log_info << "Tilemap '" << name << "', z-pos '" << z_pos << "' is empty." << std::endl; + } } TileMap::TileMap(const TileSet *new_tileset, std::string name, int z_pos, diff --git a/src/supertux/sector.cpp b/src/supertux/sector.cpp index 0add01f00..4be93298d 100644 --- a/src/supertux/sector.cpp +++ b/src/supertux/sector.cpp @@ -229,7 +229,7 @@ Sector::parse(const Reader& sector) update_game_objects(); - if(solid_tilemaps.size() < 1) log_warning << "sector '" << name << "' does not contain a solid tile layer." << std::endl; + if(solid_tilemaps.size() < 1) { log_warning << "sector '" << name << "' does not contain a solid tile layer." << std::endl; } fix_old_tiles(); if(!camera) { @@ -394,7 +394,7 @@ Sector::parse_old_format(const Reader& reader) update_game_objects(); - if(solid_tilemaps.size() < 1) log_warning << "sector '" << name << "' does not contain a solid tile layer." << std::endl; + if(solid_tilemaps.size() < 1) { log_warning << "sector '" << name << "' does not contain a solid tile layer." << std::endl; } fix_old_tiles(); update_game_objects(); diff --git a/src/video/sdl/sdl_renderer.cpp b/src/video/sdl/sdl_renderer.cpp index 6c7baa7f9..a8796656c 100644 --- a/src/video/sdl/sdl_renderer.cpp +++ b/src/video/sdl/sdl_renderer.cpp @@ -100,10 +100,10 @@ SDLRenderer::SDLRenderer() : { log_info << "SDL_Renderer: " << info.name << std::endl; log_info << "SDL_RendererFlags: " << std::endl; - if (info.flags & SDL_RENDERER_SOFTWARE) log_info << " SDL_RENDERER_SOFTWARE" << std::endl; - if (info.flags & SDL_RENDERER_ACCELERATED) log_info << " SDL_RENDERER_ACCELERATED" << std::endl; - if (info.flags & SDL_RENDERER_PRESENTVSYNC) log_info << " SDL_RENDERER_PRESENTVSYNC" << std::endl; - if (info.flags & SDL_RENDERER_TARGETTEXTURE) log_info << " SDL_RENDERER_TARGETTEXTURE" << std::endl; + if (info.flags & SDL_RENDERER_SOFTWARE) { log_info << " SDL_RENDERER_SOFTWARE" << std::endl; } + if (info.flags & SDL_RENDERER_ACCELERATED) { log_info << " SDL_RENDERER_ACCELERATED" << std::endl; } + if (info.flags & SDL_RENDERER_PRESENTVSYNC) { log_info << " SDL_RENDERER_PRESENTVSYNC" << std::endl; } + if (info.flags & SDL_RENDERER_TARGETTEXTURE) { log_info << " SDL_RENDERER_TARGETTEXTURE" << std::endl; } log_info << "Texture Formats: " << std::endl; for(size_t i = 0; i < info.num_texture_formats; ++i) {