Ticket #5295: libs_libmythui-init-vars.patch

File libs_libmythui-init-vars.patch, 4.5 KB (added by Erik Hovland <erik@…>, 16 years ago)
  • libs/libmythui/mythpainter.h

    Initialize every variable possibly used without initialization.
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     libs/libmythui/mythpainter.h       |    2 +-
     libs/libmythui/mythpainter_ogl.cpp |    8 +++----
     libs/libmythui/mythpainter_ogl.h   |    1 -
     libs/libmythui/mythpainter_qt.cpp  |    7 ++----
     libs/libmythui/mythpainter_qt.h    |    1 -
     libs/libmythui/myththemedmenu.cpp  |   43 ++++++++++++++----------------------
     6 files changed, 23 insertions(+), 39 deletions(-)
    
    diff --git a/libs/libmythui/mythpainter.h b/libs/libmythui/mythpainter.h
    index 23ad65f..071793d 100644
    a b class MythImage; 
    1515class MythPainter
    1616{
    1717  public:
    18     MythPainter() { }
     18    MythPainter() : m_Parent(0) { }
    1919    virtual ~MythPainter() { }
    2020
    2121    virtual QString GetName(void) = 0;
  • libs/libmythui/mythpainter_ogl.cpp

    diff --git a/libs/libmythui/mythpainter_ogl.cpp b/libs/libmythui/mythpainter_ogl.cpp
    index 672ea70..91237ad 100644
    a b using namespace std; 
    3737#endif
    3838
    3939MythOpenGLPainter::MythOpenGLPainter()
    40                  : MythPainter()
    41 {
    42 }
    43 
    44 MythOpenGLPainter::~MythOpenGLPainter()
     40    : MythPainter()
     41    , q_gl_texture(-1), texture_rects(false)
     42    , m_maxTexDim(-1)
    4543{
    4644}
    4745
  • libs/libmythui/mythpainter_ogl.h

    diff --git a/libs/libmythui/mythpainter_ogl.h b/libs/libmythui/mythpainter_ogl.h
    index 7713b23..731301b 100644
    a b class MythOpenGLPainter : public MythPainter 
    1111{
    1212  public:
    1313    MythOpenGLPainter();
    14    ~MythOpenGLPainter();
    1514
    1615    virtual QString GetName(void) { return QString("OpenGL"); }
    1716    virtual bool SupportsAnimation(void) { return true; }
  • libs/libmythui/mythpainter_qt.cpp

    diff --git a/libs/libmythui/mythpainter_qt.cpp b/libs/libmythui/mythpainter_qt.cpp
    index 2072d48..4451988 100644
    a b void MythQtImage::SetChanged(bool change) 
    2929}
    3030
    3131MythQtPainter::MythQtPainter()
    32              : MythPainter()
    33 {
    34 }
    35 
    36 MythQtPainter::~MythQtPainter()
     32    : MythPainter()
     33    , painter(0)
    3734{
    3835}
    3936
  • libs/libmythui/mythpainter_qt.h

    diff --git a/libs/libmythui/mythpainter_qt.h b/libs/libmythui/mythpainter_qt.h
    index 4b1f904..36aa9f6 100644
    a b class MythQtPainter : public MythPainter 
    1515{
    1616  public:
    1717    MythQtPainter();
    18    ~MythQtPainter();
    1918
    2019    virtual QString GetName(void) { return QString("Qt"); }
    2120    virtual bool SupportsAnimation(void) { return false; }
  • libs/libmythui/myththemedmenu.cpp

    diff --git a/libs/libmythui/myththemedmenu.cpp b/libs/libmythui/myththemedmenu.cpp
    index ddfaaa9..a48f447 100644
    a b class MythThemedMenuPrivate: public XMLParseBase 
    246246/////////////////////////////////////////////////////////////////////////////
    247247
    248248MythThemedMenuState::MythThemedMenuState()
     249    : logo(0),             buttonnormal(0)
     250    , buttonactive(0),     callback(0)
     251    , callbackdata(0),     killable(false)
     252    , balancerows(true),   spreadbuttons(false)
     253    , buttoncenter(false), buttonBackground(0)
     254    , uparrow(0),          downarrow(0)
     255    , allowreorder(true),  maxColumns(-1)
     256    , visiblerowlimit(-1), loaded(false)
    249257{
    250     allowreorder = true;
    251     balancerows = true;
    252 
    253     logo = NULL;
    254     buttonnormal = NULL;
    255     buttonactive = NULL;
    256     uparrow = NULL;
    257     downarrow = NULL;
    258     buttonBackground = NULL;
    259 
    260     loaded = false;
    261 
    262     callback = NULL;
    263 
    264     killable = false;
    265258}
    266259
    267260MythThemedMenuState::~MythThemedMenuState()
    bool MythThemedMenuState::parseSettings( 
    12831276MythThemedMenuPrivate::MythThemedMenuPrivate(MythThemedMenu *lparent,
    12841277                                             const char *cdir,
    12851278                                             MythThemedMenuState *lstate)
     1279    : parent(lparent),     m_state(lstate)
     1280    , allocedstate(false), activebutton(0)
     1281    , currentrow(-1),      currentcolumn(-1)
     1282    , foundtheme(false),   exitModifier(-1)
     1283    , ignorekeys(false),   maxrows(-1)
     1284    , visiblerows(-1),     columns(-1)
     1285    , wantpop(false),      watermark(0)
     1286    , uparrow(0),          downarrow(0)
    12861287{
    1287     if (!lstate)
     1288    if (!m_state)
    12881289    {
    12891290        m_state = new MythThemedMenuState();
    12901291        allocedstate = true;
    12911292    }
    1292     else
    1293     {
    1294         m_state = lstate;
    1295         allocedstate = false;
    1296     }
    1297 
    1298     parent = lparent;
    1299     ignorekeys = false;
    1300     wantpop = false;
    1301     exitModifier = -1;
    13021293
    13031294    m_state->themeDir = cdir;
    13041295}