diff options
Diffstat (limited to 'utils/gen_adldata')
| -rw-r--r-- | utils/gen_adldata/file_formats/load_op2.h | 2 | ||||
| -rw-r--r-- | utils/gen_adldata/gen_adldata.cc | 3 | ||||
| -rw-r--r-- | utils/gen_adldata/progs_cache.cpp | 4 | ||||
| -rw-r--r-- | utils/gen_adldata/progs_cache.h | 15 | 
4 files changed, 15 insertions, 9 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/gen_adldata.cc b/utils/gen_adldata/gen_adldata.cc index 6c77a12..88981c2 100644 --- a/utils/gen_adldata/gen_adldata.cc +++ b/utils/gen_adldata/gen_adldata.cc @@ -4,6 +4,7 @@  #include <cstdio>  #include <string>  #include <cstring> +#include <inttypes.h>  #include "ini/ini_processing.h" @@ -390,7 +391,7 @@ int main(int argc, char**argv)              unsigned flags = (i->first.pseudo4op ? 1 : 0) | (info.nosound ? 2 : 0);              fprintf(outFile, "    {"); -            fprintf(outFile, "%4d,%4d,%3d, %d, %6ld,%6ld,%lf", +            fprintf(outFile, "%4d,%4d,%3d, %d, %6" PRId64 ",%6" PRId64 ",%lf",                      (unsigned) i->first.insno1,                      (unsigned) i->first.insno2,                      (int)(i->first.notenum), diff --git a/utils/gen_adldata/progs_cache.cpp b/utils/gen_adldata/progs_cache.cpp index 4aec9be..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"); +    return InsertIns(tmp1, tmp1, tmp2, "nosound", "");  } diff --git a/utils/gen_adldata/progs_cache.h b/utils/gen_adldata/progs_cache.h index 007c3b4..b0e63a4 100644 --- a/utils/gen_adldata/progs_cache.h +++ b/utils/gen_adldata/progs_cache.h @@ -7,6 +7,7 @@  #include <memory>  #include <cstring>  #include <cstdint> +#include <string>  #include <vector>  struct insdata @@ -16,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; @@ -26,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);      }  }; @@ -79,7 +84,7 @@ extern std::vector<std::string> banknames;  void SetBank(unsigned bank, unsigned patch, size_t insno);  size_t InsertIns(const insdata &id, const insdata &id2, ins &in, -                 const std::string &name, const std::string &name2 = ""); +                 const std::string &name, const std::string &name2);  size_t InsertNoSoundIns();  #endif // PROGS_H  |