Skip to content

Commit dec1cc5

Browse files
authored
Merge pull request #26311 from Jojo-Schmitz/compiler-warnings
Fix MSVC Compiler warnings
2 parents 690b0c8 + 00130fc commit dec1cc5

File tree

11 files changed

+22
-27
lines changed

11 files changed

+22
-27
lines changed

src/braille/internal/notationbraille.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,8 @@ void NotationBraille::setKeys(const QString& sequence)
573573
if (brailleInput()->longSlurStart()) {
574574
if (brailleInput()->longSlurStartNote() == NULL) {
575575
if (currentEngravingItem() != NULL && currentEngravingItem()->isNote()) {
576-
Note* note = toNote(currentEngravingItem());
577-
brailleInput()->setLongSlurStartNote(note);
576+
Note* currentNote = toNote(currentEngravingItem());
577+
brailleInput()->setLongSlurStartNote(currentNote);
578578
}
579579
}
580580
}

src/engraving/dom/cmd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,8 +1444,8 @@ bool Score::makeGap1(const Fraction& baseTick, staff_idx_t staffIdx, const Fract
14441444
continue;
14451445
}
14461446
Fraction tick = baseTick + Fraction::fromTicks(voiceOffset[track - strack]);
1447-
Measure* m = tick2measure(tick);
1448-
if ((track % VOICES) && !m->hasVoices(staffIdx)) {
1447+
Measure* tm = tick2measure(tick);
1448+
if ((track % VOICES) && !tm->hasVoices(staffIdx)) {
14491449
continue;
14501450
}
14511451

src/engraving/dom/score.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3564,10 +3564,10 @@ static Segment* findElementEndSegment(Score* score, EngravingItem* e, Segment* d
35643564
cr = toChordRest(e->parentItem());
35653565
} else if (e->isChordRest()) {
35663566
cr = toChordRest(e);
3567-
} else if (EngravingItem* a = e->findAncestor(ElementType::CHORD)) {
3568-
cr = toChordRest(a);
3569-
} else if (EngravingItem* a = e->findAncestor(ElementType::REST)) {
3570-
cr = toChordRest(a);
3567+
} else if (EngravingItem* c = e->findAncestor(ElementType::CHORD)) {
3568+
cr = toChordRest(c);
3569+
} else if (EngravingItem* r = e->findAncestor(ElementType::REST)) {
3570+
cr = toChordRest(r);
35713571
}
35723572

35733573
if (cr) {

src/engraving/rendering/score/measurelayout.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,9 +1852,9 @@ void MeasureLayout::setCourtesyClef(Measure* m, const Fraction& refClefTick, con
18521852
refClefElementTick - refMeasure->tick()) : nullptr;
18531853
if (!actualClefSeg && refMeasure && refMeasure->prevMeasure()) {
18541854
// Check previous measure
1855-
Measure* prevMeasure = refMeasure->prevMeasure();
1855+
Measure* refPrevMeasure = refMeasure->prevMeasure();
18561856
actualClefSeg
1857-
= prevMeasure->findSegmentR(SegmentType::Clef | SegmentType::HeaderClef, refClefElementTick - prevMeasure->tick());
1857+
= refPrevMeasure->findSegmentR(SegmentType::Clef | SegmentType::HeaderClef, refClefElementTick - refPrevMeasure->tick());
18581858
}
18591859
const EngravingItem* el = actualClefSeg ? actualClefSeg->element(track) : nullptr;
18601860
const Clef* actualClef = el ? toClef(el) : nullptr;

src/engraving/rendering/score/systemlayout.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,10 +1415,6 @@ void SystemLayout::layoutSystemElements(System* system, LayoutContext& ctx)
14151415
if (!e->isParenthesis() || !e->addToSkyline()) {
14161416
continue;
14171417
}
1418-
EngravingItem* parent = e->parentItem(true);
1419-
IF_ASSERT_FAILED(parent && parent->isSegment()) {
1420-
continue;
1421-
}
14221418

14231419
if (s->isType(SegmentType::TimeSigType)) {
14241420
TimeSig* ts = toTimeSig(s->element(e->track()));
@@ -1432,7 +1428,6 @@ void SystemLayout::layoutSystemElements(System* system, LayoutContext& ctx)
14321428
}
14331429

14341430
staff_idx_t si = e->staffIdx();
1435-
Segment* s = toSegment(parent);
14361431
Measure* m = s->measure();
14371432
system->staff(si)->skyline().add(e->shape().translate(e->pos() + s->pos() + m->pos() + e->staffOffset()));
14381433
}

src/framework/audio/internal/synthesizers/fluidsynth/fluidsequencer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ void FluidSequencer::updatePlaybackEvents(EventSequenceMap& destination, const m
143143

144144
destination[timestampTo].emplace(std::move(noteOff));
145145

146-
for (const auto& pair : noteEvent.expressionCtx().articulations) {
147-
const mpe::ArticulationMeta& meta = pair.second.meta;
146+
for (const auto& artPair : noteEvent.expressionCtx().articulations) {
147+
const mpe::ArticulationMeta& meta = artPair.second.meta;
148148

149149
if (muse::contains(BEND_SUPPORTED_TYPES, meta.type)) {
150150
appendPitchBend(destination, noteEvent, meta, channelIdx);

src/framework/tours/internal/toursconfiguration.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ void ToursConfiguration::setLastShownTourIdForEvent(const String& eventCode, con
5454
String newTourId = eventCode + u"/" + tourId;
5555

5656
for (size_t i = 0; i < allLastShownTours.size(); ++i) {
57-
const String& tourId = allLastShownTours[i];
58-
if (tourId.startsWith(eventCode)) {
57+
const String& lastTourId = allLastShownTours[i];
58+
if (lastTourId.startsWith(eventCode)) {
5959
allLastShownTours[i] = newTourId;
6060
changed = true;
6161
}

src/framework/tours/view/toursprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void ToursProvider::doShow()
5151
m_openTimer.stop();
5252

5353
const TourStep& step = m_tour.steps[m_currentStep];
54-
int index = m_currentStep + 1;
54+
size_t index = m_currentStep + 1;
5555

5656
m_currentStep++;
5757

src/inspector/models/measures/measuressettingsmodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ bool MeasuresSettingsModel::isMakeIntoSystemAvailable() const
175175
return m_isMakeIntoSystemAvailable;
176176
}
177177

178-
int MeasuresSettingsModel::systemCount() const
178+
size_t MeasuresSettingsModel::systemCount() const
179179
{
180180
return m_systemCount;
181181
}
@@ -213,7 +213,7 @@ void MeasuresSettingsModel::updateIsMakeIntoSystemAvailable()
213213

214214
void MeasuresSettingsModel::updateSystemCount()
215215
{
216-
int count = currentNotation()->elements()->msScore()->selection().selectedSystems().size();
216+
size_t count = currentNotation()->elements()->msScore()->selection().selectedSystems().size();
217217
if (count != m_systemCount) {
218218
m_systemCount = count;
219219
emit systemCountChanged(count);

src/inspector/models/measures/measuressettingsmodel.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class MeasuresSettingsModel : public AbstractInspectorModel
3939
Q_PROPERTY(bool allSystemsAreLocked READ allSystemsAreLocked NOTIFY allSystemsAreLockedChanged)
4040
Q_PROPERTY(bool scoreIsInPageView READ scoreIsInPageView NOTIFY scoreIsInPageViewChanged)
4141
Q_PROPERTY(bool isMakeIntoSystemAvailable READ isMakeIntoSystemAvailable NOTIFY isMakeIntoSystemAvailableChanged)
42-
Q_PROPERTY(int systemCount READ systemCount NOTIFY systemCountChanged)
42+
Q_PROPERTY(size_t systemCount READ systemCount NOTIFY systemCountChanged)
4343

4444
public:
4545
explicit MeasuresSettingsModel(QObject* parent, IElementRepositoryService* repository);
@@ -79,7 +79,7 @@ class MeasuresSettingsModel : public AbstractInspectorModel
7979
bool scoreIsInPageView() const;
8080
bool isMakeIntoSystemAvailable() const;
8181

82-
int systemCount() const;
82+
size_t systemCount() const;
8383

8484
protected:
8585
void onNotationChanged(const mu::engraving::PropertyIdSet&, const mu::engraving::StyleIdSet&) override;
@@ -94,13 +94,13 @@ class MeasuresSettingsModel : public AbstractInspectorModel
9494
void allSystemsAreLockedChanged(bool allLocked);
9595
void scoreIsInPageViewChanged(bool isInPageView);
9696
void isMakeIntoSystemAvailableChanged(bool isMakeIntoSystemAvailable);
97-
void systemCountChanged(int count);
97+
void systemCountChanged(size_t count);
9898

9999
private:
100100
bool m_allSystemsAreLocked = false;
101101
bool m_scoreIsInPageView = false;
102102
bool m_isMakeIntoSystemAvailable = false;
103-
int m_systemCount = 0;
103+
size_t m_systemCount = 0;
104104
};
105105
}
106106

0 commit comments

Comments
 (0)