clean up a few -Wmaybe-uninitialized warnings in element.h:349, measure.cpp:2751, measure.cpp:2763

• Mar 28, 2016 - 09:19
Type
Functional
Severity
S4 - Minor
Status
closed
Project

It be nice to keep the build compile log clean...I cleaned some a few weeks ago, but I just notice a few more -Wmaybe-uninitialized warnings appear recently:

  1. https://travis-ci.org/musescore/MuseScore/jobs/118916841#L3349-L3354
    /MuseScore/libmscore/element.h: In member function 'void Ms::Chord::layoutTablature()':
    
    /MuseScore/libmscore/element.h:349:77: warning: 'llY' may be used uninitialized in this function [-Wmaybe-uninitialized]
    
           void setPos(qreal x, qreal y)           { _pos.rx() = x, _pos.ry() = y;   }
    
                                                                                 ^
    
    /MuseScore/libmscore/chord.cpp:2152:13: note: 'llY' was declared here
    
           qreal llY;
  2. https://travis-ci.org/musescore/MuseScore/jobs/118916841#L3395-L3398
    /MuseScore/libmscore/measure.cpp:2751:63: warning: 'lastIdx' may be used uninitialized in this function [-Wmaybe-uninitialized]
    
                                   if (aspan < spanTot && staffIdx < lastIdx)
  3. https://travis-ci.org/musescore/MuseScore/jobs/118916841#L3399-L3401
    /MuseScore/libmscore/measure.cpp:2763:25: warning: 'spanTot' may be used uninitialized in this function [-Wmaybe-uninitialized]
    
                 if (spanTot > 1 && spanTo <= 0 && span == 0) {

Comments