Blob Blame History Raw
For some reason the s390x build (and only the s390x build) fails with:

/builddir/build/BUILD/widelands-build20/src/ui_basic/box.cc: In member function 'virtual void UI::Box::layout()':
/builddir/build/BUILD/widelands-build20/src/ui_basic/box.cc:163:14: error: 'depth' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  163 |   totaldepth += depth;
      |   ~~~~~~~~~~~^~~~~~~~
cc1plus: some warnings being treated as errors

This fixes this.
diff -up widelands-1.0/src/ui_basic/box.cc~ widelands-1.0/src/ui_basic/box.cc
--- widelands-1.0/src/ui_basic/box.cc~	2021-06-14 11:22:20.000000000 +0200
+++ widelands-1.0/src/ui_basic/box.cc	2022-03-04 17:24:19.916850150 +0100
@@ -177,7 +177,7 @@ void Box::layout() {
 	int spacing = -inner_spacing_;
 
 	for (size_t idx = 0; idx < items_.size(); ++idx) {
-		int depth, unused = 0;
+		int depth = 0, unused = 0;
 		get_item_desired_size(idx, &depth, &unused);
 		totaldepth += depth;
 		if (items_[idx].type != Item::ItemPanel || items_[idx].u.panel.panel->is_visible()) {
@@ -270,7 +270,7 @@ void Box::update_positions() {
 	}
 
 	for (uint32_t idx = 0; idx < items_.size(); ++idx) {
-		int depth, breadth = 0;
+		int depth = 0, breadth = 0;
 		get_item_size(idx, &depth, &breadth);
 
 		if (items_[idx].type == Item::ItemPanel) {