mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-06-24 14:09:33 +01:00
(svn r17168) -Codechange: apply coding style to if and while statements
This commit is contained in:
parent
3108ff7ac6
commit
c5533ae470
@ -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 */
|
||||
|
@ -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__ */
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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. */
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user