Codefix: follow coding style

This commit is contained in:
Rubidium 2024-03-22 21:30:44 +01:00 committed by rubidium42
parent 7457f8d0ff
commit e904122441
3 changed files with 10 additions and 10 deletions

View File

@ -269,7 +269,7 @@ std::string TranslateTTDPatchCodes(uint32_t grfid, uint8_t language_id, bool all
continue;
}
} else {
c = (uint8_t)*src++;
c = static_cast<uint8_t>(*src++);
}
if (c == '\0') break;
@ -305,8 +305,8 @@ std::string TranslateTTDPatchCodes(uint32_t grfid, uint8_t language_id, bool all
{
if (src[0] == '\0' || src[1] == '\0') goto string_end;
StringID string;
string = ((uint8_t)* src++);
string |= ((uint8_t)* src++) << 8;
string = static_cast<uint8_t>(*src++);
string |= static_cast<uint8_t>(*src++) << 8;
Utf8Encode(d, SCC_NEWGRF_STRINL);
Utf8Encode(d, MapGRFStringID(grfid, string));
break;
@ -350,8 +350,8 @@ std::string TranslateTTDPatchCodes(uint32_t grfid, uint8_t language_id, bool all
case 0x03:
{
if (src[0] == '\0' || src[1] == '\0') goto string_end;
uint16_t tmp = ((uint8_t)* src++);
tmp |= ((uint8_t)* src++) << 8;
uint16_t tmp = static_cast<uint8_t>(*src++);
tmp |= static_cast<uint8_t>(*src++) << 8;
Utf8Encode(d, SCC_NEWGRF_PUSH_WORD);
Utf8Encode(d, tmp);
break;

View File

@ -94,7 +94,7 @@ void FindStationsAroundSelection()
/* If the current tile is already a station, then it must be the nearest station. */
if (IsTileType(location.tile, MP_STATION) && GetTileOwner(location.tile) == _local_company) {
T* st = T::GetByTile(location.tile);
T *st = T::GetByTile(location.tile);
if (st != nullptr) {
SetViewportCatchmentSpecializedStation<T>(st, true);
return;

View File

@ -244,12 +244,12 @@ inline TropicZone GetTropicZone(Tile tile)
/**
* Get the current animation frame
* @param t the tile
* @pre IsTileType(t, MP_HOUSE) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_INDUSTRY) ||IsTileType(t, MP_STATION)
* @pre IsTileType(t, MP_HOUSE) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_INDUSTRY) || IsTileType(t, MP_STATION)
* @return frame number
*/
inline uint8_t GetAnimationFrame(Tile t)
{
assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_INDUSTRY) ||IsTileType(t, MP_STATION));
assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_INDUSTRY) || IsTileType(t, MP_STATION));
return t.m7();
}
@ -257,11 +257,11 @@ inline uint8_t GetAnimationFrame(Tile t)
* Set a new animation frame
* @param t the tile
* @param frame the new frame number
* @pre IsTileType(t, MP_HOUSE) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_INDUSTRY) ||IsTileType(t, MP_STATION)
* @pre IsTileType(t, MP_HOUSE) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_INDUSTRY) || IsTileType(t, MP_STATION)
*/
inline void SetAnimationFrame(Tile t, uint8_t frame)
{
assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_INDUSTRY) ||IsTileType(t, MP_STATION));
assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_INDUSTRY) || IsTileType(t, MP_STATION));
t.m7() = frame;
}