Skip to content

Commit

Permalink
fix compiler warnings, seen in MinGW and MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
Jojo-Schmitz committed Dec 9, 2018
1 parent 445f907 commit 9f5b528
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions libmscore/hairpin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ Element* HairpinSegment::drop(EditData& data)
void HairpinSegment::layout()
{
const qreal _spatium = spatium();
const int _track = track();
const int _trck = track();
if (autoplace() && !score()->isPalette()) {
// Try to fit between adjacent dynamics
const System* sys = system();
if (isSingleType() || isBeginType()) {
Segment* start = hairpin()->startSegment();
Dynamic* sd = nullptr;
if (start && start->system() == sys)
sd = toDynamic(start->findAnnotation(ElementType::DYNAMIC, _track, _track));
sd = toDynamic(start->findAnnotation(ElementType::DYNAMIC, _trck, _trck));
if (sd) {
const qreal sdRight = sd->bbox().right() + sd->pos().x()
+ sd->segment()->pos().x() + sd->measure()->pos().x();
Expand All @@ -106,7 +106,7 @@ void HairpinSegment::layout()
if (end && end->tick() < sys->endTick()) {
// checking ticks rather than systems since latter
// systems may be unknown at layout stage.
ed = toDynamic(end->findAnnotation(ElementType::DYNAMIC, _track, _track));
ed = toDynamic(end->findAnnotation(ElementType::DYNAMIC, _trck, _trck));
}
if (ed) {
const qreal edLeft = ed->bbox().left() + ed->pos().x()
Expand Down
12 changes: 6 additions & 6 deletions libmscore/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3258,12 +3258,12 @@ System* Score::collectSystem(LayoutContext& lc)
for (Segment& s : m->segments()) {
if (!s.enabled() || s.isTimeSigType()) // hack: ignore time signatures
continue;
QPointF pos(s.pos() + m->pos());
QPointF p(s.pos() + m->pos());
if (s.segmentType() & (SegmentType::BarLine | SegmentType::EndBarLine | SegmentType::StartRepeatBarLine | SegmentType::BeginBarLine)) {
BarLine* bl = toBarLine(s.element(0));
if (bl) {
qreal w = BarLine::layoutWidth(score(), bl->barLineType());
skyline.add(QRectF(0.0, 0.0, w, spatium() * 4.0).translated(bl->pos() + pos));
skyline.add(QRectF(0.0, 0.0, w, spatium() * 4.0).translated(bl->pos() + p));
}
}
else {
Expand All @@ -3274,7 +3274,7 @@ System* Score::collectSystem(LayoutContext& lc)
continue;
int effectiveTrack = e->vStaffIdx() * VOICES + e->voice();
if (effectiveTrack >= strack && effectiveTrack < etrack)
skyline.add(e->shape().translated(e->pos() + pos));
skyline.add(e->shape().translated(e->pos() + p));
}
}
}
Expand All @@ -3300,9 +3300,9 @@ System* Score::collectSystem(LayoutContext& lc)

if (e->isChord()) {
for (Note* note : toChord(e)->notes()) {
for (Element* e : note->el()) {
if (e->isFingering())
e->layout();
for (Element* el : note->el()) {
if (el->isFingering())
el->layout();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion libmscore/line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ void SLine::layout()
++segmentsNeeded;
}

int segCount = spannerSegments().size();
int segCount = int(spannerSegments().size());

if (segmentsNeeded != segCount) {
fixupSegments(segmentsNeeded, [this]() { return createLineSegment(); });
Expand Down
2 changes: 1 addition & 1 deletion libmscore/spanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ int Spanner::reuseSegments(int number)

void Spanner::fixupSegments(unsigned int targetNumber, std::function<SpannerSegment*()> createSegment)
{
const int diff = targetNumber - segments.size();
const int diff = targetNumber - int(nsegments());
if (diff == 0)
return;
if (diff > 0) {
Expand Down
2 changes: 1 addition & 1 deletion libmscore/spanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class Spanner : public Element {
const SpannerSegment* backSegment() const { return segments.back(); }
SpannerSegment* segmentAt(int n) { return segments[n]; }
const SpannerSegment* segmentAt(int n) const { return segments[n]; }
int nsegments() const { return segments.size(); }
size_t nsegments() const { return segments.size(); }
bool segmentsEmpty() const { return segments.empty(); }
void eraseSpannerSegments();

Expand Down
2 changes: 1 addition & 1 deletion libmscore/style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2156,7 +2156,7 @@ bool MStyle::readTextStyleValCompat(XmlReader& e)
for (auto& fontStyle : styleNamesEndings) {
if (tag.endsWith(fontStyle.first)) {
readFontStyle = fontStyle.second;
typeName = tag.mid(0, tag.length() - strlen(fontStyle.first));
typeName = tag.mid(0, tag.length() - int(strlen(fontStyle.first)));
break;
}
}
Expand Down
14 changes: 7 additions & 7 deletions libmscore/textbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2699,7 +2699,7 @@ bool TextBase::hasCustomFormatting() const

QString TextBase::stripText(bool removeStyle, bool removeSize, bool removeFace) const
{
QString _text;
QString _txt;
bool bold_ = false;
bool italic_ = false;
bool underline_ = false;
Expand All @@ -2721,7 +2721,7 @@ QString TextBase::stripText(bool removeStyle, bool removeSize, bool removeFace)
fmt.setPreedit(false);
fmt.setValign(VerticalAlignment::AlignNormal);

XmlNesting xmlNesting(&_text);
XmlNesting xmlNesting(&_txt);
if (!removeStyle) {
if (bold_)
xmlNesting.pushB();
Expand Down Expand Up @@ -2758,9 +2758,9 @@ QString TextBase::stripText(bool removeStyle, bool removeSize, bool removeFace)
}

if (!removeSize && (format.fontSize() != fmt.fontSize()))
_text += QString("<font size=\"%1\"/>").arg(format.fontSize());
_txt += QString("<font size=\"%1\"/>").arg(format.fontSize());
if (!removeFace && (format.fontFamily() != fmt.fontFamily()))
_text += QString("<font face=\"%1\"/>").arg(TextBase::escape(format.fontFamily()));
_txt += QString("<font face=\"%1\"/>").arg(TextBase::escape(format.fontFamily()));

VerticalAlignment va = format.valign();
VerticalAlignment cva = fmt.valign();
Expand All @@ -2777,15 +2777,15 @@ QString TextBase::stripText(bool removeStyle, bool removeSize, bool removeFace)
break;
}
}
_text += XmlWriter::xmlString(f.text);
_txt += XmlWriter::xmlString(f.text);
fmt = format;
}
if (block.eol())
_text += QChar::LineFeed;
_txt += QChar::LineFeed;
}
while (!xmlNesting.empty())
xmlNesting.popToken();
return _text;
return _txt;
}

//---------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,8 +1132,8 @@ void ScoreView::paint(const QRect& r, QPainter& p)
QPointF pt(system->ipos());
qreal h = system->minBottom() + system->minTop();
p.translate(pt);
QRectF r(0.0, -system->minTop(), system->width(), h);
p.drawRect(r);
QRectF rect(0.0, -system->minTop(), system->width(), h);
p.drawRect(rect);
p.translate(-pt);
}
}
Expand Down

0 comments on commit 9f5b528

Please sign in to comment.