From c5533ae4708d85dcdff8e53515e17ab593f7f361 Mon Sep 17 00:00:00 2001
From: smatz <smatz@openttd.org>
Date: Fri, 14 Aug 2009 17:11:59 +0000
Subject: [PATCH] (svn r17168) -Codechange: apply coding style to if and while
 statements

---
 src/industry_gui.cpp              | 2 +-
 src/network/core/os_abstraction.h | 2 +-
 src/order_cmd.cpp                 | 4 ++--
 src/road_func.h                   | 2 +-
 src/strgen/strgen.cpp             | 2 +-
 src/train_cmd.cpp                 | 2 +-
 src/video/cocoa/wnd_quartz.mm     | 2 +-
 src/widget.cpp                    | 2 +-
 src/window.cpp                    | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 23492a7652..6d79fb5b3b 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -143,7 +143,7 @@ class BuildIndustryWindow : public Window {
 		 */
 		for (ind = 0; ind < NUM_INDUSTRYTYPES; ind++) {
 			indsp = GetIndustrySpec(ind);
-			if (indsp->enabled){
+			if (indsp->enabled) {
 				/* Rule is that editor mode loads all industries.
 				 * In game mode, all non raw industries are loaded too
 				 * and raw ones are loaded only when setting allows it */
diff --git a/src/network/core/os_abstraction.h b/src/network/core/os_abstraction.h
index d44277d7de..fcfa05ca5c 100644
--- a/src/network/core/os_abstraction.h
+++ b/src/network/core/os_abstraction.h
@@ -112,7 +112,7 @@ static inline void OTTDfreeaddrinfo(struct addrinfo *ai)
 		free(ai->ai_addr);
 		free(ai);
 		ai = next;
-	} while(ai != NULL);
+	} while (ai != NULL);
 }
 #define freeaddrinfo OTTDfreeaddrinfo
 #endif /* __MINGW32__ && __CYGWIN__ */
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index e97469371f..c7fff9e864 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -852,9 +852,9 @@ CommandCost CmdMoveOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
 				VehicleOrderID order_id = order->GetConditionSkipToOrder();
 				if (order_id == moving_order) {
 					order_id = target_order;
-				} else if(order_id > moving_order && order_id <= target_order) {
+				} else if (order_id > moving_order && order_id <= target_order) {
 					order_id--;
-				} else if(order_id < moving_order && order_id >= target_order) {
+				} else if (order_id < moving_order && order_id >= target_order) {
 					order_id++;
 				}
 				order->SetConditionSkipToOrder(order_id);
diff --git a/src/road_func.h b/src/road_func.h
index 4b96cd608b..b11f75c08a 100644
--- a/src/road_func.h
+++ b/src/road_func.h
@@ -94,7 +94,7 @@ static inline RoadBits MirrorRoadBits(RoadBits r)
  */
 static inline RoadBits RotateRoadBits(RoadBits r, DiagDirDiff rot)
 {
-	for (; rot > (DiagDirDiff)0; rot--){
+	for (; rot > (DiagDirDiff)0; rot--) {
 		r = (RoadBits)(GB(r, 0, 1) << 3 | GB(r, 1, 3));
 	}
 	return r;
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index d5213107f3..e1d5435c2d 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -621,7 +621,7 @@ static const CmdStruct *TranslateCmdForCompare(const CmdStruct *a)
 			strcmp(a->cmd, "STRING3") == 0 ||
 			strcmp(a->cmd, "STRING4") == 0 ||
 			strcmp(a->cmd, "STRING5") == 0 ||
-			strcmp(a->cmd, "RAW_STRING") == 0){
+			strcmp(a->cmd, "RAW_STRING") == 0) {
 		return FindCmd("STRING", 6);
 	}
 
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index a3ed9d30b0..4d41c5fc69 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2239,7 +2239,7 @@ static TrainFindDepotData FindClosestTrainDepot(Train *v, int max_distance)
 			/* search in the forward direction first. */
 			DiagDirection i = TrainExitDir(v->direction, v->track);
 			NewTrainPathfind(v->tile, 0, v->compatible_railtypes, i, (NTPEnumProc*)NtpCallbFindDepot, &tfdd);
-			if (tfdd.best_length == UINT_MAX){
+			if (tfdd.best_length == UINT_MAX) {
 				tfdd.reverse = true;
 				/* search in backwards direction */
 				i = TrainExitDir(ReverseDir(v->direction), v->track);
diff --git a/src/video/cocoa/wnd_quartz.mm b/src/video/cocoa/wnd_quartz.mm
index 3ad0c32b9d..c3b6d776e5 100644
--- a/src/video/cocoa/wnd_quartz.mm
+++ b/src/video/cocoa/wnd_quartz.mm
@@ -592,7 +592,7 @@ void WindowQuartzSubdriver::Draw()
 	/* Build the region of dirty rectangles */
 	for (i = 0; i < num_dirty_rects; i++) {
 		/* We only need to blit in indexed mode since in 32bpp mode the game draws directly to the image. */
-		if(buffer_depth == 8) {
+		if (buffer_depth == 8) {
 			BlitIndexedToView32(
 				dirty_rects[i].left,
 				dirty_rects[i].top,
diff --git a/src/widget.cpp b/src/widget.cpp
index 54ac5db728..4ac79afa2d 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -1104,7 +1104,7 @@ void NWidgetCore::StoreWidgets(Widget *widgets, int length, bool left_moving, bo
 	/* Compute vertical resizing. */
 	if (top_moving) {
 		flags |= RESIZE_TB; // Only 1 widget can resize in the widget array.
-	} else if(this->resize_y > 0) {
+	} else if (this->resize_y > 0) {
 		flags |= RESIZE_BOTTOM;
 	}
 	/* Compute horizontal resizing. */
diff --git a/src/window.cpp b/src/window.cpp
index 0d46ff644f..c9c43aab6f 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1869,7 +1869,7 @@ static bool HandleScrollbarScrolling()
 			if (w->flags4 & WF_HSCROLL) {
 				sb = &w->hscroll;
 				i = _cursor.pos.x - _cursorpos_drag_start.x;
-			} else if (w->flags4 & WF_SCROLL2){
+			} else if (w->flags4 & WF_SCROLL2) {
 				sb = &w->vscroll2;
 				i = _cursor.pos.y - _cursorpos_drag_start.y;
 			} else {