Skip to content

Commit

Permalink
fix(basetracktablemodel): Fix -Wimplicit-fallthrough warning on GCC…
Browse files Browse the repository at this point in the history
… 14.1.1

Fixes the following warning:

    src/library/basetracktablemodel.cpp: In member function ‘QVariant BaseTrackTableModel::roleValue(const QModelIndex&, QVariant&&, int) const’:
    src/library/basetracktablemodel.cpp:1031:9: error: this statement may fall through [-Werror=implicit-fallthrough=]
     1031 |         switch (field) {
          |         ^~~~~~
    src/library/basetracktablemodel.cpp:1042:5: note: here
     1042 |     default:
          |     ^~~~~~~
    cc1plus: all warnings being treated as errors

This seems to be a false-positive, but this commit should fix the issue
without any changes to the behavior.
  • Loading branch information
Holzhaus committed Jul 23, 2024
1 parent 47f43ec commit 0212654
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/library/basetracktablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,11 +1033,10 @@ QVariant BaseTrackTableModel::roleValue(
// return whether or not to display the color rectangle
return QVariant::fromValue(s_keyColorsEnabled);
}
default: {
default:
DEBUG_ASSERT(!"unexpected field for UserRole");
break;
}
}
break;
}
default:
DEBUG_ASSERT(!"unexpected role");
Expand Down

0 comments on commit 0212654

Please sign in to comment.