forked from mirror/OpenTTD
Codefix: follow coding style
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user