Merge pull request #10711 from Jojo-Schmitz/compiler-warnings

[MU4] Fix compiler warnings
This commit is contained in:
Elnur Ismailzada 2022-03-17 15:09:39 +01:00 committed by GitHub
commit 4167dcad05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 24 deletions

View file

@ -38,7 +38,7 @@ struct DynamicTransition {
}
};
static mpe::dynamic_level_t dynamicLevelFromType(const Ms::DynamicType type,
inline mpe::dynamic_level_t dynamicLevelFromType(const Ms::DynamicType type,
const mpe::dynamic_level_t defLevel = mpe::dynamicLevelFromType(mpe::DynamicType::Natural))
{
static const std::unordered_map<Ms::DynamicType, mpe::dynamic_level_t> DYNAMIC_LEVELS = {
@ -75,7 +75,7 @@ static mpe::dynamic_level_t dynamicLevelFromType(const Ms::DynamicType type,
return defLevel;
}
static mpe::dynamic_level_t dynamicLevelRangeByTypes(const Ms::DynamicType dynamicTypeFrom, const Ms::DynamicType dynamicTypeTo,
inline mpe::dynamic_level_t dynamicLevelRangeByTypes(const Ms::DynamicType dynamicTypeFrom, const Ms::DynamicType dynamicTypeTo,
const mpe::dynamic_level_t nominalDynamicLevelFrom,
const mpe::dynamic_level_t nominalDynamicLevelTo, const bool isCrescendo)
{
@ -98,7 +98,7 @@ static mpe::dynamic_level_t dynamicLevelRangeByTypes(const Ms::DynamicType dynam
return dynamicLevelTo - dynamicLevelFrom;
}
static bool isOrdinaryDynamicType(const Ms::DynamicType type)
inline bool isOrdinaryDynamicType(const Ms::DynamicType type)
{
static const std::set<Ms::DynamicType> ORDINARY_DYNAMIC_TYPES = {
Ms::DynamicType::PPPPPP,
@ -120,7 +120,7 @@ static bool isOrdinaryDynamicType(const Ms::DynamicType type)
return ORDINARY_DYNAMIC_TYPES.find(type) != ORDINARY_DYNAMIC_TYPES.cend();
}
static bool isSingleNoteDynamicType(const Ms::DynamicType type)
inline bool isSingleNoteDynamicType(const Ms::DynamicType type)
{
static const std::set<Ms::DynamicType> SINGLE_NOTE_DYNAMIC_TYPES = {
Ms::DynamicType::SF,
@ -133,7 +133,7 @@ static bool isSingleNoteDynamicType(const Ms::DynamicType type)
return SINGLE_NOTE_DYNAMIC_TYPES.find(type) != SINGLE_NOTE_DYNAMIC_TYPES.cend();
}
static const DynamicTransition& dynamicTransitionFromType(const Ms::DynamicType type)
inline const DynamicTransition& dynamicTransitionFromType(const Ms::DynamicType type)
{
static const std::unordered_map<Ms::DynamicType, DynamicTransition> DYNAMIC_TRANSITIONS = {
{ Ms::DynamicType::FP, { Ms::DynamicType::F, Ms::DynamicType::P } },
@ -151,7 +151,7 @@ static const DynamicTransition& dynamicTransitionFromType(const Ms::DynamicType
return empty;
}
static mpe::ArticulationType articulationFromPlayTechType(const Ms::PlayingTechniqueType technique)
inline mpe::ArticulationType articulationFromPlayTechType(const Ms::PlayingTechniqueType technique)
{
static const std::unordered_map<Ms::PlayingTechniqueType, mpe::ArticulationType> PLAYING_TECH_TYPES = {
{ Ms::PlayingTechniqueType::Undefined, mpe::ArticulationType::Undefined },

View file

@ -144,6 +144,7 @@ public:
return QEvent(QEvent::None);
}
void notExpectDispatchEventOnFocus() {}
void checkDispatchEventOnFocus(const QEvent&) {}
#endif

View file

@ -85,14 +85,14 @@ protected:
updateBoundaries();
}
EventsMapIteratorList findEventsRange(const msecs_t from, const msecs_t to) const
EventsMapIteratorList findEventsRange(const msecs_t rangeFrom, const msecs_t rangeTo) const
{
if (m_events.empty()) {
static EventsMapIteratorList empty;
return empty;
}
auto firstNotLess = m_events.lower_bound(from);
auto firstNotLess = m_events.lower_bound(rangeFrom);
if (firstNotLess == m_events.begin()) {
return { firstNotLess };
@ -100,7 +100,7 @@ protected:
auto firstLess = std::prev(firstNotLess);
if (firstNotLess->first > to || firstNotLess == m_events.cend()) {
if (firstNotLess->first > rangeTo || firstNotLess == m_events.cend()) {
return { firstLess };
}

View file

@ -127,8 +127,6 @@ private:
std::unordered_map<midi::channel_t, midi::Program> m_channels;
ArticulationMapping m_articulationMapping;
bool m_isLoggingSynthEvents = false;
async::Channel<unsigned int> m_streamsCountChanged;
mutable std::unordered_map<midi::channel_t, ControllersModeContext> m_controllersModeMap;

View file

@ -682,7 +682,7 @@ static const auto& mappingByCategory(const mpe::SoundCategory category)
}
}
static const midi::Programs& findPrograms(const mpe::PlaybackSetupData& setupData)
inline const midi::Programs& findPrograms(const mpe::PlaybackSetupData& setupData)
{
const std::map<SoundMappingKey, midi::Programs>& mapping = mappingByCategory(setupData.category);
@ -696,7 +696,7 @@ static const midi::Programs& findPrograms(const mpe::PlaybackSetupData& setupDat
return empty;
}
static const ArticulationMapping& articulationSounds(const mpe::PlaybackSetupData& setupData)
inline const ArticulationMapping& articulationSounds(const mpe::PlaybackSetupData& setupData)
{
static ArticulationMapping ELECTRIC_GUITAR = {
{ mpe::ArticulationType::Mute, midi::Program(0, 28) },

View file

@ -240,7 +240,7 @@ Ret Interactive::revealInFileBrowser(const io::path& filePath) const
}
#elif defined(Q_OS_WIN)
QString command = QLatin1String("explorer /select,%1").arg(QDir::toNativeSeparators(filePath.toQString()));
if (QProcess::startDetached(command)) {
if (QProcess::startDetached(command, QStringList())) {
return true;
}
#endif

View file

@ -1986,15 +1986,6 @@ static void addGraceChordsBefore(Chord* c, GraceChordList& gcl)
gcl.clear();
}
//---------------------------------------------------------
// hasTempoTextAtTick
//---------------------------------------------------------
static bool hasTempoTextAtTick(const TempoMap* const tempoMap, const int tick)
{
return tempoMap->count(tick) > 0;
}
//---------------------------------------------------------
// measure
//---------------------------------------------------------

View file

@ -93,12 +93,12 @@ public:
Ms::ElementPtr untranslatedElement;
QString id;
QString name; // used for tool tip
qreal mag { 1.0 };
QString tag;
bool drawStaff { false };
double xoffset { 0.0 }; // in spatium units of "gscore"
double yoffset { 0.0 };
qreal mag { 1.0 };
bool readOnly { false };
bool visible { true };