Merge pull request #5385 from anatoly-os/clang_warnings_102019

Fix clang warnings
This commit is contained in:
anatoly-os 2019-10-15 10:30:22 +02:00 committed by GitHub
commit 571dcd4539
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 26 additions and 28 deletions

View file

@ -227,7 +227,7 @@ if (NOT MSVC)
endif (NOT MSVC) endif (NOT MSVC)
if (APPLE) if (APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC -stdlib=libc++ -Wno-inconsistent-missing-override") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC -stdlib=libc++ -Wno-inconsistent-missing-override -Wno-deprecated-register")
# This is necessary for genManual to be executed during the build phase, # This is necessary for genManual to be executed during the build phase,
# it needs to be able to get the Qt libs. # it needs to be able to get the Qt libs.
# TODO: is it still needed? genManual is removed. # TODO: is it still needed? genManual is removed.

View file

@ -2056,7 +2056,6 @@ void Beam::write(XmlWriter& xml) const
void Beam::read(XmlReader& e) void Beam::read(XmlReader& e)
{ {
QPointF p1, p2;
qreal _spatium = spatium(); qreal _spatium = spatium();
if (score()->mscVersion() < 301) if (score()->mscVersion() < 301)
_id = e.intAttribute("id"); _id = e.intAttribute("id");

View file

@ -148,7 +148,6 @@ void Bend::layout()
int idx = (_points[pt+1].pitch + 12)/25; int idx = (_points[pt+1].pitch + 12)/25;
const char* l = label[idx]; const char* l = label[idx];
QRectF r;
bb |= fm.boundingRect(QRectF(x2, y2, 0, 0), bb |= fm.boundingRect(QRectF(x2, y2, 0, 0),
Qt::AlignHCenter | Qt::AlignBottom | Qt::TextDontClip, QString(l)); Qt::AlignHCenter | Qt::AlignBottom | Qt::TextDontClip, QString(l));
} }

View file

@ -42,7 +42,6 @@ class Box : public MeasureBase {
qreal _topMargin { 0.0 }; qreal _topMargin { 0.0 };
qreal _bottomMargin { 0.0 }; qreal _bottomMargin { 0.0 };
bool editMode { false }; bool editMode { false };
qreal dragX; // used during drag of hbox
public: public:
Box(Score*); Box(Score*);

View file

@ -26,7 +26,6 @@ class BracketItem final : public ScoreElement {
BracketType _bracketType { BracketType::NO_BRACKET }; BracketType _bracketType { BracketType::NO_BRACKET };
int _column { 0 }; int _column { 0 };
int _bracketSpan { 0 }; int _bracketSpan { 0 };
bool _selected { false };
Staff* _staff { 0 }; Staff* _staff { 0 };
public: public:

View file

@ -39,7 +39,6 @@ enum class NoteEntryMethod : char {
//--------------------------------------------------------- //---------------------------------------------------------
class InputState { class InputState {
Score* _score;
TDuration _duration { TDuration::DurationType::V_INVALID }; // currently duration TDuration _duration { TDuration::DurationType::V_INVALID }; // currently duration
int _drumNote { -1 }; int _drumNote { -1 };
int _track { 0 }; int _track { 0 };
@ -58,8 +57,6 @@ class InputState {
Segment* nextInputPos() const; Segment* nextInputPos() const;
public: public:
InputState(Score* s) : _score(s) {}
ChordRest* cr() const; ChordRest* cr() const;
Fraction tick() const; Fraction tick() const;

View file

@ -244,7 +244,7 @@ void MeasureBaseList::change(MeasureBase* ob, MeasureBase* nb)
//--------------------------------------------------------- //---------------------------------------------------------
Score::Score() Score::Score()
: ScoreElement(this), _is(this), _selection(this), _selectionFilter(this) : ScoreElement(this), _selection(this), _selectionFilter(this)
{ {
Score::validScores.insert(this); Score::validScores.insert(this);
_masterScore = 0; _masterScore = 0;

View file

@ -413,7 +413,7 @@ Element* UndoMacro::selectedElement(const Selection& sel)
} }
UndoMacro::UndoMacro(Score* s) UndoMacro::UndoMacro(Score* s)
: undoInputState(s->inputState()), redoInputState(s), : undoInputState(s->inputState()),
undoSelectedElement(selectedElement(s->selection())), score(s) undoSelectedElement(selectedElement(s->selection())), score(s)
{ {
} }

View file

@ -70,9 +70,11 @@ class PowerTab {
virtual Type type() { virtual Type type() {
return Empty; return Empty;
}; };
virtual ~ptComponent() {}
}; };
struct stRhytmSlash : public ptComponent { struct stRhytmSlash final : public ptComponent {
int position {0}; int position {0};
int duration {0}; int duration {0};
bool triplet{ false }; bool triplet{ false };
@ -82,39 +84,39 @@ class PowerTab {
bool is_rest{ false }; bool is_rest{ false };
}; };
struct ptGuitarIn : public ptComponent { struct ptGuitarIn final : public ptComponent {
int rhytmSlash{ true }; int rhytmSlash{ true };
int staff{ 0 }; int staff{ 0 };
int trackinfo{ 0 }; int trackinfo{ 0 };
int section{ 0 }; int section{ 0 };
int position{ 0 }; int position{ 0 };
Type type() { Type type() override {
return GuitarIn; return GuitarIn;
} }
}; };
struct ptSymbol : public ptComponent { struct ptSymbol final : public ptComponent {
int value{ 0 }; int value{ 0 };
ptSymbol(int val) : value(val) {} ptSymbol(int val) : value(val) {}
Type type() { Type type() override {
return Symbol; return Symbol;
} }
}; };
struct ptBar : public ptComponent { struct ptBar final : public ptComponent {
int measureNo{ 0 }; int measureNo{ 0 };
int repeatClose{ 0 }; int repeatClose{ 0 };
bool repeatStart{ false }; bool repeatStart{ false };
int numerator{ 0 }; int numerator{ 0 };
int denominator{ 0 }; int denominator{ 0 };
Type type() { Type type() override {
return Bar; return Bar;
} }
}; };
std::vector<ptBar*> bars; std::vector<ptBar*> bars;
struct ptNote : public ptComponent { struct ptNote final : public ptComponent {
int value{ 0 }; int value{ 0 };
int str{ 0 }; int str{ 0 };
int bend{0}; int bend{0};
@ -122,12 +124,12 @@ class PowerTab {
bool dead{ false }; bool dead{ false };
bool hammer{ false }; bool hammer{ false };
int slide{ 0 }; int slide{ 0 };
Type type() { Type type() override {
return Note; return Note;
} }
}; };
struct ptChord : public ptComponent { struct ptChord final : public ptComponent {
int key; int key;
int formula; int formula;
int modification; int modification;
@ -136,7 +138,7 @@ class PowerTab {
std::vector<int> frets; std::vector<int> frets;
}; };
struct ptChordText : public ptComponent { struct ptChordText final : public ptComponent {
int position; int position;
int key; int key;
int formula; int formula;
@ -144,7 +146,7 @@ class PowerTab {
int extra; int extra;
}; };
struct ptBeat : public ptComponent { struct ptBeat final : public ptComponent {
int position{ 0 }; int position{ 0 };
int staff{ 0 }; int staff{ 0 };
int voice{ 0 }; int voice{ 0 };
@ -166,12 +168,12 @@ class PowerTab {
std::vector<ptNote> notes; std::vector<ptNote> notes;
ptBeat(int _staff, int _voice) : staff(_staff), voice(_voice) {} ptBeat(int _staff, int _voice) : staff(_staff), voice(_voice) {}
Type type() { Type type() override {
return Beat; return Beat;
} }
}; };
struct ptDirection : public ptComponent { struct ptDirection final : public ptComponent {
enum Direction { enum Direction {
DIRECTION_CODA = 0, DIRECTION_CODA = 0,
DIRECTION_DOUBLE_CODA = 1, DIRECTION_DOUBLE_CODA = 1,
@ -207,7 +209,7 @@ class PowerTab {
ptDirection(int dir, int sym, int rep) : direction((Direction)dir), ptDirection(int dir, int sym, int rep) : direction((Direction)dir),
activeSymbol((ActiveSym)sym), repeat(rep) {} activeSymbol((ActiveSym)sym), repeat(rep) {}
Type type() { Type type() override {
return TDirection; return TDirection;
} }
}; };

View file

@ -44,7 +44,7 @@ void QmlIconView::paint(QPainter* p)
void QmlIconView::setIcon(QVariant v) void QmlIconView::setIcon(QVariant v)
{ {
if (v.canConvert<QIcon>()) if (v.canConvert<QIcon>())
_icon = std::move(v.value<QIcon>()); _icon = v.value<QIcon>();
else if (v.canConvert<QColor>()) { else if (v.canConvert<QColor>()) {
_color = v.value<QColor>(); _color = v.value<QColor>();
_icon = QIcon(); _icon = QIcon();

View file

@ -26,7 +26,9 @@
namespace Ms { namespace Ms {
#ifndef TESTROOT
static constexpr int maxCmdCount = 10; // recursion prevention static constexpr int maxCmdCount = 10; // recursion prevention
#endif
//--------------------------------------------------------- //---------------------------------------------------------
// QmlPluginEngine // QmlPluginEngine

View file

@ -20,8 +20,9 @@ namespace Ms
virtual void checkUpdates() {} virtual void checkUpdates() {}
virtual void checkForUpdatesNow() {} virtual void checkForUpdatesNow() {}
virtual void cleanup() {} virtual void cleanup() {}
virtual ~GeneralAutoUpdater() {}
}; };
} //Ms } //Ms
#endif //__AUTO_UPDATER_H__ #endif //__AUTO_UPDATER_H__

View file

@ -632,7 +632,7 @@ std::unique_ptr<PaletteTree> Workspace::getPaletteTree() const
e.skipCurrentElement(); e.skipCurrentElement();
} }
}); });
return std::move(paletteTree); return paletteTree;
} }
void Workspace::read(XmlReader& e) void Workspace::read(XmlReader& e)