← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/compiler_warnings_201804 into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/compiler_warnings_201804 into lp:widelands.

Commit message:
Fixed some compiler warnings for GCC and Clang.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/compiler_warnings_201804/+merge/344800
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/compiler_warnings_201804 into lp:widelands.
=== modified file 'src/ai/ai_help_structs.h'
--- src/ai/ai_help_structs.h	2018-04-08 22:33:43 +0000
+++ src/ai/ai_help_structs.h	2018-04-28 14:48:46 +0000
@@ -267,7 +267,7 @@
 struct FindNodeAcceptAll {
 	bool accept(const Map&, FCoords) const {
 		return true;
-	};
+	}
 };
 
 struct NearFlag {

=== modified file 'src/logic/campaign_visibility.cc'
--- src/logic/campaign_visibility.cc	2018-04-07 16:59:00 +0000
+++ src/logic/campaign_visibility.cc	2018-04-28 14:48:46 +0000
@@ -78,8 +78,8 @@
 	// Variable declaration
 	int32_t i = 0;
 	int32_t imap = 0;
-	char csection[12];
-	char number[4];
+	char csection[24];
+	char number[12];
 	std::string mapsection;
 	std::string cms;
 
@@ -98,8 +98,8 @@
 	{
 		Section& vis = campvisw.pull_section("campaigns");
 		sprintf(csection, "campsect%i", i);
-		char cvisible[12];
-		char cnewvisi[12];
+		char cvisible[24];
+		char cnewvisi[24];
 		while (cconf_s.get_string(csection)) {
 			sprintf(cvisible, "campvisi%i", i);
 			sprintf(cnewvisi, "cnewvisi%i", i);

=== modified file 'src/map_io/map_players_view_packet.cc'
--- src/map_io/map_players_view_packet.cc	2018-04-07 16:59:00 +0000
+++ src/map_io/map_players_view_packet.cc	2018-04-28 14:48:46 +0000
@@ -81,7 +81,7 @@
 constexpr uint8_t kCurrentPacketVersionBorder = 1;
 #define BORDER_FILENAME_TEMPLATE DIRNAME_TEMPLATE "/border_%u"
 
-#define FILENAME_SIZE 48
+#define FILENAME_SIZE 64
 
 enum {
 	UNSEEN_NONE = 0,

=== modified file 'src/network/internet_gaming.cc'
--- src/network/internet_gaming.cc	2018-04-07 16:59:00 +0000
+++ src/network/internet_gaming.cc	2018-04-28 14:48:46 +0000
@@ -402,7 +402,7 @@
 				// Our work is done
 				return;
 			}
-		} catch (const std::exception& e) {
+		} catch (const std::exception&) {
 			log("InternetGaming: Error when trying to transmit secondary IP.\n");
 			return;
 		}

=== modified file 'src/wui/interactive_base.cc'
--- src/wui/interactive_base.cc	2018-04-27 13:19:15 +0000
+++ src/wui/interactive_base.cc	2018-04-28 14:48:46 +0000
@@ -284,8 +284,8 @@
 	toolbar_.add(button);
 	if (window) {
 		window->opened.connect(
-		   [this, button] { button->set_style(UI::Button::Style::kPermpressed); });
-		window->closed.connect([this, button] { button->set_style(UI::Button::Style::kRaised); });
+		   [button] { button->set_style(UI::Button::Style::kPermpressed); });
+		window->closed.connect([button] { button->set_style(UI::Button::Style::kRaised); });
 
 		if (bind_default_toggle) {
 			button->sigclicked.connect(


Follow ups