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:
@@ -75,8 +75,8 @@ static void OpenBankFile(const std::string &filename)
|
||||
|
||||
/* Read riff tags */
|
||||
for (;;) {
|
||||
uint32 tag = original_sound_file->ReadDword();
|
||||
uint32 size = original_sound_file->ReadDword();
|
||||
uint32_t tag = original_sound_file->ReadDword();
|
||||
uint32_t size = original_sound_file->ReadDword();
|
||||
|
||||
if (tag == ' tmf') {
|
||||
original_sound_file->ReadWord(); // wFormatTag
|
||||
@@ -119,7 +119,7 @@ static bool SetBankSource(MixerChannel *mc, const SoundEntry *sound)
|
||||
/* Check for valid sound size. */
|
||||
if (sound->file_size == 0 || sound->file_size > ((size_t)-1) - 2) return false;
|
||||
|
||||
int8 *mem = MallocT<int8>(sound->file_size + 2);
|
||||
int8_t *mem = MallocT<int8_t>(sound->file_size + 2);
|
||||
/* Add two extra bytes so rate conversion can read these
|
||||
* without reading out of its input buffer. */
|
||||
mem[sound->file_size ] = 0;
|
||||
@@ -139,7 +139,7 @@ static bool SetBankSource(MixerChannel *mc, const SoundEntry *sound)
|
||||
#if TTD_ENDIAN == TTD_BIG_ENDIAN
|
||||
if (sound->bits_per_sample == 16) {
|
||||
uint num_samples = sound->file_size / 2;
|
||||
int16 *samples = (int16 *)mem;
|
||||
int16_t *samples = (int16_t *)mem;
|
||||
for (uint i = 0; i < num_samples; i++) {
|
||||
samples[i] = BSWAP16(samples[i]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user