Commit graph

14 commits

Author SHA1 Message Date
Andres Fernandez de Prado
33dff96a20 This commit contains changes required for MuseScore to compile under MSVC with no warnings.
This commit contains changes required for MuseScore to compile under MSVC with no warnings.

MuseScore is being compiled with the /W4 setting (warning level 4), which is similar to -wall -wextra on clang. This generates lots of warnings on MSVC, mainly for non-standard constructs and for constructs which might be bugs or might lead to bugs.

Most warnings are in the following categories:
- Name hiding: a variable hides a variable with the same name on a larger scope (or a field, or a function parameter). This can easily lead to bugs, and it is a best practice to avoid hiding variable names (see recommendation ES.12 in the C++ Core Guidelines by Stroustrop & Sutter (http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-reuse : ES.12: Do not reuse names in nested scopes)
- Narrowing conversion: a numeric conversion results in loss of significant digits (for example, double -> float). The general recommendation is to use a cast to indicate this is designed behaviour.
- Unreachable code: in several instances, there is unreachable code. The unreachable code is commented out.
- (Potentially) uninitialized local variable. Just initialized the vars.
- foreach(,) -> for(:): this does not generate a warning per-se (only a few of these generate warnings due to name hiding), but changed in keeping with "MuseScore Coding Rules" (https://musescore.org/en/handbook/musescore-coding-rules#Loops), which tells explicitly "Use C++11's "for" instead of Qt's "foreach":" ... "If you happen to be fixing some code and see a "foreach", please change that loop into a "for"."

Most changes are in the categories indicated above. The next listing shows detailed changes for files which are *not* of the aforementioned types.

- all.h: Disable warning C4127 (conditional expression is constant - generated in Qt header file qvector.h)
- awl/aslider.h: unreachable code.
- awl/knob.cpp: name hiding
- awl/mslider.cpp: name hiding
- awl/slider.cpp: name hiding
- bww2mxml/parser.cpp: name hiding
- effects/compressor/compressor.cpp: narrowing conversion
- effects/zita1/zitagui.cpp: name hiding
- fluid/fluid.cpp: foreach replacement. Name hiding.
- fluid/mod.cpp: name hiding.
- fluid/sfont.cpp: foreach replacement. Name hiding. Initialize vars.
- fluid/voice.cpp: Name hiding.
- libmscore/accidental.cpp: Name hiding.
- libmscore/ambitus.cpp: Initialize vars.
- libmscore/barline.cpp: Name hiding. Unreachable code.
- libmscore/beam.cpp: Name hiding.
- libmscore/chordrest.cpp: Unreachable code.
- libmscore/scorefile.cpp: Name hiding.
- manual/genManual.cpp: Name hiding. foreach replacement.
- midi/midifile.cpp: Name hiding. Unreachable code.
- omr/importpdf.cpp: Name hiding. foreach replacement.
- omr/omr.cpp: Name hiding. foreach replacement.
- omr/omrpage.cpp: Name hiding. foreach replacement.
- omr/omrview.cpp: Name hiding. foreach replacement.
- synthesizer/event.cpp: Unreachable code.
- zerberus\channel.cpp: Narrowing conversion.
- zerberus\instrument.cpp: Name hiding.
- zerberus\sfz.cpp: Name hiding.
- zerberus\voice.h: Suppress warning C4201: "nonstandard extension used: nameless struct/union"
- zerberus\zerberus.cpp: Name hiding. Unreferenced parameter.
- zerberus\zerberusgui.cpp: Name hiding.
2018-08-03 09:15:42 +02:00
anatoly-os
ebb5e9c15f fix #271723: implement filters in Zerberus
Implement bpf_2p, brf_2p, lpf_1p and hpf_1p filters.
Make refactoring: extract filter logic to separate class, make voice class simpler and easier. Optimize and fix code in applying filters.
2018-06-07 00:22:23 +02:00
anatoly-os
6c54a9653e Fix start/end loop opcodes size int-> long long
According to sfz documentation, offset, loop start/end are [0, 4Gb] in size
2018-06-01 10:30:24 +02:00
Johannes Wegener
04e80fb4e0 fix #124656: mtests for Zerberus 2016-09-16 19:49:30 +02:00
Johannes Wegener
bab18f071e fix #120066: let zerberus support gain_cc/gain_oncc 2016-08-01 17:37:27 +02:00
Johannes Wegener
0a73b2ff6c fix #117716: stop note on pedal released when sustained during attack 2016-07-09 15:11:19 +02:00
Johannes Wegener
e1cb58a3bf fix #116871: add support for rt_decay 2016-06-30 17:50:20 +02:00
Johannes Wegener
864b62e26d fix #116306: make Trigger::Release work in the right way 2016-06-25 10:38:12 +02:00
Johannes Wegener
4044ae6f79 fix #115996: add sfz1 envelope support to zerberus (ampeg_* opcodes) 2016-06-22 15:12:25 +02:00
Johannes Wegener
393e09b124 fix #114681: add loop support to zerberus 2016-06-22 15:11:03 +02:00
Joachim Schmitz
7043cdaac5 convert "enum class" to "enum class : char"
or "enum class : signed char" or even "enum class: short", whatever/whenever feasible on all exsting "enum class" that don't have it yet, also fixing some signed vs. unadorned char. This
should reduce the memory footprint.
2014-05-23 10:35:15 +02:00
lasconic
8e13e2c7ef fix some compilation warnings 2013-05-22 18:07:56 +02:00
ws
220db94494 reorganize synthesizer; add zita1 reverb 2013-04-03 12:50:21 +02:00
ws
8ffe7531d9 add new sfz sample player: zerberus 2013-03-26 20:00:19 +01:00