From: <man...@us...> - 2013-09-09 14:05:08
|
Revision: 2676 http://sourceforge.net/p/modplug/code/2676 Author: manxorist Date: 2013-09-09 14:05:01 +0000 (Mon, 09 Sep 2013) Log Message: ----------- [Ref] Fix some 64bit warnings. Modified Paths: -------------- trunk/OpenMPT/common/mptString.cpp trunk/OpenMPT/soundlib/Dither.cpp Modified: trunk/OpenMPT/common/mptString.cpp =================================================================== --- trunk/OpenMPT/common/mptString.cpp 2013-09-09 13:59:02 UTC (rev 2675) +++ trunk/OpenMPT/common/mptString.cpp 2013-09-09 14:05:01 UTC (rev 2676) @@ -91,7 +91,7 @@ return std::string(); } std::vector<CHAR> encoded_string(required_size); - WideCharToMultiByte(codepage, 0, src.c_str(), -1, &encoded_string[0], encoded_string.size(), nullptr, nullptr); + WideCharToMultiByte(codepage, 0, src.c_str(), -1, &encoded_string[0], required_size, nullptr, nullptr); return &encoded_string[0]; #else // !WIN32 iconv_t conv = iconv_t(); @@ -125,7 +125,7 @@ return std::wstring(); } std::vector<WCHAR> decoded_string(required_size); - MultiByteToWideChar(codepage, 0, src.c_str(), -1, &decoded_string[0], decoded_string.size()); + MultiByteToWideChar(codepage, 0, src.c_str(), -1, &decoded_string[0], required_size); return &decoded_string[0]; #else // !WIN32 iconv_t conv = iconv_t(); Modified: trunk/OpenMPT/soundlib/Dither.cpp =================================================================== --- trunk/OpenMPT/soundlib/Dither.cpp 2013-09-09 13:59:02 UTC (rev 2675) +++ trunk/OpenMPT/soundlib/Dither.cpp 2013-09-09 14:05:01 UTC (rev 2676) @@ -87,8 +87,8 @@ return (int32)b; } -static void C_Dither(int *pBuffer, UINT nSamples, UINT nBits, DitherModPlugState *state) -//-------------------------------------------------------------------------------------- +static void C_Dither(int *pBuffer, std::size_t count, UINT nBits, DitherModPlugState *state) +//------------------------------------------------------------------------------------------ { if(nBits + MIXING_ATTENUATION + 1 >= 32) //if(nBits>16) { @@ -101,7 +101,7 @@ uint32 a = state ? state->rng_a : global_a; uint32 b = state ? state->rng_b : global_b; - while(nSamples--) + while(count--) { *pBuffer += dither_rand(a, b) >> (nBits + MIXING_ATTENUATION + 1); pBuffer++; @@ -112,13 +112,13 @@ } -static void Dither_ModPlug(int *pBuffer, UINT nSamples, UINT nChannels, UINT nBits, DitherModPlugState &state) -//------------------------------------------------------------------------------------------------------------ +static void Dither_ModPlug(int *pBuffer, std::size_t count, std::size_t channels, UINT nBits, DitherModPlugState &state) +//---------------------------------------------------------------------------------------------------------------------- { #ifdef ENABLE_X86 - X86_Dither(pBuffer, nSamples * nChannels, nBits, &state); + X86_Dither(pBuffer, count * channels, nBits, &state); #else // !ENABLE_X86 - C_Dither(pBuffer, nSamples * nChannels, nBits, &state); + C_Dither(pBuffer, count * channels, nBits, &state); #endif // ENABLE_X86 } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |