Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MSVC compiler and Visual Studio warnings #25425

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions src/engraving/compat/midi/compatmidirenderinternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,26 +749,23 @@ static void collectNote(EventsHolder& events, const Note* note, const CollectNot
collectBend(stretchedBend->pitchValues(), stretchedBend->staffIdx(), noteChannel, tick1, tick1 + getPlayTicksForBend(
note).ticks(), pitchWheelRenderer, noteEffect);
}
} else if (bendFor) {
collectGuitarBend(note, noteChannel, tick1, noteParams.graceOffsetOn, noteParams.previousChordTicks, pitchWheelRenderer,
noteEffect);
} else {
const GuitarBend* bendFor = note->bendFor();
if (bendFor) {
collectGuitarBend(note, noteChannel, tick1, noteParams.graceOffsetOn, noteParams.previousChordTicks, pitchWheelRenderer,
noteEffect);
} else {
// old bends implementation
for (const EngravingItem* e : note->el()) {
if (!e || (e->type() != ElementType::BEND)) {
continue;
}

const Bend* bend = toBend(e);
if (!bend->playBend()) {
break;
}
// old bends implementation
for (const EngravingItem* e : note->el()) {
if (!e || (e->type() != ElementType::BEND)) {
continue;
}

collectBend(bend->points(), bend->staffIdx(), noteChannel, tick1, tick1 + getPlayTicksForBend(
note).ticks(), pitchWheelRenderer, noteEffect);
const Bend* bend = toBend(e);
if (!bend->playBend()) {
break;
}

collectBend(bend->points(), bend->staffIdx(), noteChannel, tick1, tick1 + getPlayTicksForBend(
note).ticks(), pitchWheelRenderer, noteEffect);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/engraving/dom/segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@ class Segment final : public EngravingItem

bool hasAccidentals() const;

EngravingItem* preAppendedItem(int track) { return m_preAppendedItems[track]; }
void preAppend(EngravingItem* item, int track) { m_preAppendedItems[track] = item; }
void clearPreAppended(int track) { m_preAppendedItems[track] = nullptr; }
EngravingItem* preAppendedItem(track_idx_t track) { return m_preAppendedItems[track]; }
void preAppend(EngravingItem* item, track_idx_t track) { m_preAppendedItems[track] = item; }
void clearPreAppended(track_idx_t track) { m_preAppendedItems[track] = nullptr; }
void addPreAppendedToShape();

bool goesBefore(const Segment* nextSegment) const;
Expand Down
1 change: 0 additions & 1 deletion src/engraving/dom/vibrato.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

#include "score.h"
#include "system.h"
#include "chord.h"
#include "trill.h"

#include "log.h"
Expand Down
2 changes: 0 additions & 2 deletions src/engraving/infrastructure/shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ class Shape
double bottom() const;
double rightMostEdgeAtHeight(double yAbove, double yBelow) const;
double leftMostEdgeAtHeight(double yAbove, double yBelow) const;

double xMostEdgeAtY(const bool isTop, const bool isLeft) const;
double leftMostEdgeAtTop() const;

bool contains(const PointF&) const;
Expand Down
10 changes: 5 additions & 5 deletions src/engraving/rendering/score/chordlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2675,13 +2675,13 @@ void ChordLayout::appendGraceNotes(Chord* chord)
if (!gnb.empty()) {
// If this segment already contains grace notes in the same voice (could happen if a
// previous chord has appended grace-notes-after here) put them in the same vector.
EngravingItem* item = segment->preAppendedItem(static_cast<int>(track));
EngravingItem* item = segment->preAppendedItem(track);
if (item && item->isGraceNotesGroup()) {
GraceNotesGroup* gng = toGraceNotesGroup(item);
gng->insert(gng->end(), gnb.begin(), gnb.end());
} else {
gnb.setAppendedSegment(segment);
segment->preAppend(&gnb, static_cast<int>(track));
segment->preAppend(&gnb, track);
}
}

Expand All @@ -2695,7 +2695,7 @@ void ChordLayout::appendGraceNotes(Chord* chord)
}
if (followingSeg) {
gna.setAppendedSegment(followingSeg);
followingSeg->preAppend(&gna, static_cast<int>(track));
followingSeg->preAppend(&gna, track);
}
}
}
Expand All @@ -2705,8 +2705,8 @@ void ChordLayout::appendGraceNotes(Chord* chord)
* is needed and must be called AFTER horizontal spacing is calculated. */
void ChordLayout::repositionGraceNotesAfter(Segment* segment, size_t tracks)
{
for (size_t track = 0; track < tracks; track++) {
EngravingItem* item = segment->preAppendedItem(static_cast<int>(track));
for (track_idx_t track = 0; track < tracks; track++) {
EngravingItem* item = segment->preAppendedItem(track);
if (!item || !item->isGraceNotesGroup()) {
continue;
}
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 @@ -1005,7 +1005,7 @@ void MeasureLayout::updateGraceNotes(Measure* measure, LayoutContext& ctx)
{
// Clean everything
for (Segment& s : measure->segments()) {
for (unsigned track = 0; track < ctx.dom().ntracks(); ++track) {
for (track_idx_t track = 0; track < ctx.dom().ntracks(); ++track) {
EngravingItem* e = s.preAppendedItem(track);
if (e && e->isGraceNotesGroup()) {
s.clearPreAppended(track);
Expand Down Expand Up @@ -1035,7 +1035,7 @@ void MeasureLayout::updateGraceNotes(Measure* measure, LayoutContext& ctx)

// Layout grace note groups
for (Segment& s : measure->segments()) {
for (unsigned track = 0; track < ctx.dom().ntracks(); ++track) {
for (track_idx_t track = 0; track < ctx.dom().ntracks(); ++track) {
EngravingItem* e = s.preAppendedItem(track);
if (e && e->isGraceNotesGroup()) {
GraceNotesGroup* gng = toGraceNotesGroup(e);
Expand Down
4 changes: 2 additions & 2 deletions src/notation/view/widgets/editstyle.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6049,7 +6049,7 @@
</widget>
</item>
<item row="6" column="0" colspan="7">
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="groupBox_1">
<property name="title">
<string>Number layout</string>
</property>
Expand Down Expand Up @@ -10809,7 +10809,7 @@
</spacer>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="groupBox_21">
<property name="title">
<string>Trill cue note</string>
</property>
Expand Down