(svn r17168) -Codechange: apply coding style to if and while statements

This commit is contained in:
smatz 2009-08-14 17:11:59 +00:00
parent 3108ff7ac6
commit c5533ae470
9 changed files with 10 additions and 10 deletions

View File

@ -143,7 +143,7 @@ class BuildIndustryWindow : public Window {
*/ */
for (ind = 0; ind < NUM_INDUSTRYTYPES; ind++) { for (ind = 0; ind < NUM_INDUSTRYTYPES; ind++) {
indsp = GetIndustrySpec(ind); indsp = GetIndustrySpec(ind);
if (indsp->enabled){ if (indsp->enabled) {
/* Rule is that editor mode loads all industries. /* Rule is that editor mode loads all industries.
* In game mode, all non raw industries are loaded too * In game mode, all non raw industries are loaded too
* and raw ones are loaded only when setting allows it */ * and raw ones are loaded only when setting allows it */

View File

@ -112,7 +112,7 @@ static inline void OTTDfreeaddrinfo(struct addrinfo *ai)
free(ai->ai_addr); free(ai->ai_addr);
free(ai); free(ai);
ai = next; ai = next;
} while(ai != NULL); } while (ai != NULL);
} }
#define freeaddrinfo OTTDfreeaddrinfo #define freeaddrinfo OTTDfreeaddrinfo
#endif /* __MINGW32__ && __CYGWIN__ */ #endif /* __MINGW32__ && __CYGWIN__ */

View File

@ -852,9 +852,9 @@ CommandCost CmdMoveOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
VehicleOrderID order_id = order->GetConditionSkipToOrder(); VehicleOrderID order_id = order->GetConditionSkipToOrder();
if (order_id == moving_order) { if (order_id == moving_order) {
order_id = target_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--; 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_id++;
} }
order->SetConditionSkipToOrder(order_id); order->SetConditionSkipToOrder(order_id);

View File

@ -94,7 +94,7 @@ static inline RoadBits MirrorRoadBits(RoadBits r)
*/ */
static inline RoadBits RotateRoadBits(RoadBits r, DiagDirDiff rot) 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)); r = (RoadBits)(GB(r, 0, 1) << 3 | GB(r, 1, 3));
} }
return r; return r;

View File

@ -621,7 +621,7 @@ static const CmdStruct *TranslateCmdForCompare(const CmdStruct *a)
strcmp(a->cmd, "STRING3") == 0 || strcmp(a->cmd, "STRING3") == 0 ||
strcmp(a->cmd, "STRING4") == 0 || strcmp(a->cmd, "STRING4") == 0 ||
strcmp(a->cmd, "STRING5") == 0 || strcmp(a->cmd, "STRING5") == 0 ||
strcmp(a->cmd, "RAW_STRING") == 0){ strcmp(a->cmd, "RAW_STRING") == 0) {
return FindCmd("STRING", 6); return FindCmd("STRING", 6);
} }

View File

@ -2239,7 +2239,7 @@ static TrainFindDepotData FindClosestTrainDepot(Train *v, int max_distance)
/* search in the forward direction first. */ /* search in the forward direction first. */
DiagDirection i = TrainExitDir(v->direction, v->track); DiagDirection i = TrainExitDir(v->direction, v->track);
NewTrainPathfind(v->tile, 0, v->compatible_railtypes, i, (NTPEnumProc*)NtpCallbFindDepot, &tfdd); 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; tfdd.reverse = true;
/* search in backwards direction */ /* search in backwards direction */
i = TrainExitDir(ReverseDir(v->direction), v->track); i = TrainExitDir(ReverseDir(v->direction), v->track);

View File

@ -592,7 +592,7 @@ void WindowQuartzSubdriver::Draw()
/* Build the region of dirty rectangles */ /* Build the region of dirty rectangles */
for (i = 0; i < num_dirty_rects; i++) { 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. */ /* 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( BlitIndexedToView32(
dirty_rects[i].left, dirty_rects[i].left,
dirty_rects[i].top, dirty_rects[i].top,

View File

@ -1104,7 +1104,7 @@ void NWidgetCore::StoreWidgets(Widget *widgets, int length, bool left_moving, bo
/* Compute vertical resizing. */ /* Compute vertical resizing. */
if (top_moving) { if (top_moving) {
flags |= RESIZE_TB; // Only 1 widget can resize in the widget array. 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; flags |= RESIZE_BOTTOM;
} }
/* Compute horizontal resizing. */ /* Compute horizontal resizing. */

View File

@ -1869,7 +1869,7 @@ static bool HandleScrollbarScrolling()
if (w->flags4 & WF_HSCROLL) { if (w->flags4 & WF_HSCROLL) {
sb = &w->hscroll; sb = &w->hscroll;
i = _cursor.pos.x - _cursorpos_drag_start.x; i = _cursor.pos.x - _cursorpos_drag_start.x;
} else if (w->flags4 & WF_SCROLL2){ } else if (w->flags4 & WF_SCROLL2) {
sb = &w->vscroll2; sb = &w->vscroll2;
i = _cursor.pos.y - _cursorpos_drag_start.y; i = _cursor.pos.y - _cursorpos_drag_start.y;
} else { } else {