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

@@ -94,7 +94,7 @@ static void GetCargoSuffix(uint cargo, CargoSuffixType cst, const Industry *ind,
if (HasBit(indspec->callback_mask, CBM_IND_CARGO_SUFFIX)) {
TileIndex t = (cst != CST_FUND) ? ind->location.tile : INVALID_TILE;
uint16 callback = GetIndustryCallback(CBID_INDUSTRY_CARGO_SUFFIX, 0, (cst << 8) | cargo, const_cast<Industry *>(ind), ind_type, t);
uint16_t callback = GetIndustryCallback(CBID_INDUSTRY_CARGO_SUFFIX, 0, (cst << 8) | cargo, const_cast<Industry *>(ind), ind_type, t);
if (callback == CALLBACK_FAILED) return;
if (indspec->grf_prop.grffile->grf_version < 8) {
@@ -248,7 +248,7 @@ void SortIndustryTypes()
* @param tile Tile where the industry is placed.
* @param indtype Industry type.
*/
void CcBuildIndustry(Commands cmd, const CommandCost &result, TileIndex tile, IndustryType indtype, uint32, bool, uint32)
void CcBuildIndustry(Commands cmd, const CommandCost &result, TileIndex tile, IndustryType indtype, uint32_t, bool, uint32_t)
{
if (result.Succeeded()) return;
@@ -531,7 +531,7 @@ public:
icon.top = r.top + (this->resize.step_height - this->legend.height + 1) / 2;
icon.bottom = icon.top + this->legend.height - 1;
for (uint16 i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < this->vscroll->GetCount(); i++) {
for (uint16_t i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < this->vscroll->GetCount(); i++) {
IndustryType type = this->list[i];
bool selected = this->selected_type == type;
const IndustrySpec *indsp = GetIndustrySpec(type);
@@ -579,7 +579,7 @@ public:
/* Get the additional purchase info text, if it has not already been queried. */
if (HasBit(indsp->callback_mask, CBM_IND_FUND_MORE_TEXT)) {
uint16 callback_res = GetIndustryCallback(CBID_INDUSTRY_FUND_MORE_TEXT, 0, 0, nullptr, this->selected_type, INVALID_TILE);
uint16_t callback_res = GetIndustryCallback(CBID_INDUSTRY_FUND_MORE_TEXT, 0, 0, nullptr, this->selected_type, INVALID_TILE);
if (callback_res != CALLBACK_FAILED && callback_res != 0x400) {
if (callback_res > 0x400) {
ErrorUnknownCallbackResult(indsp->grf_prop.grffile->grfid, CBID_INDUSTRY_FUND_MORE_TEXT, callback_res);
@@ -698,8 +698,8 @@ public:
bool success = true;
/* We do not need to protect ourselves against "Random Many Industries" in this mode */
const IndustrySpec *indsp = GetIndustrySpec(this->selected_type);
uint32 seed = InteractiveRandom();
uint32 layout_index = InteractiveRandomRange((uint32)indsp->layouts.size());
uint32_t seed = InteractiveRandom();
uint32_t layout_index = InteractiveRandomRange((uint32_t)indsp->layouts.size());
if (_game_mode == GM_EDITOR) {
/* Show error if no town exists at all */
@@ -954,7 +954,7 @@ public:
/* Get the extra message for the GUI */
if (HasBit(ind->callback_mask, CBM_IND_WINDOW_MORE_TEXT)) {
uint16 callback_res = GetIndustryCallback(CBID_INDUSTRY_WINDOW_MORE_TEXT, 0, 0, i, i->type, i->location.tile);
uint16_t callback_res = GetIndustryCallback(CBID_INDUSTRY_WINDOW_MORE_TEXT, 0, 0, i, i->type, i->location.tile);
if (callback_res != CALLBACK_FAILED && callback_res != 0x400) {
if (callback_res > 0x400) {
ErrorUnknownCallbackResult(ind->grf_prop.grffile->grfid, CBID_INDUSTRY_WINDOW_MORE_TEXT, callback_res);
@@ -1329,7 +1329,7 @@ protected:
StringFilter string_filter; ///< Filter for industries
QueryString industry_editbox; ///< Filter editbox
enum class SorterType : uint8 {
enum class SorterType : uint8_t {
ByName, ///< Sorter type to sort by name
ByType, ///< Sorter type to sort by type
ByProduction, ///< Sorter type to sort by production amount
@@ -1549,7 +1549,7 @@ protected:
/* Get industry productions (CargoID, production, suffix, transported) */
struct CargoInfo {
CargoID cargo_id;
uint16 production;
uint16_t production;
const char *suffix;
uint transported;
};