Codechange: automatic adding of _t to (u)int types, and WChar to char32_t

for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
This commit is contained in:
Rubidium
2023-05-08 19:01:06 +02:00
committed by rubidium42
parent 4f4810dc28
commit eaae0bb5e7
564 changed files with 4561 additions and 4561 deletions

View File

@@ -37,7 +37,7 @@ static int _smallmap_company_count; ///< Number of entries in the owner legend.
static int _smallmap_cargo_count; ///< Number of cargos in the link stats legend.
/** Link stat colours shown in legenda. */
static uint8 _linkstat_colours_in_legenda[] = {0, 1, 3, 5, 7, 9, 11};
static uint8_t _linkstat_colours_in_legenda[] = {0, 1, 3, 5, 7, 9, 11};
static const int NUM_NO_COMPANY_ENTRIES = 4; ///< Number of entries in the owner legend that are not companies.
@@ -256,10 +256,10 @@ static const LegendAndColour * const _legend_table[] = {
/** Colour scheme of the smallmap. */
struct SmallMapColourScheme {
uint32 *height_colours; ///< Cached colours for each level in a map.
const uint32 *height_colours_base; ///< Base table for determining the colours
uint32_t *height_colours; ///< Cached colours for each level in a map.
const uint32_t *height_colours_base; ///< Base table for determining the colours
size_t colour_count; ///< The number of colours.
uint32 default_colour; ///< Default colour of the land.
uint32_t default_colour; ///< Default colour of the land.
};
/** Available colour schemes for height maps. */
@@ -346,11 +346,11 @@ void BuildOwnerLegend()
}
struct AndOr {
uint32 mor;
uint32 mand;
uint32_t mor;
uint32_t mand;
};
static inline uint32 ApplyMask(uint32 colour, const AndOr *mask)
static inline uint32_t ApplyMask(uint32_t colour, const AndOr *mask)
{
return (colour & mask->mand) | mask->mor;
}
@@ -411,7 +411,7 @@ static const byte _tiletype_importance[] = {
* @param t Effective tile type of the tile (see #SmallMapWindow::GetTileColours).
* @return The colour of tile in the small map in mode "Contour"
*/
static inline uint32 GetSmallMapContoursPixels(TileIndex tile, TileType t)
static inline uint32_t GetSmallMapContoursPixels(TileIndex tile, TileType t)
{
const SmallMapColourScheme *cs = &_heightmap_schemes[_settings_client.gui.smallmap_land_colour];
return ApplyMask(cs->height_colours[TileHeight(tile)], &_smallmap_contours_andor[t]);
@@ -424,7 +424,7 @@ static inline uint32 GetSmallMapContoursPixels(TileIndex tile, TileType t)
* @param t Effective tile type of the tile (see #SmallMapWindow::GetTileColours).
* @return The colour of tile in the small map in mode "Vehicles"
*/
static inline uint32 GetSmallMapVehiclesPixels(TileIndex tile, TileType t)
static inline uint32_t GetSmallMapVehiclesPixels(TileIndex tile, TileType t)
{
const SmallMapColourScheme *cs = &_heightmap_schemes[_settings_client.gui.smallmap_land_colour];
return ApplyMask(cs->default_colour, &_smallmap_vehicles_andor[t]);
@@ -437,7 +437,7 @@ static inline uint32 GetSmallMapVehiclesPixels(TileIndex tile, TileType t)
* @param t Effective tile type of the tile (see #SmallMapWindow::GetTileColours).
* @return The colour of tile in the small map in mode "Industries"
*/
static inline uint32 GetSmallMapIndustriesPixels(TileIndex tile, TileType t)
static inline uint32_t GetSmallMapIndustriesPixels(TileIndex tile, TileType t)
{
const SmallMapColourScheme *cs = &_heightmap_schemes[_settings_client.gui.smallmap_land_colour];
return ApplyMask(_smallmap_show_heightmap ? cs->height_colours[TileHeight(tile)] : cs->default_colour, &_smallmap_vehicles_andor[t]);
@@ -450,7 +450,7 @@ static inline uint32 GetSmallMapIndustriesPixels(TileIndex tile, TileType t)
* @param t Effective tile type of the tile (see #SmallMapWindow::GetTileColours).
* @return The colour of tile in the small map in mode "Routes"
*/
static inline uint32 GetSmallMapRoutesPixels(TileIndex tile, TileType t)
static inline uint32_t GetSmallMapRoutesPixels(TileIndex tile, TileType t)
{
switch (t) {
case MP_STATION:
@@ -506,12 +506,12 @@ static inline uint32 GetSmallMapRoutesPixels(TileIndex tile, TileType t)
* @param t Effective tile type of the tile (see #SmallMapWindow::GetTileColours).
* @return The colour of tile in the small map in mode "link stats"
*/
static inline uint32 GetSmallMapLinkStatsPixels(TileIndex tile, TileType t)
static inline uint32_t GetSmallMapLinkStatsPixels(TileIndex tile, TileType t)
{
return _smallmap_show_heightmap ? GetSmallMapContoursPixels(tile, t) : GetSmallMapRoutesPixels(tile, t);
}
static const uint32 _vegetation_clear_bits[] = {
static const uint32_t _vegetation_clear_bits[] = {
MKCOLOUR_XXXX(PC_GRASS_LAND), ///< full grass
MKCOLOUR_XXXX(PC_ROUGH_LAND), ///< rough land
MKCOLOUR_XXXX(PC_GREY), ///< rocks
@@ -529,7 +529,7 @@ static const uint32 _vegetation_clear_bits[] = {
* @param t Effective tile type of the tile (see #SmallMapWindow::GetTileColours).
* @return The colour of tile in the smallmap in mode "Vegetation"
*/
static inline uint32 GetSmallMapVegetationPixels(TileIndex tile, TileType t)
static inline uint32_t GetSmallMapVegetationPixels(TileIndex tile, TileType t)
{
switch (t) {
case MP_CLEAR:
@@ -556,13 +556,13 @@ static inline uint32 GetSmallMapVegetationPixels(TileIndex tile, TileType t)
/**
* Return the colour a tile would be displayed with in the small map in mode "Owner".
*
* @note If include_heightmap is IH_NEVER, the return value can safely be used as a palette colour (by masking it to a uint8)
* @note If include_heightmap is IH_NEVER, the return value can safely be used as a palette colour (by masking it to a uint8_t)
* @param tile The tile of which we would like to get the colour.
* @param t Effective tile type of the tile (see #SmallMapWindow::GetTileColours).
* @param include_heightmap Whether to return the heightmap/contour colour of this tile (instead of the default land tile colour)
* @return The colour of tile in the small map in mode "Owner"
*/
uint32 GetSmallMapOwnerPixels(TileIndex tile, TileType t, IncludeHeightmap include_heightmap)
uint32_t GetSmallMapOwnerPixels(TileIndex tile, TileType t, IncludeHeightmap include_heightmap)
{
Owner o;
@@ -748,7 +748,7 @@ void SmallMapWindow::SetZoomLevel(ZoomLevelChange change, const Point *zoom_pt)
* @param ta Tile area to investigate.
* @return Colours to display.
*/
inline uint32 SmallMapWindow::GetTileColours(const TileArea &ta) const
inline uint32_t SmallMapWindow::GetTileColours(const TileArea &ta) const
{
int importance = 0;
TileIndex tile = INVALID_TILE; // Position of the most important tile.
@@ -861,8 +861,8 @@ void SmallMapWindow::DrawSmallMapColumn(void *dst, uint xc, uint yc, int pitch,
}
ta.ClampToMap(); // Clamp to map boundaries (may contain MP_VOID tiles!).
uint32 val = this->GetTileColours(ta);
uint8 *val8 = (uint8 *)&val;
uint32_t val = this->GetTileColours(ta);
uint8_t *val8 = (uint8_t *)&val;
int idx = std::max(0, -start_pos);
for (int pos = std::max(0, start_pos); pos < end_pos; pos++) {
blitter->SetPixel(dst, idx, 0, val8[idx]);
@@ -1113,7 +1113,7 @@ void SmallMapWindow::RebuildColourIndexIfNecessary()
for (uint n = 0; n < lengthof(_heightmap_schemes); n++) {
/* The heights go from 0 up to and including maximum. */
int heights = _settings_game.construction.map_height_limit + 1;
_heightmap_schemes[n].height_colours = ReallocT<uint32>(_heightmap_schemes[n].height_colours, heights);
_heightmap_schemes[n].height_colours = ReallocT<uint32_t>(_heightmap_schemes[n].height_colours, heights);
for (int z = 0; z < heights; z++) {
size_t access_index = (_heightmap_schemes[n].colour_count * z) / heights;
@@ -1254,7 +1254,7 @@ void SmallMapWindow::RebuildColourIndexIfNecessary()
i = 1;
}
uint8 legend_colour = tbl->colour;
uint8_t legend_colour = tbl->colour;
switch (this->map_type) {
case SMT_INDUSTRY: