diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index afc43c49..8e4599d9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,6 +76,7 @@ additional guidelines: - I will run a test suite to make sure this is the case. - if something breaks, you might want to add a compatibility flag (this requires changing the format though). - do not use `#pragma once`. +- do not memcmp() structs. - on a switch block, **always** put `default` last and not in any other position. - I have fear of some C/C++ compilers ignoring the rest of cases upon hitting default. diff --git a/src/engine/instrument.cpp b/src/engine/instrument.cpp index 8cda5917..2c792df0 100644 --- a/src/engine/instrument.cpp +++ b/src/engine/instrument.cpp @@ -60,6 +60,10 @@ void DivInstrument::putInsData2(SafeWriter* w, bool fui) { bool featureSU=false; bool featureES=false; + // almost 40 years of C++, and there still isn't a way to easily compare two structs. + // even Java, which many regard as having a slow runtime, has .equals(). + + blockEndSeek=w->tell(); if (!fui) { w->seek(blockStartSeek,SEEK_SET);