13
0

Fix use of uninitialized variable (Wsometimes-uninitialized)

This commit is contained in:
David Robillard 2021-05-28 12:18:44 -04:00
parent 71a414b4b0
commit cc60b3b8d5

View File

@ -2917,12 +2917,18 @@ Editor::snap_to_marker (samplepos_t presnap, RoundMode direction)
test = after;
} else if (after == max_samplepos) {
test = before;
} else {
if ((direction == RoundUpMaybe || direction == RoundUpAlways)) {
} else {
switch (direction) {
case RoundUpAlways:
case RoundUpMaybe:
test = after;
} else if ((direction == RoundDownMaybe || direction == RoundDownAlways)) {
break;
case RoundDownMaybe:
case RoundDownAlways:
test = before;
} else if (direction == 0) {
break;
case RoundNearest:
default:
if ((presnap - before) < (after - presnap)) {
test = before;
} else {