Skip to content

Commit 5aff5ac

Browse files
cbjeukendrupmike-spa
authored andcommitted
Merge pull request #29747 from rettinghaus/warning
Unify fallthroughs
1 parent 46e9a2b commit 5aff5ac

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

src/engraving/api/v1/cursor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ void Cursor::add(EngravingItem* wrapped)
363363
s->setParent(curElement);
364364
m_score->undoAddElement(s);
365365
}
366-
} // FALLTHROUGH
366+
[[fallthrough]];
367+
}
367368
case ElementType::FINGERING:
368369
case ElementType::BEND:
369370
case ElementType::NOTEHEAD: {

src/engraving/dom/harmony.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,7 @@ bool Harmony::setProperty(Pid pid, const PropertyValue& v)
15271527
}
15281528
score()->rebuildFretBox();
15291529
}
1530+
break;
15301531
}
15311532
default:
15321533
return TextBase::setProperty(pid, v);

src/engraving/dom/page.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,12 @@ TextBlock Page::replaceTextMacros(const TextBlock& tb) const
394394
if (!m_no) {
395395
break;
396396
}
397-
// FALLTHROUGH
397+
[[fallthrough]];
398398
case 'N': // on page 1 only if there are multiple pages
399399
if ((score()->npages() + score()->pageNumberOffset()) <= 1) {
400400
break;
401401
}
402-
// FALLTHROUGH
402+
[[fallthrough]];
403403
case 'P': // on all pages
404404
{
405405
int no = static_cast<int>(m_no) + 1 + score()->pageNumberOffset();
@@ -426,7 +426,7 @@ TextBlock Page::replaceTextMacros(const TextBlock& tb) const
426426
if (!m_no) {
427427
break;
428428
}
429-
// FALLTHROUGH
429+
[[fallthrough]];
430430
case 'I':
431431
newFragments.back().text += score()->metaTag(u"partName");
432432
break;
@@ -471,7 +471,7 @@ TextBlock Page::replaceTextMacros(const TextBlock& tb) const
471471
if (m_no) {
472472
break;
473473
}
474-
// FALLTHROUGH
474+
[[fallthrough]];
475475
case 'c':
476476
{
477477
const String copyrightString = score()->metaTag(u"copyright");

src/engraving/dom/pitchspelling.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,11 +747,11 @@ void Score::spellNotelist(std::vector<Note*>& notes)
747747
case 3:
748748
k = end - start - 3;
749749
changeAllTpcs(notes[end - 3], tab[(notes[end - 3]->pitch() % 12) * 2 + ((opt & (1 << k)) >> k)]);
750-
// FALLTHROUGH
750+
[[fallthrough]];
751751
case 2:
752752
k = end - start - 2;
753753
changeAllTpcs(notes[end - 2], tab[(notes[end - 2]->pitch() % 12) * 2 + ((opt & (1 << k)) >> k)]);
754-
// FALLTHROUGH
754+
[[fallthrough]];
755755
case 1:
756756
k = end - start - 1;
757757
changeAllTpcs(notes[end - 1], tab[(notes[end - 1]->pitch() % 12) * 2 + ((opt & (1 << k)) >> k)]);

src/engraving/dom/realizedharmony.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const RealizedHarmony::PitchMap RealizedHarmony::generateNotes(int rootTpc, int
124124
if (!m_harmony->parsedForm()->understandable()) {
125125
break;
126126
}
127-
// FALLTHROUGH
127+
[[fallthrough]];
128128
case Voicing::CLOSE: //Voices notes in close position in the first octave above middle C
129129
{
130130
notes.insert({ rootPitch + DEFAULT_OCTAVE * PITCH_DELTA_OCTAVE, rootTpc });
@@ -439,7 +439,7 @@ RealizedHarmony::PitchMap RealizedHarmony::getIntervals(int rootTpc, bool litera
439439
ret.insert({ 9 + RANK_MULT * RANK_ADD, tpcInterval(rootTpc, 13, 0) }); //maj13
440440
omit |= 1 << 13;
441441
}
442-
// FALLTHROUGH
442+
[[fallthrough]];
443443
case 11:
444444
if (!(omit & (1 << 11))) {
445445
if (quality == "minor") {
@@ -449,13 +449,13 @@ RealizedHarmony::PitchMap RealizedHarmony::getIntervals(int rootTpc, bool litera
449449
}
450450
omit |= 1 << 11;
451451
}
452-
// FALLTHROUGH
452+
[[fallthrough]];
453453
case 9:
454454
if (!(omit & (1 << 9))) {
455455
ret.insert({ 2 + RANK_MULT * RANK_9TH, tpcInterval(rootTpc, 9, 0) }); //maj9
456456
omit |= 1 << 9;
457457
}
458-
// FALLTHROUGH
458+
[[fallthrough]];
459459
case 7:
460460
if (!(omit & (1 << 7))) {
461461
if (quality == "major") {

0 commit comments

Comments
 (0)