summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-09 22:56:28 +0000
committerrubidium <rubidium@openttd.org>2009-01-09 22:56:28 +0000
commitcda853872aa079139f25fc9492bdb73476c213e0 (patch)
tree378bc97d52ab0658bfed8695d1ce2f01bf572802
parentc08f520acf61f85f84e9bdb1dad8172d2c29a48b (diff)
downloadopenttd-cda853872aa079139f25fc9492bdb73476c213e0.tar.xz
(svn r14944) -Cleanup: add spaces around some operators
-rw-r--r--src/ai/default/default.cpp2
-rw-r--r--src/ai/trolly/build.cpp8
-rw-r--r--src/main_gui.cpp2
-rw-r--r--src/misc_gui.cpp4
-rw-r--r--src/network/network.cpp2
-rw-r--r--src/smallmap_gui.cpp10
-rw-r--r--src/vehicle.cpp4
-rw-r--r--src/video/win32_v.cpp8
-rw-r--r--src/viewport.cpp12
-rw-r--r--src/win32.cpp2
10 files changed, 27 insertions, 27 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index 398fc2b6b..4e7fecd25 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -3401,7 +3401,7 @@ static void AiStateAirportStuff(Company *c)
static CommandCost AiDoBuildDefaultAirportBlock(TileIndex tile, const AiDefaultBlockData *p, byte flag)
{
uint32 avail_airports = GetValidAirports();
- CommandCost ret,total_cost(EXPENSES_CONSTRUCTION);
+ CommandCost ret, total_cost(EXPENSES_CONSTRUCTION);
for (; p->mode == 0; p++) {
if (!HasBit(avail_airports, p->attr)) return CMD_ERROR;
diff --git a/src/ai/trolly/build.cpp b/src/ai/trolly/build.cpp
index e1f4b9980..0723386f7 100644
--- a/src/ai/trolly/build.cpp
+++ b/src/ai/trolly/build.cpp
@@ -64,7 +64,7 @@ CommandCost AiNew_Build_Bridge(Company *c, TileIndex tile_a, TileIndex tile_b, b
// Find a good bridgetype (the best money can buy)
bridge_len = GetTunnelBridgeLength(tile_a, tile_b);
type = type2 = 0;
- for (bridge_type = MAX_BRIDGES-1; bridge_type >= 0; bridge_type--) {
+ for (bridge_type = MAX_BRIDGES - 1; bridge_type >= 0; bridge_type--) {
if (CheckBridge_Stuff(bridge_type, bridge_len)) {
type2 = type;
type = bridge_type;
@@ -142,7 +142,7 @@ CommandCost AiNew_Build_RoutePart(Company *c, Ai_PathFinderInfo *PathFinderInfo,
if (route_extra[part - 1] == 0 && route_extra[part] == 0) {
while (route_extra[part] == 0) {
// Get the current direction
- dir = AiNew_GetRailDirection(route[part-1], route[part], route[part+1]);
+ dir = AiNew_GetRailDirection(route[part - 1], route[part], route[part + 1]);
// Is it the same as the last one?
if (old_dir != -1 && old_dir != dir) break;
old_dir = dir;
@@ -191,10 +191,10 @@ CommandCost AiNew_Build_RoutePart(Company *c, Ai_PathFinderInfo *PathFinderInfo,
// Keep it doing till we go an other way
// EnsureNoVehicleOnGround makes sure we don't build on a tile where a vehicle is. This way
// it will wait till the vehicle is gone..
- if (route_extra[part-1] == 0 && route_extra[part] == 0 && (flag != DC_EXEC || EnsureNoVehicleOnGround(route[part]))) {
+ if (route_extra[part - 1] == 0 && route_extra[part] == 0 && (flag != DC_EXEC || EnsureNoVehicleOnGround(route[part]))) {
while (route_extra[part] == 0 && (flag != DC_EXEC || EnsureNoVehicleOnGround(route[part]))) {
// Get the current direction
- dir = AiNew_GetRoadDirection(route[part-1], route[part], route[part+1]);
+ dir = AiNew_GetRoadDirection(route[part - 1], route[part], route[part + 1]);
// Is it the same as the last one?
if (old_dir != -1 && old_dir != dir) break;
old_dir = dir;
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 8fc7a4ea0..c2e9255c9 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -180,7 +180,7 @@ void ZoomInOrOutToCursorWindow(bool in, Window *w)
if ((in && vp->zoom == ZOOM_LVL_MIN) || (!in && vp->zoom == ZOOM_LVL_MAX))
return;
- Point pt = GetTileZoomCenterWindow(in,w);
+ Point pt = GetTileZoomCenterWindow(in, w);
if (pt.x != -1) {
ScrollWindowTo(pt.x, pt.y, w, true);
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 47e1bb35e..c0bae65f4 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -575,7 +575,7 @@ void ShowEstimatedCostOrIncome(Money cost, int x, int y)
void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
{
- Point pt = RemapCoords(x,y,z);
+ Point pt = RemapCoords(x, y, z);
StringID msg = STR_0801_COST;
if (cost < 0) {
@@ -588,7 +588,7 @@ void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
void ShowFeederIncomeAnimation(int x, int y, int z, Money cost)
{
- Point pt = RemapCoords(x,y,z);
+ Point pt = RemapCoords(x, y, z);
SetDParam(0, cost);
AddTextEffect(STR_FEEDER, pt.x, pt.y, 0x250, TE_RISING);
diff --git a/src/network/network.cpp b/src/network/network.cpp
index cbd3e2fd2..04a6e4518 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -1036,7 +1036,7 @@ static void NetworkGenerateUniqueId()
{
Md5 checksum;
uint8 digest[16];
- char hex_output[16*2 + 1];
+ char hex_output[16 * 2 + 1];
char coding_string[NETWORK_NAME_LENGTH];
int di;
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 5c993cc2c..324a213d4 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -59,12 +59,12 @@ static const Widget _smallmap_widgets[] = {
static int _smallmap_industry_count;
/** Macro for ordinary entry of LegendAndColor */
-#define MK(a,b) {a, b, INVALID_INDUSTRYTYPE, true, false, false}
+#define MK(a, b) {a, b, INVALID_INDUSTRYTYPE, true, false, false}
/** Macro for end of list marker in arrays of LegendAndColor */
#define MKEND() {0, STR_NULL, INVALID_INDUSTRYTYPE, true, true, false}
/** Macro for break marker in arrays of LegendAndColor.
* It will have valid data, though */
-#define MS(a,b) {a, b, INVALID_INDUSTRYTYPE, true, false, true}
+#define MS(a, b) {a, b, INVALID_INDUSTRYTYPE, true, false, true}
/** Structure for holding relevant data for legends in small map */
struct LegendAndColour {
@@ -144,7 +144,7 @@ static const LegendAndColour _legend_land_owners[] = {
/** Allow room for all industries, plus a terminator entry
* This is required in order to have the indutry slots all filled up */
-static LegendAndColour _legend_from_industries[NUM_INDUSTRYTYPES+1];
+static LegendAndColour _legend_from_industries[NUM_INDUSTRYTYPES + 1];
/* For connecting industry type to position in industries list(small map legend) */
static uint _industry_to_list_pos[NUM_INDUSTRYTYPES];
@@ -583,7 +583,7 @@ public:
{
Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
DrawPixelInfo *old_dpi;
- int dx,dy, x, y, x2, y2;
+ int dx, dy, x, y, x2, y2;
void *ptr;
int tile_x;
int tile_y;
@@ -755,7 +755,7 @@ public:
Point pt;
/* Find main viewport. */
- vp = FindWindowById(WC_MAIN_WINDOW,0)->viewport;
+ vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport;
pt = RemapCoords(this->scroll_x, this->scroll_y, 0);
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index ec20909f1..d84be5218 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -860,7 +860,7 @@ Vehicle *CheckClickOnVehicle(const ViewPort *vp, int x, int y)
y = ScaleByZoom(y, vp->zoom) + vp->virtual_top;
FOR_ALL_VEHICLES(v) {
- if ((v->vehstatus & (VS_HIDDEN|VS_UNCLICKABLE)) == 0 &&
+ if ((v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) == 0 &&
x >= v->left_coord && x <= v->right_coord &&
y >= v->top_coord && y <= v->bottom_coord) {
@@ -958,7 +958,7 @@ void AgeVehicle(Vehicle *v)
if (v->age < 65535) v->age++;
int age = v->age - v->max_age;
- if (age == 366*0 || age == 366*1 || age == 366*2 || age == 366*3 || age == 366*4) v->reliability_spd_dec <<= 1;
+ if (age == 366 * 0 || age == 366 * 1 || age == 366 * 2 || age == 366 * 3 || age == 366 * 4) v->reliability_spd_dec <<= 1;
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 9016c93e8..5f5f6eb6a 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -88,10 +88,10 @@ struct VkMapping {
static const VkMapping _vk_mapping[] = {
/* Pageup stuff + up/down */
- AM(VK_PRIOR,VK_DOWN, WKC_PAGEUP, WKC_DOWN),
+ AM(VK_PRIOR, VK_DOWN, WKC_PAGEUP, WKC_DOWN),
/* Map letters & digits */
- AM('A','Z','A','Z'),
- AM('0','9','0','9'),
+ AM('A', 'Z', 'A', 'Z'),
+ AM('0', '9', '0', '9'),
AS(VK_ESCAPE, WKC_ESC),
AS(VK_PAUSE, WKC_PAUSE),
@@ -169,7 +169,7 @@ static void ClientSizeChanged(int w, int h)
// It allows you to redraw the screen from within the MSVC debugger
int RedrawScreenDebug()
{
- HDC dc,dc2;
+ HDC dc, dc2;
static int _fooctr;
HBITMAP old_bmp;
HPALETTE old_palette;
diff --git a/src/viewport.cpp b/src/viewport.cpp
index 4572665e4..a20d55386 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -270,14 +270,14 @@ static void DoSetViewportPosition(const Window *w, int left, int top, int width,
left += xo;
width -= xo;
} else if (xo < 0) {
- RedrawScreenRect(left+width+xo, top, left+width, top + height);
+ RedrawScreenRect(left + width + xo, top, left + width, top + height);
width += xo;
}
if (yo > 0) {
- RedrawScreenRect(left, top, width+left, top + yo);
+ RedrawScreenRect(left, top, width + left, top + yo);
} else if (yo < 0) {
- RedrawScreenRect(left, top + height + yo, width+left, top + height);
+ RedrawScreenRect(left, top + height + yo, width + left, top + height);
}
}
}
@@ -364,7 +364,7 @@ ViewPort *IsPtInWindowViewport(const Window *w, int x, int y)
static Point TranslateXYToTileCoord(const ViewPort *vp, int x, int y)
{
Point pt;
- int a,b;
+ int a, b;
uint z;
if ( (uint)(x -= vp->left) >= (uint)vp->width ||
@@ -376,8 +376,8 @@ static Point TranslateXYToTileCoord(const ViewPort *vp, int x, int y)
x = (ScaleByZoom(x, vp->zoom) + vp->virtual_left) >> 2;
y = (ScaleByZoom(y, vp->zoom) + vp->virtual_top) >> 1;
- a = y-x;
- b = y+x;
+ a = y - x;
+ b = y + x;
/* we need to move variables in to the valid range, as the
* GetTileZoomCenterWindow() function can call here with invalid x and/or y,
diff --git a/src/win32.cpp b/src/win32.cpp
index 338253194..76e6c034e 100644
--- a/src/win32.cpp
+++ b/src/win32.cpp
@@ -939,7 +939,7 @@ void ShowInfo(const char *str)
wchar_t help_msgW[8192];
#endif
ReleaseCapture();
- _left_button_clicked =_left_button_down = false;
+ _left_button_clicked = _left_button_down = false;
old = MyShowCursor(true);
if (MessageBox(GetActiveWindow(), MB_TO_WIDE_BUFFER(str, help_msgW, lengthof(help_msgW)), _T("OpenTTD"), MB_ICONINFORMATION | MB_OKCANCEL) == IDCANCEL) {