forked from Archive/PX4-Autopilot
tunes: Fixed unspecified behaviour
This fixes unspecified behaviour due to evaluation order of args. It's up to the compiler whether next_number() or next_dots() is executed first which means that the behaviour is not properly specified.
This commit is contained in:
parent
d3b3de7159
commit
f6cda64f0d
|
@ -290,7 +290,8 @@ Tunes::Status Tunes::get_next_note(unsigned &frequency, unsigned &duration, unsi
|
|||
case 'P': // Pause for a note length.
|
||||
frequency = 0;
|
||||
duration = 0;
|
||||
silence = rest_duration(next_number(), next_dots());
|
||||
note_length = next_number();
|
||||
silence = rest_duration(note_length, next_dots());
|
||||
return Tunes::Status::Continue;
|
||||
|
||||
case 'T': { // Change tempo.
|
||||
|
|
Loading…
Reference in New Issue