summaryrefslogtreecommitdiff
path: root/src/widget.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2011-02-25 21:53:43 +0000
committeralberth <alberth@openttd.org>2011-02-25 21:53:43 +0000
commit1dbc0a20bed5cd85035b4f84a649c4f7386b07ab (patch)
tree2913d6359a374885441eeb51a67c6e0c7e0f08ef /src/widget.cpp
parent87c8d97aca779cb227a4e015233cd266b63f2b79 (diff)
downloadopenttd-1dbc0a20bed5cd85035b4f84a649c4f7386b07ab.tar.xz
(svn r22144) -Codechange: Unify 'while (true)' to 'for (;;)'
Diffstat (limited to 'src/widget.cpp')
-rw-r--r--src/widget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index 44bdb91d8..364403e30 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -1061,7 +1061,7 @@ void NWidgetHorizontal::SetupSmallestSize(Window *w, bool init_array)
/* 1b. Make the container higher if needed to accomadate all childs nicely. */
uint max_smallest = this->smallest_y + 3 * max_vert_fill; // Upper limit to computing smallest height.
uint cur_height = this->smallest_y;
- while (true) {
+ for (;;) {
for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
uint step_size = child_wid->GetVerticalStepSize(ST_SMALLEST);
uint child_height = child_wid->smallest_y + child_wid->padding_top + child_wid->padding_bottom;
@@ -1213,7 +1213,7 @@ void NWidgetVertical::SetupSmallestSize(Window *w, bool init_array)
/* 1b. Make the container wider if needed to accomadate all childs nicely. */
uint max_smallest = this->smallest_x + 3 * max_hor_fill; // Upper limit to computing smallest height.
uint cur_width = this->smallest_x;
- while (true) {
+ for (;;) {
for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
uint step_size = child_wid->GetHorizontalStepSize(ST_SMALLEST);
uint child_width = child_wid->smallest_x + child_wid->padding_left + child_wid->padding_right;
@@ -2538,7 +2538,7 @@ static int MakeWidgetTree(const NWidgetPart *parts, int count, NWidgetBase **par
assert(*parent == NULL || (nwid_cont != NULL && nwid_parent == NULL) || (nwid_cont == NULL && nwid_parent != NULL));
int total_used = 0;
- while (true) {
+ for (;;) {
NWidgetBase *sub_widget = NULL;
bool fill_sub = false;
int num_used = MakeNWidget(parts, count - total_used, &sub_widget, &fill_sub, biggest_index);