diff options
author | Vitaly Novichkov <admin@wohlnet.ru> | 2018-03-25 01:34:37 +0300 |
---|---|---|
committer | Vitaly Novichkov <admin@wohlnet.ru> | 2018-03-25 01:34:37 +0300 |
commit | 04ab4c1bcf65870cbe34b405a181a4246bcd91e8 (patch) | |
tree | d0f725cb7752af7a8564ca12221552574df777fb | |
parent | c4b246410d7b1388045d0a49cb6a6f216858c51c (diff) | |
download | libADLMIDI-04ab4c1bcf65870cbe34b405a181a4246bcd91e8.tar.gz libADLMIDI-04ab4c1bcf65870cbe34b405a181a4246bcd91e8.tar.bz2 libADLMIDI-04ab4c1bcf65870cbe34b405a181a4246bcd91e8.zip |
Fixed the `long` vs `int64_t` conflict in CalculateAdlChannelGoodness
It's a warning came from MSVC
-rw-r--r-- | src/adlmidi_midiplay.cpp | 12 | ||||
-rw-r--r-- | src/adlmidi_private.hpp | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index ea3b1fe..65e7af5 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -2109,9 +2109,9 @@ void MIDIplay::HandleEvent(size_t tk, const MIDIplay::MidiEvent &evt, int &statu } #endif -long MIDIplay::CalculateAdlChannelGoodness(unsigned c, const MIDIchannel::NoteInfo::Phys &ins, uint16_t) const +int64_t MIDIplay::CalculateAdlChannelGoodness(unsigned c, const MIDIchannel::NoteInfo::Phys &ins, uint16_t) const { - long s = -ch[c].koff_time_until_neglible; + int64_t s = -ch[c].koff_time_until_neglible; // Same midi-instrument = some stability //if(c == MidCh) s += 4; @@ -2123,9 +2123,9 @@ long MIDIplay::CalculateAdlChannelGoodness(unsigned c, const MIDIchannel::NoteIn s -= 4000; if(!j->second.sustained) - s -= (long)j->second.kon_time_until_neglible; + s -= j->second.kon_time_until_neglible; else - s -= (long)(j->second.kon_time_until_neglible / 2); + s -= (j->second.kon_time_until_neglible / 2); MIDIchannel::activenotemap_t::const_iterator k = Ch[j->first.MidCh].activenotes.find(j->first.note); @@ -2143,7 +2143,7 @@ long MIDIplay::CalculateAdlChannelGoodness(unsigned c, const MIDIchannel::NoteIn } // Percussion is inferior to melody - s += 50 * (k->second.midiins / 128); + s += 50 * (int64_t)(k->second.midiins / 128); /* if(k->second.midiins >= 25 && k->second.midiins < 40 @@ -2178,7 +2178,7 @@ long MIDIplay::CalculateAdlChannelGoodness(unsigned c, const MIDIchannel::NoteIn } } - s += n_evacuation_stations * 4; + s += (int64_t)n_evacuation_stations * 4; } return s; diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index 8f0c657..8523343 100644 --- a/src/adlmidi_private.hpp +++ b/src/adlmidi_private.hpp @@ -965,7 +965,7 @@ private: // Determine how good a candidate this adlchannel // would be for playing a note from this instrument. - long CalculateAdlChannelGoodness(unsigned c, const MIDIchannel::NoteInfo::Phys &ins, uint16_t /*MidCh*/) const; + int64_t CalculateAdlChannelGoodness(unsigned c, const MIDIchannel::NoteInfo::Phys &ins, uint16_t /*MidCh*/) const; // A new note will be played on this channel using this instrument. // Kill existing notes on this channel (or don't, if we do arpeggio) |