aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/adlmidi.cpp4
-rw-r--r--src/adlmidi_private.hpp2
-rw-r--r--src/chips/dosbox/dbopl.cpp10
-rw-r--r--src/chips/opl_chip_base.h3
4 files changed, 9 insertions, 10 deletions
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp
index 5d7b13b..bf03285 100644
--- a/src/adlmidi.cpp
+++ b/src/adlmidi.cpp
@@ -631,8 +631,8 @@ static void CopySamplesTransformed(ADL_UInt8 *dstLeft, ADL_UInt8 *dstRight, cons
Ret(&transform)(int32_t))
{
for(size_t i = 0; i < frameCount; ++i) {
- *(Dst *)(dstLeft + (i * sampleOffset)) = transform(src[2 * i]);
- *(Dst *)(dstRight + (i * sampleOffset)) = transform(src[(2 * i) + 1]);
+ *(Dst *)(dstLeft + (i * sampleOffset)) = (Dst)transform(src[2 * i]);
+ *(Dst *)(dstRight + (i * sampleOffset)) = (Dst)transform(src[(2 * i) + 1]);
}
}
diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp
index fc54457..9fd6f97 100644
--- a/src/adlmidi_private.hpp
+++ b/src/adlmidi_private.hpp
@@ -168,7 +168,7 @@ inline int32_t adl_cvtU16(int32_t x)
}
inline int32_t adl_cvtU8(int32_t x)
{
- return adl_cvtS8(x) - INT8_MIN;
+ return (adl_cvtS16(x) / 256) - INT8_MIN;
}
inline int32_t adl_cvtU24(int32_t x)
{
diff --git a/src/chips/dosbox/dbopl.cpp b/src/chips/dosbox/dbopl.cpp
index 8834524..3e21772 100644
--- a/src/chips/dosbox/dbopl.cpp
+++ b/src/chips/dosbox/dbopl.cpp
@@ -1875,8 +1875,8 @@ namespace DBOPL
if(i >= 16)
index += 9;
- Bitu blah = reinterpret_cast<Bitu>(&(chip->chan[ index ]));
- ChanOffsetTable[i] = blah;
+ intptr_t blah = reinterpret_cast<intptr_t>(&(chip->chan[ index ]));
+ ChanOffsetTable[i] = static_cast<Bit16u>(blah);
}
//Same for operators
@@ -1895,9 +1895,9 @@ namespace DBOPL
chNum += 16 - 12;
Bitu opNum = (i % 8) / 3;
- DBOPL::Channel *chan = 0;
- Bitu blah = reinterpret_cast<Bitu>(&(chan->op[opNum]));
- OpOffsetTable[i] = ChanOffsetTable[ chNum ] + blah;
+ DBOPL::Channel *chan = NULL;
+ intptr_t blah = reinterpret_cast<intptr_t>(&(chan->op[opNum]));
+ OpOffsetTable[i] = static_cast<Bit16u>((intptr_t)ChanOffsetTable[ chNum ] + blah);
}
#if 0
diff --git a/src/chips/opl_chip_base.h b/src/chips/opl_chip_base.h
index 75dd903..fb9b9e9 100644
--- a/src/chips/opl_chip_base.h
+++ b/src/chips/opl_chip_base.h
@@ -4,8 +4,7 @@
#include <stdint.h>
#include <stddef.h>
-/* TODO: MSVC: Use MSVC versioing instead of this to detect does it supports those C++11 keywords or not */
-#if __cplusplus <= 199711L
+#if !defined(_MSC_VER) && (__cplusplus <= 199711L)
#define final
#define override
#endif