Skip to content

Commit

Permalink
Merge pull request #26311 from Jojo-Schmitz/compiler-warnings
Browse files Browse the repository at this point in the history
Fix MSVC Compiler warnings
  • Loading branch information
cbjeukendrup authored Feb 16, 2025
2 parents 690b0c8 + 00130fc commit dec1cc5
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/braille/internal/notationbraille.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,8 @@ void NotationBraille::setKeys(const QString& sequence)
if (brailleInput()->longSlurStart()) {
if (brailleInput()->longSlurStartNote() == NULL) {
if (currentEngravingItem() != NULL && currentEngravingItem()->isNote()) {
Note* note = toNote(currentEngravingItem());
brailleInput()->setLongSlurStartNote(note);
Note* currentNote = toNote(currentEngravingItem());
brailleInput()->setLongSlurStartNote(currentNote);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/engraving/dom/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1444,8 +1444,8 @@ bool Score::makeGap1(const Fraction& baseTick, staff_idx_t staffIdx, const Fract
continue;
}
Fraction tick = baseTick + Fraction::fromTicks(voiceOffset[track - strack]);
Measure* m = tick2measure(tick);
if ((track % VOICES) && !m->hasVoices(staffIdx)) {
Measure* tm = tick2measure(tick);
if ((track % VOICES) && !tm->hasVoices(staffIdx)) {
continue;
}

Expand Down
8 changes: 4 additions & 4 deletions src/engraving/dom/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3564,10 +3564,10 @@ static Segment* findElementEndSegment(Score* score, EngravingItem* e, Segment* d
cr = toChordRest(e->parentItem());
} else if (e->isChordRest()) {
cr = toChordRest(e);
} else if (EngravingItem* a = e->findAncestor(ElementType::CHORD)) {
cr = toChordRest(a);
} else if (EngravingItem* a = e->findAncestor(ElementType::REST)) {
cr = toChordRest(a);
} else if (EngravingItem* c = e->findAncestor(ElementType::CHORD)) {
cr = toChordRest(c);
} else if (EngravingItem* r = e->findAncestor(ElementType::REST)) {
cr = toChordRest(r);
}

if (cr) {
Expand Down
4 changes: 2 additions & 2 deletions src/engraving/rendering/score/measurelayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1852,9 +1852,9 @@ void MeasureLayout::setCourtesyClef(Measure* m, const Fraction& refClefTick, con
refClefElementTick - refMeasure->tick()) : nullptr;
if (!actualClefSeg && refMeasure && refMeasure->prevMeasure()) {
// Check previous measure
Measure* prevMeasure = refMeasure->prevMeasure();
Measure* refPrevMeasure = refMeasure->prevMeasure();
actualClefSeg
= prevMeasure->findSegmentR(SegmentType::Clef | SegmentType::HeaderClef, refClefElementTick - prevMeasure->tick());
= refPrevMeasure->findSegmentR(SegmentType::Clef | SegmentType::HeaderClef, refClefElementTick - refPrevMeasure->tick());
}
const EngravingItem* el = actualClefSeg ? actualClefSeg->element(track) : nullptr;
const Clef* actualClef = el ? toClef(el) : nullptr;
Expand Down
5 changes: 0 additions & 5 deletions src/engraving/rendering/score/systemlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1415,10 +1415,6 @@ void SystemLayout::layoutSystemElements(System* system, LayoutContext& ctx)
if (!e->isParenthesis() || !e->addToSkyline()) {
continue;
}
EngravingItem* parent = e->parentItem(true);
IF_ASSERT_FAILED(parent && parent->isSegment()) {
continue;
}

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

staff_idx_t si = e->staffIdx();
Segment* s = toSegment(parent);
Measure* m = s->measure();
system->staff(si)->skyline().add(e->shape().translate(e->pos() + s->pos() + m->pos() + e->staffOffset()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ void FluidSequencer::updatePlaybackEvents(EventSequenceMap& destination, const m

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

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

if (muse::contains(BEND_SUPPORTED_TYPES, meta.type)) {
appendPitchBend(destination, noteEvent, meta, channelIdx);
Expand Down
4 changes: 2 additions & 2 deletions src/framework/tours/internal/toursconfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ void ToursConfiguration::setLastShownTourIdForEvent(const String& eventCode, con
String newTourId = eventCode + u"/" + tourId;

for (size_t i = 0; i < allLastShownTours.size(); ++i) {
const String& tourId = allLastShownTours[i];
if (tourId.startsWith(eventCode)) {
const String& lastTourId = allLastShownTours[i];
if (lastTourId.startsWith(eventCode)) {
allLastShownTours[i] = newTourId;
changed = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/framework/tours/view/toursprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void ToursProvider::doShow()
m_openTimer.stop();

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

m_currentStep++;

Expand Down
4 changes: 2 additions & 2 deletions src/inspector/models/measures/measuressettingsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ bool MeasuresSettingsModel::isMakeIntoSystemAvailable() const
return m_isMakeIntoSystemAvailable;
}

int MeasuresSettingsModel::systemCount() const
size_t MeasuresSettingsModel::systemCount() const
{
return m_systemCount;
}
Expand Down Expand Up @@ -213,7 +213,7 @@ void MeasuresSettingsModel::updateIsMakeIntoSystemAvailable()

void MeasuresSettingsModel::updateSystemCount()
{
int count = currentNotation()->elements()->msScore()->selection().selectedSystems().size();
size_t count = currentNotation()->elements()->msScore()->selection().selectedSystems().size();
if (count != m_systemCount) {
m_systemCount = count;
emit systemCountChanged(count);
Expand Down
8 changes: 4 additions & 4 deletions src/inspector/models/measures/measuressettingsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MeasuresSettingsModel : public AbstractInspectorModel
Q_PROPERTY(bool allSystemsAreLocked READ allSystemsAreLocked NOTIFY allSystemsAreLockedChanged)
Q_PROPERTY(bool scoreIsInPageView READ scoreIsInPageView NOTIFY scoreIsInPageViewChanged)
Q_PROPERTY(bool isMakeIntoSystemAvailable READ isMakeIntoSystemAvailable NOTIFY isMakeIntoSystemAvailableChanged)
Q_PROPERTY(int systemCount READ systemCount NOTIFY systemCountChanged)
Q_PROPERTY(size_t systemCount READ systemCount NOTIFY systemCountChanged)

public:
explicit MeasuresSettingsModel(QObject* parent, IElementRepositoryService* repository);
Expand Down Expand Up @@ -79,7 +79,7 @@ class MeasuresSettingsModel : public AbstractInspectorModel
bool scoreIsInPageView() const;
bool isMakeIntoSystemAvailable() const;

int systemCount() const;
size_t systemCount() const;

protected:
void onNotationChanged(const mu::engraving::PropertyIdSet&, const mu::engraving::StyleIdSet&) override;
Expand All @@ -94,13 +94,13 @@ class MeasuresSettingsModel : public AbstractInspectorModel
void allSystemsAreLockedChanged(bool allLocked);
void scoreIsInPageViewChanged(bool isInPageView);
void isMakeIntoSystemAvailableChanged(bool isMakeIntoSystemAvailable);
void systemCountChanged(int count);
void systemCountChanged(size_t count);

private:
bool m_allSystemsAreLocked = false;
bool m_scoreIsInPageView = false;
bool m_isMakeIntoSystemAvailable = false;
int m_systemCount = 0;
size_t m_systemCount = 0;
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/notation/view/notationruler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void NotationRuler::paint(Painter* painter, const NoteInputState& state)
bool currentPositionPainted = false;

for (size_t i = 0; i < lineCount; ++i) {
const int lineTicks = measureTicks + subdivisionTicks * i;
const int lineTicks = measureTicks + subdivisionTicks * static_cast<int>(i);
double lineX = 0.0;

auto it = lineToSegment.find(i);
Expand Down

0 comments on commit dec1cc5

Please sign in to comment.