|
From: <sag...@us...> - 2013-05-20 20:17:56
|
Revision: 2157
http://sourceforge.net/p/modplug/code/2157
Author: saga-games
Date: 2013-05-20 20:17:49 +0000 (Mon, 20 May 2013)
Log Message:
-----------
[Ref] Kill a few 64-bit compiler warnings.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/ITTools.cpp
trunk/OpenMPT/soundlib/LOAD_DMF.CPP
trunk/OpenMPT/soundlib/ModChannel.cpp
trunk/OpenMPT/soundlib/SampleIO.cpp
trunk/OpenMPT/soundlib/XMTools.cpp
trunk/OpenMPT/soundlib/load_j2b.cpp
Modified: trunk/OpenMPT/soundlib/ITTools.cpp
===================================================================
--- trunk/OpenMPT/soundlib/ITTools.cpp 2013-05-20 19:39:12 UTC (rev 2156)
+++ trunk/OpenMPT/soundlib/ITTools.cpp 2013-05-20 20:17:49 UTC (rev 2157)
@@ -521,11 +521,11 @@
C5Speed = mptSmp.nC5Speed ? mptSmp.nC5Speed : 8363;
// Size and loops
- length = mptSmp.nLength;
- loopbegin = mptSmp.nLoopStart;
- loopend = mptSmp.nLoopEnd;
- susloopbegin = mptSmp.nSustainStart;
- susloopend = mptSmp.nSustainEnd;
+ length = std::min(mptSmp.nLength, (SmpLength)uint32_max);
+ loopbegin = std::min(mptSmp.nLoopStart, (SmpLength)uint32_max);
+ loopend = std::min(mptSmp.nLoopEnd, (SmpLength)uint32_max);
+ susloopbegin = std::min(mptSmp.nSustainStart, (SmpLength)uint32_max);
+ susloopend = std::min(mptSmp.nSustainEnd, (SmpLength)uint32_max);
// Auto Vibrato settings
static const uint8 autovibxm2it[8] = { 0, 2, 4, 1, 3, 0, 0, 0 }; // OpenMPT VibratoType -> IT Vibrato
Modified: trunk/OpenMPT/soundlib/LOAD_DMF.CPP
===================================================================
--- trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2013-05-20 19:39:12 UTC (rev 2156)
+++ trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2013-05-20 20:17:49 UTC (rev 2157)
@@ -1188,8 +1188,8 @@
}
-int DMFUnpack(LPBYTE psample, const uint8 *ibuf, const uint8 *ibufmax, uint32 maxlen)
-//-----------------------------------------------------------------------------------
+uintptr_t DMFUnpack(LPBYTE psample, const uint8 *ibuf, const uint8 *ibufmax, uint32 maxlen)
+//-----------------------------------------------------------------------------------------
{
DMFHTree tree;
Modified: trunk/OpenMPT/soundlib/ModChannel.cpp
===================================================================
--- trunk/OpenMPT/soundlib/ModChannel.cpp 2013-05-20 19:39:12 UTC (rev 2156)
+++ trunk/OpenMPT/soundlib/ModChannel.cpp 2013-05-20 20:17:49 UTC (rev 2157)
@@ -39,7 +39,8 @@
if(resetMask & resetSetPosAdvanced)
{
nPeriod = 0;
- nPos = nLength = 0;
+ nPos = 0;
+ nLength = 0;
nLoopStart = 0;
nLoopEnd = 0;
nROfs = nLOfs = 0;
Modified: trunk/OpenMPT/soundlib/SampleIO.cpp
===================================================================
--- trunk/OpenMPT/soundlib/SampleIO.cpp 2013-05-20 19:39:12 UTC (rev 2156)
+++ trunk/OpenMPT/soundlib/SampleIO.cpp 2013-05-20 20:17:49 UTC (rev 2157)
@@ -20,7 +20,7 @@
// External decompressors
extern void AMSUnpack(const int8 * const source, size_t sourceSize, void * const dest, const size_t destSize, char packCharacter);
extern uint16 MDLReadBits(uint32 &bitbuf, uint32 &bitnum, const uint8 *(&ibuf), int8 n);
-extern int DMFUnpack(LPBYTE psample, const uint8 *ibuf, const uint8 *ibufmax, uint32 maxlen);
+extern uintptr_t DMFUnpack(LPBYTE psample, const uint8 *ibuf, const uint8 *ibufmax, uint32 maxlen);
#if MPT_COMPILER_GCC
Modified: trunk/OpenMPT/soundlib/XMTools.cpp
===================================================================
--- trunk/OpenMPT/soundlib/XMTools.cpp 2013-05-20 19:39:12 UTC (rev 2156)
+++ trunk/OpenMPT/soundlib/XMTools.cpp 2013-05-20 20:17:49 UTC (rev 2157)
@@ -392,9 +392,9 @@
}
// Sample Length and Loops
- length = mptSmp.nLength;
- loopStart = mptSmp.nLoopStart;
- loopLength = mptSmp.nLoopEnd - mptSmp.nLoopStart;
+ length = std::min(mptSmp.nLength, (SmpLength)uint32_max);
+ loopStart = std::min(mptSmp.nLoopStart, (SmpLength)uint32_max);
+ loopLength = std::min(mptSmp.nLoopEnd - mptSmp.nLoopStart, (SmpLength)uint32_max);
if(mptSmp.uFlags[CHN_16BIT])
{
Modified: trunk/OpenMPT/soundlib/load_j2b.cpp
===================================================================
--- trunk/OpenMPT/soundlib/load_j2b.cpp 2013-05-20 19:39:12 UTC (rev 2156)
+++ trunk/OpenMPT/soundlib/load_j2b.cpp 2013-05-20 20:17:49 UTC (rev 2157)
@@ -993,7 +993,7 @@
|| fileHeader.fileLength != file.GetLength()
|| fileHeader.packedLength != file.BytesLeft()
|| fileHeader.packedLength == 0
- || fileHeader.crc32 != crc32(0, reinterpret_cast<const Bytef *>(file.GetRawData()), file.BytesLeft())
+ || fileHeader.crc32 != crc32(0, reinterpret_cast<const Bytef *>(file.GetRawData()), fileHeader.packedLength)
)
{
return false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|