(svn r14944) -Cleanup: add spaces around some operators

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 16 years ago
parent c08f520acf
commit cda853872a

@ -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;

@ -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;

@ -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);

@ -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);

@ -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;

@ -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);

@ -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);

@ -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;

@ -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,

@ -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) {

Loading…
Cancel
Save