From dbe694f7c8d91ccdb2d505a9cee51593e06e38a8 Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 3 Jan 2017 20:39:15 +0000 Subject: [PATCH] Remove all usages of Uint types --- src/audio/AudioMixer.cpp | 2 +- src/audio/FileAudioSource.cpp | 34 ++++++++++++++++----------------- src/audio/MemoryAudioSource.cpp | 6 +++--- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/audio/AudioMixer.cpp b/src/audio/AudioMixer.cpp index aaf3f223b6..a62da013ec 100644 --- a/src/audio/AudioMixer.cpp +++ b/src/audio/AudioMixer.cpp @@ -357,7 +357,7 @@ private: // Finally mix on to destination buffer size_t dstLength = Math::Min(length, bufferLen); - SDL_MixAudioFormat(data, (const Uint8 *)buffer, _format.format, (Uint32)dstLength, mixVolume); + SDL_MixAudioFormat(data, (const uint8 *)buffer, _format.format, (uint32)dstLength, mixVolume); channel->UpdateOldVolume(); } diff --git a/src/audio/FileAudioSource.cpp b/src/audio/FileAudioSource.cpp index 141f09209a..c1d730b42e 100644 --- a/src/audio/FileAudioSource.cpp +++ b/src/audio/FileAudioSource.cpp @@ -20,12 +20,12 @@ #pragma pack(push, 1) struct WaveFormat { - Uint16 encoding; - Uint16 channels; - Uint32 frequency; - Uint32 byterate; - Uint16 blockalign; - Uint16 bitspersample; + uint16 encoding; + uint16 channels; + uint32 frequency; + uint32 byterate; + uint16 blockalign; + uint16 bitspersample; }; assert_struct_size(WaveFormat, 16); #pragma pack(pop) @@ -82,10 +82,10 @@ public: bool LoadWAV(SDL_RWops * rw) { const uint32 DATA = 0x61746164; - const Uint32 FMT = 0x20746D66; - const Uint32 RIFF = 0x46464952; - const Uint32 WAVE = 0x45564157; - const Uint16 pcmformat = 0x0001; + const uint32 FMT = 0x20746D66; + const uint32 RIFF = 0x46464952; + const uint32 WAVE = 0x45564157; + const uint16 pcmformat = 0x0001; Unload(); @@ -95,7 +95,7 @@ public: } _rw = rw; - Uint32 chunkId = SDL_ReadLE32(rw); + uint32 chunkId = SDL_ReadLE32(rw); if (chunkId != RIFF) { log_verbose("Not a WAV file"); @@ -104,14 +104,14 @@ public: // Read and discard chunk size SDL_ReadLE32(rw); - Uint32 chunkFormat = SDL_ReadLE32(rw); + uint32 chunkFormat = SDL_ReadLE32(rw); if (chunkFormat != WAVE) { log_verbose("Not in WAVE format"); return false; } - Uint32 fmtChunkSize = FindChunk(rw, FMT); + uint32 fmtChunkSize = FindChunk(rw, FMT); if (!fmtChunkSize) { log_verbose("Could not find FMT chunk"); @@ -164,10 +164,10 @@ private: { return subchunkSize; } - const Uint32 FACT = 0x74636166; - const Uint32 LIST = 0x5453494c; - const Uint32 BEXT = 0x74786562; - const Uint32 JUNK = 0x4B4E554A; + const uint32 FACT = 0x74636166; + const uint32 LIST = 0x5453494c; + const uint32 BEXT = 0x74786562; + const uint32 JUNK = 0x4B4E554A; while (subchunkId == FACT || subchunkId == LIST || subchunkId == BEXT || subchunkId == JUNK) { SDL_RWseek(rw, subchunkSize, RW_SEEK_CUR); diff --git a/src/audio/MemoryAudioSource.cpp b/src/audio/MemoryAudioSource.cpp index 7f93faf648..ad358149a5 100644 --- a/src/audio/MemoryAudioSource.cpp +++ b/src/audio/MemoryAudioSource.cpp @@ -83,7 +83,7 @@ public: if (rw != nullptr) { SDL_AudioSpec audiospec = { 0 }; - Uint32 audioLen; + uint32 audioLen; SDL_AudioSpec * spec = SDL_LoadWAV_RW(rw, false, &audiospec, &_data, &audioLen); if (spec != nullptr) { @@ -165,8 +165,8 @@ public: if (SDL_BuildAudioCVT(&cvt, _format.format, _format.channels, _format.freq, format->format, format->channels, format->freq) >= 0) { cvt.len = (int)_length; - cvt.buf = (Uint8*)new uint8[cvt.len * cvt.len_mult]; - memcpy(cvt.buf, _data, _length); + cvt.buf = new uint8[cvt.len * cvt.len_mult]; + Memory::Copy(cvt.buf, _data, _length); if (SDL_ConvertAudio(&cvt) >= 0) { Unload();