Codechange: Apply coding style (#8640)

* Fix: Missing or needed spaces

* Codechange: Remove space

* Codechange: Remove space

* Codechange: More missing spaces

* Codechange: Missing spaces

* Codechange: Remove space

* Codechange: Remove space
pull/221/head
SamuXarick 3 years ago committed by GitHub
parent 5b3fe4ae27
commit a4035af337
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1255,7 +1255,7 @@ DEF_CONSOLE_CMD(ConReloadAI)
}
/* First kill the company of the AI, then start a new one. This should start the current AI again */
DoCommandP(0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0,CMD_COMPANY_CTRL);
DoCommandP(0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0, CMD_COMPANY_CTRL);
DoCommandP(0, CCA_NEW_AI | company_id << 16, 0, CMD_COMPANY_CTRL);
IConsolePrint(CC_DEFAULT, "AI reloaded.");
@ -2136,7 +2136,7 @@ static void ConDumpRoadTypes()
grfs.emplace(grfid, grf);
}
IConsolePrintF(CC_DEFAULT, " %02u %s %c%c%c%c, Flags: %c%c%c%c%c, GRF: %08X, %s",
(uint) rt,
(uint)rt,
RoadTypeIsTram(rt) ? "Tram" : "Road",
rti->label >> 24, rti->label >> 16, rti->label >> 8, rti->label,
HasBit(rti->flags, ROTF_CATENARY) ? 'c' : '-',
@ -2174,7 +2174,7 @@ static void ConDumpRailTypes()
grfs.emplace(grfid, grf);
}
IConsolePrintF(CC_DEFAULT, " %02u %c%c%c%c, Flags: %c%c%c%c%c%c, GRF: %08X, %s",
(uint) rt,
(uint)rt,
rti->label >> 24, rti->label >> 16, rti->label >> 8, rti->label,
HasBit(rti->flags, RTF_CATENARY) ? 'c' : '-',
HasBit(rti->flags, RTF_NO_LEVEL_CROSSING) ? 'l' : '-',
@ -2217,7 +2217,7 @@ static void ConDumpCargoTypes()
grfs.emplace(grfid, grf);
}
IConsolePrintF(CC_DEFAULT, " %02u Bit: %2u, Label: %c%c%c%c, Callback mask: 0x%02X, Cargo class: %c%c%c%c%c%c%c%c%c%c%c, GRF: %08X, %s",
(uint) i,
(uint)i,
spec->bitnum,
spec->label >> 24, spec->label >> 16, spec->label >> 8, spec->label,
spec->callback_mask,

@ -1008,7 +1008,7 @@ static void LoadWin32Font(FontSize fs)
if (fontPath[0] != 0) {
if (AddFontResourceEx(fontPath, FR_PRIVATE, 0) != 0) {
/* Try a nice little undocumented function first for getting the internal font name.
* Some documentation is found at: http://www.undocprint.org/winspool/getfontresourceinfo */
* Some documentation is found at: http://www.undocprint.org/winspool/getfontresourceinfo */
typedef BOOL(WINAPI * PFNGETFONTRESOURCEINFO)(LPCTSTR, LPDWORD, LPVOID, DWORD);
#ifdef UNICODE
static PFNGETFONTRESOURCEINFO GetFontResourceInfo = (PFNGETFONTRESOURCEINFO)GetProcAddress(GetModuleHandle(_T("Gdi32")), "GetFontResourceInfoW");

@ -741,9 +741,9 @@ public:
assert(vehgroup.NumVehicles() > 0);
v = vehgroup.vehicles_begin[0];
/*
No VehicleClicked(v) support for now, because don't want
to enable any contextual actions except perhaps clicking/ctrl-clicking to clone orders.
*/
* No VehicleClicked(v) support for now, because don't want
* to enable any contextual actions except perhaps clicking/ctrl-clicking to clone orders.
*/
break;
}

@ -332,7 +332,7 @@ protected:
if (r == 0) r = a->info.use_password - b->info.use_password;
/* Finally sort on the number of clients of the server in reverse order. */
return (r != 0) ? r < 0: !NGameClientSorter(a, b);
return (r != 0) ? r < 0 : !NGameClientSorter(a, b);
}
/** Sort the server list */

@ -4036,7 +4036,7 @@ uint MoveGoodsToStation(CargoID type, uint amount, SourceType source_type, Sourc
first_station = st;
continue;
}
if (used_stations.empty()) {
if (used_stations.empty()) {
used_stations.reserve(2);
used_stations.emplace_back(std::make_pair(first_station, 0));
}
@ -4081,9 +4081,9 @@ uint MoveGoodsToStation(CargoID type, uint amount, SourceType source_type, Sourc
moving += p.second;
}
/* If there is some cargo left due to rounding issues distribute it among the best rated stations. */
/* If there is some cargo left due to rounding issues distribute it among the best rated stations. */
if (amount > moving) {
std::sort(used_stations.begin(), used_stations.end(), [type] (const StationInfo &a, const StationInfo &b) {
std::sort(used_stations.begin(), used_stations.end(), [type](const StationInfo &a, const StationInfo &b) {
return b.first->goods[type].rating < a.first->goods[type].rating;
});

@ -1117,7 +1117,7 @@ static bool GrowTownWithRoad(const Town *t, TileIndex tile, RoadBits rcmd)
* @param road_dir The direction of the road
* @return true if the road can be continued, else false
*/
static bool CanRoadContinueIntoNextTile(const Town* t, const TileIndex tile, const DiagDirection road_dir)
static bool CanRoadContinueIntoNextTile(const Town *t, const TileIndex tile, const DiagDirection road_dir)
{
const int delta = TileOffsByDiagDir(road_dir); // +1 tile in the direction of the road
TileIndex next_tile = tile + delta; // The tile beyond which must be connectable to the target tile
@ -1236,7 +1236,7 @@ static bool GrowTownWithBridge(const Town *t, const TileIndex tile, const DiagDi
* @param tunnel_dir The valid direction in which to grow a tunnel
* @return true if a tunnel has been built, else false
*/
static bool GrowTownWithTunnel(const Town* t, const TileIndex tile, const DiagDirection tunnel_dir)
static bool GrowTownWithTunnel(const Town *t, const TileIndex tile, const DiagDirection tunnel_dir)
{
assert(tunnel_dir < DIAGDIR_END);

@ -762,7 +762,7 @@ static void TileLoop_Trees(TileIndex tile)
break;
case 6: // final stage of tree destruction
if (!CanPlantExtraTrees(tile)) {
if (!CanPlantExtraTrees(tile)) {
/* if trees can't spread just plant a new one to prevent deforestation */
SetTreeGrowth(tile, 0);
} else if (GetTreeCount(tile) > 1) {

@ -1179,7 +1179,7 @@ void ViewportAddVehicles(DrawPixelInfo *dpi)
t <= v->coord.bottom &&
r >= v->coord.left &&
b >= v->coord.top) DoDrawVehicle(v);
}
}
v = v->hash_viewport_next;
}

@ -1575,7 +1575,6 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int
}
case GB_SHARED_ORDERS:
assert(vehgroup.NumVehicles() > 0);
for (int i = 0; i < static_cast<int>(vehgroup.NumVehicles()); ++i) {

@ -524,7 +524,7 @@ static uint ConvertSdlKeycodeIntoMy(SDL_Keycode kc)
}
/* check scancode for BACKQUOTE key, because we want the key left
of "1", not anything else (on non-US keyboards) */
* of "1", not anything else (on non-US keyboards) */
SDL_Scancode sc = SDL_GetScancodeFromKey(kc);
if (sc == SDL_SCANCODE_GRAVE) key = WKC_BACKQUOTE;
@ -542,10 +542,10 @@ int VideoDriver_SDL::PollEvent()
#ifdef __EMSCRIPTEN__
if (_cursor_new_in_window) {
/* The cursor just moved into the window; this means we don't
* know the absolutely position yet to move relative from.
* Before this time, SDL didn't know it either, and this is
* why we postpone it till now. Update the absolute position
* for this once, and work relative after. */
* know the absolutely position yet to move relative from.
* Before this time, SDL didn't know it either, and this is
* why we postpone it till now. Update the absolute position
* for this once, and work relative after. */
_cursor.pos.x = ev.motion.x;
_cursor.pos.y = ev.motion.y;
_cursor.dirty = true;

@ -1527,7 +1527,7 @@ static void ViewportSortParentSprites(ParentSpriteToSortVector *psdv)
sprite_list.sort();
std::vector<ParentSpriteToDraw*> preceding; // Temporarily stores sprites that precede current and their position in the list
std::vector<ParentSpriteToDraw *> preceding; // Temporarily stores sprites that precede current and their position in the list
auto preceding_prev = sprite_list.begin(); // Store iterator in case we need to delete a single preciding sprite
auto out = psdv->begin(); // Iterator to output sorted sprites
@ -1606,7 +1606,7 @@ static void ViewportSortParentSprites(ParentSpriteToSortVector *psdv)
/* Sort all preceding sprites by order and assign new orders in reverse (as original sorter did). */
std::sort(preceding.begin(), preceding.end(), [](const ParentSpriteToDraw *a, const ParentSpriteToDraw *b) {
return a->order > b->order;
return a->order > b->order;
});
s->order = ORDER_COMPARED;

@ -55,7 +55,7 @@ void ViewportSortParentSpritesSSE41(ParentSpriteToSortVector *psdv)
sprite_list.sort();
std::vector<ParentSpriteToDraw*> preceding; // Temporarily stores sprites that precede current and their position in the list
std::vector<ParentSpriteToDraw *> preceding; // Temporarily stores sprites that precede current and their position in the list
auto preceding_prev = sprite_list.begin(); // Store iterator in case we need to delete a single preciding sprite
auto out = psdv->begin(); // Iterator to output sorted sprites
@ -151,7 +151,7 @@ void ViewportSortParentSpritesSSE41(ParentSpriteToSortVector *psdv)
/* Sort all preceding sprites by order and assign new orders in reverse (as original sorter did). */
std::sort(preceding.begin(), preceding.end(), [](const ParentSpriteToDraw *a, const ParentSpriteToDraw *b) {
return a->order > b->order;
return a->order > b->order;
});
s->order = ORDER_COMPARED;

Loading…
Cancel
Save