widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #14845
[Merge] lp:~widelands-dev/widelands/compiler_warnings_200809 into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/compiler_warnings_200809 into lp:widelands.
Commit message:
Fixed most compiler warnings for clang.
Requested reviews:
Widelands Developers (widelands-dev)
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/compiler_warnings_200809/+merge/355875
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/compiler_warnings_200809 into lp:widelands.
=== modified file 'src/ai/defaultai.cc'
--- src/ai/defaultai.cc 2018-07-13 19:29:51 +0000
+++ src/ai/defaultai.cc 2018-09-29 18:47:59 +0000
@@ -201,6 +201,7 @@
break;
}
}
+ break;
default:
// Do nothing
break;
=== modified file 'src/logic/map_objects/tribes/ship.cc'
--- src/logic/map_objects/tribes/ship.cc 2018-09-25 06:32:35 +0000
+++ src/logic/map_objects/tribes/ship.cc 2018-09-29 18:47:59 +0000
@@ -702,7 +702,6 @@
start_task_idle(game, descr().main_animation(), 1500);
return;
}
- FALLS_THROUGH;
case ShipStates::kSinkRequest:
case ShipStates::kSinkAnimation:
break;
=== modified file 'src/ui_basic/fileview_panel.cc'
--- src/ui_basic/fileview_panel.cc 2018-07-08 09:18:33 +0000
+++ src/ui_basic/fileview_panel.cc 2018-09-29 18:47:59 +0000
@@ -36,7 +36,7 @@
padding_(5),
contents_width_(0),
contents_height_(0),
- style_(scrollbar_style) {
+ panel_style_(scrollbar_style) {
layout();
}
@@ -56,7 +56,7 @@
size_t index = boxes_.size() - 1;
UI::MultilineTextarea* textarea =
- new UI::MultilineTextarea(boxes_.at(index).get(), 0, 0, Scrollbar::kSize, 0, style_, content);
+ new UI::MultilineTextarea(boxes_.at(index).get(), 0, 0, Scrollbar::kSize, 0, panel_style_, content);
textviews_.push_back(std::unique_ptr<UI::MultilineTextarea>(std::move(textarea)));
add((boost::format("about_%" PRIuS) % index).str(), title, boxes_.at(index).get(), "");
@@ -80,9 +80,9 @@
// If there is a border, we have less space for the contents
contents_width_ =
- std::max(0, style_ == UI::PanelStyle::kFsMenu ? get_w() - padding_ : get_w() - 2 * padding_);
+ std::max(0, panel_style_ == UI::PanelStyle::kFsMenu ? get_w() - padding_ : get_w() - 2 * padding_);
- contents_height_ = std::max(0, style_ == UI::PanelStyle::kFsMenu ?
+ contents_height_ = std::max(0, panel_style_ == UI::PanelStyle::kFsMenu ?
get_inner_h() - 2 * padding_ - UI::kTabPanelButtonHeight :
get_inner_h() - 3 * padding_ - UI::kTabPanelButtonHeight);
=== modified file 'src/ui_basic/fileview_panel.h'
--- src/ui_basic/fileview_panel.h 2018-04-27 06:11:05 +0000
+++ src/ui_basic/fileview_panel.h 2018-09-29 18:47:59 +0000
@@ -47,7 +47,7 @@
const int padding_;
int contents_width_;
int contents_height_;
- const UI::PanelStyle style_;
+ const UI::PanelStyle panel_style_;
// Tab contents
std::vector<std::unique_ptr<Box>> boxes_;
=== modified file 'src/wui/game_client_disconnected.h'
--- src/wui/game_client_disconnected.h 2018-09-14 23:52:30 +0000
+++ src/wui/game_client_disconnected.h 2018-09-29 18:47:59 +0000
@@ -26,8 +26,8 @@
#include "ui_basic/multilinetextarea.h"
#include "ui_basic/unique_window.h"
-class GameHost;
class InteractiveGameBase;
+struct GameHost;
/**
* Dialog that offers to replace a player with an AI or exit the game.
=== modified file 'src/wui/interactive_player.cc'
--- src/wui/interactive_player.cc 2018-09-25 06:32:35 +0000
+++ src/wui/interactive_player.cc 2018-09-29 18:47:59 +0000
@@ -479,6 +479,7 @@
}
return dynamic_cast<GameChatMenu*>(chat_.window)->enter_chat_message();
}
+ break;
default:
break;
}
=== modified file 'src/wui/interactive_spectator.cc'
--- src/wui/interactive_spectator.cc 2018-09-25 06:32:35 +0000
+++ src/wui/interactive_spectator.cc 2018-09-29 18:47:59 +0000
@@ -257,6 +257,7 @@
}
return dynamic_cast<GameChatMenu*>(chat_.window)->enter_chat_message();
}
+ break;
default:
break;
}
=== modified file 'src/wui/seafaring_statistics_menu.cc'
--- src/wui/seafaring_statistics_menu.cc 2018-05-13 07:15:39 +0000
+++ src/wui/seafaring_statistics_menu.cc 2018-09-29 18:47:59 +0000
@@ -225,9 +225,8 @@
return pgettext("ship_state", "Founding a Colony");
case SeafaringStatisticsMenu::ShipFilterStatus::kAll:
return "All"; // The user shouldn't see this, so we don't localize
- default:
- NEVER_HERE();
}
+ NEVER_HERE();
}
const Image*
@@ -254,8 +253,6 @@
case SeafaringStatisticsMenu::ShipFilterStatus::kAll:
filename = "images/wui/ship/ship_scout_ne.png";
break;
- default:
- NEVER_HERE();
}
return g_gr->images().get(filename);
}
@@ -418,7 +415,7 @@
case SDLK_KP_PERIOD:
if (code.mod & KMOD_NUM)
break;
- /* no break */
+ FALLS_THROUGH;
default:
break; // not handled
}
=== modified file 'src/wui/waresdisplay.cc'
--- src/wui/waresdisplay.cc 2018-09-12 05:57:57 +0000
+++ src/wui/waresdisplay.cc 2018-09-29 18:47:59 +0000
@@ -385,7 +385,7 @@
remove_all_warelists();
}
-const char* unit_suffixes[] = {
+static const char* unit_suffixes[] = {
"%1%",
/** TRANSLATORS: This is a large number with a suffix (e.g. 50k = 50,000). */
/** TRANSLATORS: Space is limited, use only 1 letter for the suffix and no whitespace. */
=== modified file 'src/wui/watchwindow.h'
--- src/wui/watchwindow.h 2018-04-29 09:20:29 +0000
+++ src/wui/watchwindow.h 2018-09-29 18:47:59 +0000
@@ -38,7 +38,7 @@
uint32_t w,
uint32_t h,
bool single_window_ = false);
- ~WatchWindow();
+ ~WatchWindow() override;
boost::signals2::signal<void(Vector2f)> warp_mainview;
Follow ups