diff options
author | Wohlstand <admin@wohlnet.ru> | 2017-10-22 04:38:58 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2017-10-22 04:38:58 +0300 |
commit | 9de1ad18d5305f21cb6998bdd88144893d0e121d (patch) | |
tree | a0fa5793da75584bf445e43a8a86839227ee622a /utils | |
parent | 38ab46ec1945bc070e278f91ea8c49de3bba759b (diff) | |
download | libADLMIDI-9de1ad18d5305f21cb6998bdd88144893d0e121d.tar.gz libADLMIDI-9de1ad18d5305f21cb6998bdd88144893d0e121d.tar.bz2 libADLMIDI-9de1ad18d5305f21cb6998bdd88144893d0e121d.zip |
Fix MSVC CMake compilation
TODO: Fix a freaking MSVC's "invalid comparator" assert given by std::map::lower_bound() call
Diffstat (limited to 'utils')
-rw-r--r-- | utils/gen_adldata/file_formats/load_op2.h | 2 | ||||
-rw-r--r-- | utils/gen_adldata/progs_cache.cpp | 2 | ||||
-rw-r--r-- | utils/gen_adldata/progs_cache.h | 12 |
3 files changed, 10 insertions, 6 deletions
diff --git a/utils/gen_adldata/file_formats/load_op2.h b/utils/gen_adldata/file_formats/load_op2.h index 58d6988..1e51563 100644 --- a/utils/gen_adldata/file_formats/load_op2.h +++ b/utils/gen_adldata/file_formats/load_op2.h @@ -86,7 +86,7 @@ static bool LoadDoom(const char *fn, unsigned bank, const char *prefix) Doom_opl_instr &ins = *(Doom_opl_instr *) &data[offset2]; - insdata tmp[2]; + insdata tmp[2] = {InsertNoSoundIns(), InsertNoSoundIns()}; tmp[0].diff = false; tmp[1].diff = true; for(unsigned index = 0; index < 2; ++index) diff --git a/utils/gen_adldata/progs_cache.cpp b/utils/gen_adldata/progs_cache.cpp index 9a12b5c..b51f4f8 100644 --- a/utils/gen_adldata/progs_cache.cpp +++ b/utils/gen_adldata/progs_cache.cpp @@ -100,7 +100,7 @@ size_t InsertIns( size_t InsertNoSoundIns() { // { 0x0F70700,0x0F70710, 0xFF,0xFF, 0x0,+0 }, - insdata tmp1 = { {0x00, 0x10, 0x07, 0x07, 0xF7, 0xF7, 0x00, 0x00, 0xFF, 0xFF, 0x00}, 0, 0 }; + insdata tmp1 = { {0x00, 0x10, 0x07, 0x07, 0xF7, 0xF7, 0x00, 0x00, 0xFF, 0xFF, 0x00}, 0, false}; struct ins tmp2 = { 0, 0, 0, false, 0.0 }; return InsertIns(tmp1, tmp1, tmp2, "nosound", ""); } diff --git a/utils/gen_adldata/progs_cache.h b/utils/gen_adldata/progs_cache.h index 9918e82..b0e63a4 100644 --- a/utils/gen_adldata/progs_cache.h +++ b/utils/gen_adldata/progs_cache.h @@ -17,9 +17,13 @@ struct insdata bool diff; bool operator==(const insdata &b) const { - return std::memcmp(data, b.data, 11) == 0 && finetune == b.finetune && diff == b.diff; + return (std::memcmp(data, b.data, 11) == 0) && (finetune == b.finetune) && (diff == b.diff); } - bool operator< (const insdata &b) const + bool operator!=(const insdata &b) const + { + return !operator==(b); + } + bool operator<(const insdata &b) const { int c = std::memcmp(data, b.data, 11); if(c != 0) return c < 0; @@ -27,9 +31,9 @@ struct insdata if(diff != b.diff) return (!diff) == (b.diff); return 0; } - bool operator!=(const insdata &b) const + bool operator>(const insdata &b) const { - return !operator==(b); + return !operator<(b) && operator!=(b); } }; |