aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/adlmidi.cpp21
-rw-r--r--src/adlmidi_private.hpp8
2 files changed, 13 insertions, 16 deletions
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp
index 3b21436..586cb90 100644
--- a/src/adlmidi.cpp
+++ b/src/adlmidi.cpp
@@ -107,13 +107,9 @@ ADLMIDI_EXPORT int adl_setBank(ADL_MIDIPlayer *device, int bank)
MIDIplay *play = reinterpret_cast<MIDIplay *>(device->adl_midiPlayer);
if(static_cast<uint32_t>(bankno) >= NumBanks)
{
- #ifndef __WATCOMC__
- std::stringstream s;
- s << "bank number may only be 0.." << (NumBanks - 1) << ".\n";
- play->setErrorString(s.str());
- #else
- play->setErrorString("Selected embedded bank is not exists!\n");
- #endif
+ char errBuf[150];
+ std::snprintf(errBuf, 150, "Embedded bank number may only be 0..%u!\n", (NumBanks - 1));
+ play->setErrorString(errBuf);
return -1;
}
@@ -142,14 +138,9 @@ ADLMIDI_EXPORT int adl_setNumFourOpsChn(ADL_MIDIPlayer *device, int ops4)
MIDIplay *play = reinterpret_cast<MIDIplay *>(device->adl_midiPlayer);
if((unsigned int)ops4 > 6 * play->m_setup.NumCards)
{
- #ifndef __WATCOMC__
- std::stringstream s;
- s << "number of four-op channels may only be 0.." << (6 * (play->m_setup.NumCards)) << " when " << play->m_setup.NumCards << " OPL3 cards are used.\n";
- play->setErrorString(s.str());
- #else
- play->setErrorString("number of four-op channels may not be more than 6 channels per each OPL3 chip!\n");
- #endif
-
+ char errBuff[250];
+ std::snprintf(errBuff, 250, "number of four-op channels may only be 0..%u when %u OPL3 cards are used.\n", (6 * (play->m_setup.NumCards)), play->m_setup.NumCards);
+ play->setErrorString(errBuff);
return -1;
}
diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp
index 8b2bf19..8f0c657 100644
--- a/src/adlmidi_private.hpp
+++ b/src/adlmidi_private.hpp
@@ -75,7 +75,6 @@ typedef int32_t ssize_t;
#include <vector>
#include <list>
#include <string>
-#include <sstream>
//#ifdef __WATCOMC__
//#include <myset.h> //TODO: Implemnet a workaround for OpenWatcom to fix a crash while using those containers
//#include <mymap.h>
@@ -105,6 +104,13 @@ typedef int32_t ssize_t;
#include <deque>
#include <algorithm>
+#ifdef _MSC_VER
+#pragma warning(disable:4319)
+#pragma warning(disable:4267)
+#pragma warning(disable:4244)
+#pragma warning(disable:4146)
+#endif
+
#include "fraction.hpp"
#ifndef ADLMIDI_HW_OPL