diff options
author | Patric Stout <truebrain@openttd.org> | 2021-04-01 11:16:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-01 11:16:19 +0200 |
commit | fece1c57cab1d148e15775f3e10ba474dcfc1360 (patch) | |
tree | 864829048f995a13c2ada0a6f731404a7de0bab7 /src/widget.cpp | |
parent | 9eb6c78a0245317f8dc68ad1034b66019e1bf14f (diff) | |
download | openttd-fece1c57cab1d148e15775f3e10ba474dcfc1360.tar.xz |
Codechange: Suppress warnings when asserts are disabled (#8917)
Diffstat (limited to 'src/widget.cpp')
-rw-r--r-- | src/widget.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widget.cpp b/src/widget.cpp index 2260d463f..b06562108 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -1156,7 +1156,9 @@ void NWidgetHorizontal::SetupSmallestSize(Window *w, bool init_array) this->smallest_y = std::max(this->smallest_y, child_wid->smallest_y + child_wid->padding_top + child_wid->padding_bottom); } /* 1b. Make the container higher if needed to accommodate all children nicely. */ +#ifndef NDEBUG uint max_smallest = this->smallest_y + 3 * max_vert_fill; // Upper limit to computing smallest height. +#endif uint cur_height = this->smallest_y; for (;;) { for (NWidgetBase *child_wid = this->head; child_wid != nullptr; child_wid = child_wid->next) { @@ -1321,7 +1323,9 @@ void NWidgetVertical::SetupSmallestSize(Window *w, bool init_array) this->smallest_x = std::max(this->smallest_x, child_wid->smallest_x + child_wid->padding_left + child_wid->padding_right); } /* 1b. Make the container wider if needed to accommodate all children nicely. */ +#ifndef NDEBUG uint max_smallest = this->smallest_x + 3 * max_hor_fill; // Upper limit to computing smallest height. +#endif uint cur_width = this->smallest_x; for (;;) { for (NWidgetBase *child_wid = this->head; child_wid != nullptr; child_wid = child_wid->next) { |