Permalink
Browse files

changing all assert() to Q_ASSERT()

except for thirdparty/portmidi/
  • Loading branch information...
1 parent 3adc1ea commit 007df373a3640d4a23ab93a11dee0cd3a8627355 @Jojo-Schmitz Jojo-Schmitz committed Mar 4, 2014
Showing with 16 additions and 16 deletions.
  1. +2 −2 libmscore/cmd.cpp
  2. +1 −1 libmscore/score.cpp
  3. +9 −9 mscore/capella.cpp
  4. +3 −3 mscore/capxml.cpp
  5. +1 −1 mstyle/progressbardata.cpp
View
4 libmscore/cmd.cpp
@@ -518,7 +518,7 @@ void Score::setGraceNote(Chord* ch, int pitch, NoteType type, bool /*behind*/, i
Segment* Score::setNoteRest(Segment* segment, int track, NoteVal nval, Fraction sd,
MScore::Direction stemDirection)
{
- assert(segment->segmentType() == Segment::SegChordRest);
+ Q_ASSERT(segment->segmentType() == Segment::SegChordRest);
int tick = segment->tick();
Element* nr = 0;
@@ -634,7 +634,7 @@ Segment* Score::setNoteRest(Segment* segment, int track, NoteVal nval, Fraction
Fraction Score::makeGap(Segment* segment, int track, const Fraction& _sd, Tuplet* tuplet, bool keepChord)
{
- assert(_sd.numerator());
+ Q_ASSERT(_sd.numerator());
Measure* measure = segment->measure();
setLayoutAll(true);
View
2 libmscore/score.cpp
@@ -1044,7 +1044,7 @@ static Segment* getNextValidInputSegment(Segment* s, int track, int voice)
{
if (s == 0)
return 0;
- assert(s->segmentType() == Segment::SegChordRest);
+ Q_ASSERT(s->segmentType() == Segment::SegChordRest);
// Segment* s1 = s;
ChordRest* cr1;
for (Segment* s1 = s; s1; s1 = s1->prev(Segment::SegChordRest)) {
View
18 mscore/capella.cpp
@@ -1152,7 +1152,7 @@ void TransposableObj::read()
variants = cap->readDrawObjectArray();
if (variants.size() != b)
qDebug("variants.size %d, expected %d", variants.size(), b);
- assert(variants.size() == b);
+ Q_ASSERT(variants.size() == b);
/*int nRefNote =*/ cap->readInt();
}
@@ -1228,7 +1228,7 @@ void NotelinesObj::read()
case 1: break; // Einlinienzeile
case 2: break; // Standard (5 Linien)
default: {
- assert(b == 0);
+ Q_ASSERT(b == 0);
char lines[11];
cap->read(lines, 11);
break;
@@ -1540,7 +1540,7 @@ void ChordObj::read()
unsigned char flags = cap->readByte();
beamMode = (flags & 0x01) ? (BEAM_MODE)(cap->readByte()) : AUTO_BEAM;
notationStave = (flags & 0x02) ? cap->readChar() : 0;
- assert(notationStave >= -1 && notationStave <= 1);
+ Q_ASSERT(notationStave >= -1 && notationStave <= 1);
if (flags & 0x04) {
stemDir = cap->readChar();
@@ -1772,7 +1772,7 @@ QColor Capella::readColor()
QColor c;
unsigned char b = readByte();
if (b >= 16) {
- assert(b == 255);
+ Q_ASSERT(b == 255);
int r = readByte();
int g = readByte();
int b = readByte();
@@ -1877,15 +1877,15 @@ void Capella::readStaveLayout(CapStaffLayout* sl, int idx)
uchar iMin = readByte();
Q_UNUSED(iMin);
uchar n = readByte();
- assert (n > 0 and iMin + n <= 128);
+ Q_ASSERT (n > 0 and iMin + n <= 128);
f->read(sl->soundMapIn, n);
curPos += n;
}
if (sl->bSoundMapOut) { // Umleitungstabelle für das Vorspielen
unsigned char iMin = readByte();
Q_UNUSED(iMin);
unsigned char n = readByte();
- assert (n > 0 and iMin + n <= 128);
+ Q_ASSERT (n > 0 and iMin + n <= 128);
f->read(sl->soundMapOut, n);
curPos += n;
}
@@ -1924,7 +1924,7 @@ void Capella::readLayout()
unsigned char b = readByte();
redundantKeys = b & 1;
modernDoubleNote = b & 2;
- assert ((b & 0xFC) == 0); // bits 2...7 reserviert
+ Q_ASSERT((b & 0xFC) == 0); // bits 2...7 reserviert
bSystemSeparators = readByte();
nUnnamed = readInt();
@@ -2070,8 +2070,8 @@ void CapExplicitBarline::read()
unsigned char b = cap->readByte();
_type = b & 0x0f;
_barMode = b >> 4; // 0 = auto, 1 = nur Zeilen, 2 = durchgezogen
- assert (_type <= BAR_REPENDSTART);
- assert (_barMode <= 2);
+ Q_ASSERT(_type <= BAR_REPENDSTART);
+ Q_ASSERT(_barMode <= 2);
qDebug(" Expl.Barline type %d mode %d", _type, _barMode);
}
View
6 mscore/capxml.cpp
@@ -818,14 +818,14 @@ void Capella::readCapxStaveLayout(XmlReader& e, CapStaffLayout* sl, int /*idx*/)
uchar iMin = readByte();
Q_UNUSED(iMin);
uchar n = readByte();
- assert (n > 0 and iMin + n <= 128);
+ Q_ASSERT(n > 0 and iMin + n <= 128);
f->read(sl->soundMapIn, n);
curPos += n;
}
if (sl->bSoundMapOut) { // Umleitungstabelle fr das Vorspielen
unsigned char iMin = readByte();
unsigned char n = readByte();
- assert (n > 0 and iMin + n <= 128);
+ Q_ASSERT(n > 0 and iMin + n <= 128);
f->read(sl->soundMapOut, n);
curPos += n;
}
@@ -1002,7 +1002,7 @@ void Capella::initCapxLayout()
unsigned char b = 0;
redundantKeys = b & 1;
modernDoubleNote = b & 2;
- assert ((b & 0xFC) == 0); // bits 2...7 reserviert
+ Q_ASSERT((b & 0xFC) == 0); // bits 2...7 reserviert
bSystemSeparators = 0;
nUnnamed = 0;
View
2 mstyle/progressbardata.cpp
@@ -40,7 +40,7 @@ ProgressBarData::ProgressBarData( QObject* parent, QWidget* target, int duration
// make sure target is a progressbar and store relevant values
QProgressBar* progress = qobject_cast<QProgressBar*>( target );
- assert( progress );
+ Q_ASSERT( progress );
setStartValue( progress->value() );
setEndValue( progress->value() );

0 comments on commit 007df37

Please sign in to comment.