fix compiler warnings in RELEASE mode under Windows

reg. possible uninitialized use of some variables and some unused
parameters
This commit is contained in:
Joachim Schmitz 2014-12-18 20:41:15 +01:00
parent 86ec8d93c4
commit cdb31d60cb
11 changed files with 19 additions and 12 deletions

View file

@ -2022,7 +2022,7 @@ qreal Score::cautionaryWidth(Measure* m, bool& hasCourtesy)
Segment* ns = nm->findSegment(Segment::Type::TimeSig, tick); Segment* ns = nm->findSegment(Segment::Type::TimeSig, tick);
bool showCourtesy = styleB(StyleIdx::genCourtesyTimesig); bool showCourtesy = styleB(StyleIdx::genCourtesyTimesig);
qreal w; qreal w = 0.0;
if (showCourtesy && ns) { if (showCourtesy && ns) {
TimeSig* ts = static_cast<TimeSig*>(ns->element(0)); TimeSig* ts = static_cast<TimeSig*>(ns->element(0));
if (ts && ts->showCourtesySig()) { if (ts && ts->showCourtesySig()) {
@ -2039,8 +2039,6 @@ qreal Score::cautionaryWidth(Measure* m, bool& hasCourtesy)
} }
} }
} }
else
w = 0.0;
// courtesy key signatures // courtesy key signatures

View file

@ -78,7 +78,7 @@ bool Score::pasteStaff(XmlReader& e, Segment* dst, int dstStaff)
int dstTick = dst->tick(); int dstTick = dst->tick();
bool done = false; bool done = false;
bool pasted = false; bool pasted = false;
int tickLen, staves; int tickLen, staves = 0;
while (e.readNextStartElement()) { while (e.readNextStartElement()) {
if (done) if (done)
break; break;

View file

@ -3066,7 +3066,7 @@ void Score::lassoSelectEnd()
Segment* endSegment = 0; Segment* endSegment = 0;
int startStaff = 0x7fffffff; int startStaff = 0x7fffffff;
int endStaff = 0; int endStaff = 0;
const ChordRest* endCR; const ChordRest* endCR = 0;
if (_selection.elements().isEmpty()) { if (_selection.elements().isEmpty()) {
_selection.setState(SelState::NONE); _selection.setState(SelState::NONE);

View file

@ -612,7 +612,7 @@ qreal Staff::mag() const
SwingParameters Staff::swing(int tick) const SwingParameters Staff::swing(int tick) const
{ {
SwingParameters sp; SwingParameters sp;
int swingUnit; int swingUnit = 0;
QString unit = score()->styleSt(StyleIdx::swingUnit); QString unit = score()->styleSt(StyleIdx::swingUnit);
int swingRatio = score()->styleI(StyleIdx::swingRatio); int swingRatio = score()->styleI(StyleIdx::swingRatio);
if (unit == TDuration(TDuration::DurationType::V_EIGHTH).name()) { if (unit == TDuration(TDuration::DurationType::V_EIGHTH).name()) {

View file

@ -552,7 +552,7 @@ void MuseScore::newFile()
score->fileInfo()->setFile(newWizard->title()); score->fileInfo()->setFile(newWizard->title());
Measure* pm = score->firstMeasure(); Measure* pm = score->firstMeasure();
Measure* nm; Measure* nm = 0;
for (int i = 0; i < measures; ++i) { for (int i = 0; i < measures; ++i) {
if (pm) { if (pm) {
nm = pm; nm = pm;

View file

@ -589,8 +589,8 @@ Fraction GuitarPro6::rhythmToDuration(QString value)
void GuitarPro6::readDrumNote(Note* note, int element, int variation) void GuitarPro6::readDrumNote(Note* note, int element, int variation)
{ {
int octaveInt; int octaveInt = 0;
int toneInt; int toneInt = 0;
/* These numbers below were determined by creating all drum /* These numbers below were determined by creating all drum
* notes in a GPX format file and then analyzing the score.gpif * notes in a GPX format file and then analyzing the score.gpif
* file which specifies the score. */ * file which specifies the score. */

View file

@ -56,7 +56,7 @@ ReducedFraction quantValueToFraction(MidiOperations::QuantValue quantValue)
MidiOperations::QuantValue fractionToQuantValue(const ReducedFraction &fraction) MidiOperations::QuantValue fractionToQuantValue(const ReducedFraction &fraction)
{ {
const auto division = ReducedFraction::fromTicks(MScore::division); const auto division = ReducedFraction::fromTicks(MScore::division);
MidiOperations::QuantValue quantValue; MidiOperations::QuantValue quantValue = MidiOperations::QuantValue::Q_4;
if (fraction == division) if (fraction == division)
quantValue = MidiOperations::QuantValue::Q_4; quantValue = MidiOperations::QuantValue::Q_4;
@ -815,6 +815,9 @@ void findChordRangeEnds(
const ReducedFraction &barStart, const ReducedFraction &barStart,
const ReducedFraction &beatLen) const ReducedFraction &beatLen)
{ {
#ifdef NDEBUG
(void)rangeStart;
#endif
for (auto it = data.rbegin(); it != data.rend(); ++it) { for (auto it = data.rbegin(); it != data.rend(); ++it) {
QuantData &d = *it; QuantData &d = *it;
d.chordRangeEnd = barStart + quantizeToSmall(rangeEnd - barStart, d.quant); d.chordRangeEnd = barStart + quantizeToSmall(rangeEnd - barStart, d.quant);

View file

@ -1088,6 +1088,9 @@ void findAllTuplets(
const ReducedFraction &lastTick, const ReducedFraction &lastTick,
const ReducedFraction &basicQuant) const ReducedFraction &basicQuant)
{ {
#ifdef NDEBUG
(void)lastTick;
#endif
if (chords.empty()) if (chords.empty())
return; return;

View file

@ -455,6 +455,9 @@ void setVoicesFromPrevBars(
const ReducedFraction &basicQuant, const ReducedFraction &basicQuant,
const ReducedFraction &barStart) const ReducedFraction &barStart)
{ {
#ifdef NDEBUG
(void)pendingNonTuplets;
#endif
bool loopAgain = false; bool loopAgain = false;
do { do {
for (auto it = backTiedTuplets.begin(); it != backTiedTuplets.end(); ) { for (auto it = backTiedTuplets.begin(); it != backTiedTuplets.end(); ) {

View file

@ -910,7 +910,7 @@ void InspectorBarLine::spanTypeChanged(int idx)
Score* score = bl->score(); Score* score = bl->score();
score->startCmd(); score->startCmd();
int spanStaves, spanFrom, spanTo; int spanStaves, spanFrom = 0, spanTo = 0;
// the amount to adjust To value of short types, if staff num. of lines != 5 // the amount to adjust To value of short types, if staff num. of lines != 5
int shortDelta = bl->staff() ? (bl->staff()->lines() - 5)*2 : 0; int shortDelta = bl->staff() ? (bl->staff()->lines() - 5)*2 : 0;
spanStaves = 1; // in most cases, num. of spanned staves is 1 spanStaves = 1; // in most cases, num. of spanned staves is 1

View file

@ -306,7 +306,7 @@ void KQOAuthManager::executeAuthorizedRequest(KQOAuthRequest *request, int id) {
} }
networkRequest.setRawHeader("Authorization", authHeader); networkRequest.setRawHeader("Authorization", authHeader);
QNetworkReply *reply; QNetworkReply *reply = 0;
if (request->httpMethod() == KQOAuthRequest::POST) { if (request->httpMethod() == KQOAuthRequest::POST) {