diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/adlmidi_midiplay.cpp | 2 | ||||
-rw-r--r-- | src/chips/opl_chip_base.tcc | 4 | ||||
-rw-r--r-- | src/cvt_xmi2mid.hpp | 16 |
3 files changed, 16 insertions, 6 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index f96243e..207a300 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -105,7 +105,7 @@ inline bool isXgPercChannel(uint8_t msb, uint8_t lsb) void MIDIplay::AdlChannel::addAge(int64_t us) { - const int64_t neg = 1000 * static_cast<int64_t>(-0x1FFFFFFFll); + const int64_t neg = 1000 * static_cast<int64_t>(-0x1FFFFFFFl); if(users.empty()) { koff_time_until_neglible_us = std::max(koff_time_until_neglible_us - us, neg); diff --git a/src/chips/opl_chip_base.tcc b/src/chips/opl_chip_base.tcc index a64aa7c..e6d3f6b 100644 --- a/src/chips/opl_chip_base.tcc +++ b/src/chips/opl_chip_base.tcc @@ -236,8 +236,8 @@ void OPLChipBaseT<T>::resampledGenerate(int32_t *output) rsm->out_count = 1; rsm->out_data = f_out; } - output[0] = static_cast<int32_t>(std::lround(f_out[0])); - output[1] = static_cast<int32_t>(std::lround(f_out[1])); + output[0] = static_cast<int32_t>(lround(f_out[0])); + output[1] = static_cast<int32_t>(lround(f_out[1])); } #else template <class T> diff --git a/src/cvt_xmi2mid.hpp b/src/cvt_xmi2mid.hpp index e8d9dbf..435de81 100644 --- a/src/cvt_xmi2mid.hpp +++ b/src/cvt_xmi2mid.hpp @@ -58,11 +58,21 @@ typedef unsigned long uint32_t; #define XMI2MID_MIDI_STATUS_SYSEX 0xF #if 1 -#define XMI2MID_TRACE(...) +static int XMI2MID_TRACE(...) { return 0; } #else #include <stdio.h> -#define XMI2MID_TRACE(fmt, ...) \ - fprintf(stderr, "XMI2MID: " fmt "\n", ## __VA_ARGS__) +#include <stdarg.h> +static int XMI2MID_TRACE(const char *fmt, int n, ...) +{ + int ret; + char ff[50] = ""; + snprintf(ff, 49, "XMI2MID: %s\n", fmt); + va_list args; + va_start(args, n); + ret = vfprintf(stderr, const_cast<const char*>(ff), args); + va_end(args); + return ret; +} #endif typedef struct _xmi2mid_midi_event { |