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

@@ -76,11 +76,11 @@ bool LoadNewGRFSound(SoundEntry *sound)
/* Format: <num> <FF> <FF> <name_len> <name> '\0' <data> */
uint32 num = sound->grf_container_ver >= 2 ? file.ReadDword() : file.ReadWord();
uint32_t num = sound->grf_container_ver >= 2 ? file.ReadDword() : file.ReadWord();
if (file.ReadByte() != 0xFF) return false;
if (file.ReadByte() != 0xFF) return false;
uint8 name_len = file.ReadByte();
uint8_t name_len = file.ReadByte();
std::string name(name_len + 1, '\0');
file.ReadBlock(name.data(), name_len + 1);
@@ -97,7 +97,7 @@ bool LoadNewGRFSound(SoundEntry *sound)
return false;
}
uint32 total_size = file.ReadDword();
uint32_t total_size = file.ReadDword();
uint header_size = 11;
if (sound->grf_container_ver >= 2) header_size++; // The first FF in the sprite is only counted for container version >= 2.
if (total_size + name_len + header_size > num) {
@@ -111,8 +111,8 @@ bool LoadNewGRFSound(SoundEntry *sound)
}
while (total_size >= 8) {
uint32 tag = file.ReadDword();
uint32 size = file.ReadDword();
uint32_t tag = file.ReadDword();
uint32_t size = file.ReadDword();
total_size -= 8;
if (total_size < size) {
Debug(grf, 1, "LoadNewGRFSound [{}]: Invalid RIFF", file.GetSimplifiedFilename());
@@ -189,7 +189,7 @@ bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event, bool force)
if (!_settings_client.sound.vehicle && !force) return true;
const GRFFile *file = v->GetGRF();
uint16 callback;
uint16_t callback;
/* If the engine has no GRF ID associated it can't ever play any new sounds */
if (file == nullptr) return false;