Ticket #5688: programs_mythfrontend-uninit.patch

File programs_mythfrontend-uninit.patch, 3.7 KB (added by Erik Hovland <erik@…>, 18 years ago)

changes ctors to initialize member variables

  • mythtv/programs/mythfrontend/mythappearance.cpp

    Deal with initialization defects (especially in ctors).
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     mythtv/programs/mythfrontend/mythappearance.cpp    |   32 ++++++++------------
     .../programs/mythfrontend/programrecpriority.cpp   |   20 ++++++-------
     2 files changed, 22 insertions(+), 30 deletions(-)
    
    diff --git a/mythtv/programs/mythfrontend/mythappearance.cpp b/mythtv/programs/mythfrontend/mythappearance.cpp
    index 8a38d00..3652a47 100644
    a b using namespace std;  
    2323
    2424
    2525MythAppearance::MythAppearance(MythScreenStack *parent, const char *name)
    26     : MythScreenType(parent, name)
     26    : MythScreenType(parent, name),
     27      m_x_offset(0),           m_y_offset(0),
     28      m_whicharrow(true),      m_coarsefine(false), // fine adjustments by default
     29      m_changed(false),        m_fine(1),           // fine moves arrows by one pixel
     30      m_coarse(10),            m_change(m_fine),    // coarse moves arrows by ten pixels
     31      m_topleftarrow_x(0),     m_topleftarrow_y(0),
     32      m_bottomrightarrow_x(0), m_bottomrightarrow_y(0),
     33      m_arrowsize_x(30),       m_arrowsize_y(30),   // maybe get the image size later
     34      m_screenheight(0),       m_screenwidth(0),
     35      m_xsize(GetMythMainWindow()->GetUIScreenRect().width()),
     36      m_ysize(GetMythMainWindow()->GetUIScreenRect().height()),
     37      m_menuPopup(NULL)
    2738{
    2839    // Initialise $stuff
    2940    // Get UI size & offset settings from database
    30 
    31     m_coarsefine = false; // fine adjustments by default
    32     m_fine = 1; //fine moves arrows by one pixel
    33     m_coarse = 10; // coarse moves arrows by ten pixels
    34     m_change = m_fine;
    35     m_screenheight = 0, m_screenwidth = 0;
    36     m_arrowsize_x = 30; // maybe get the image size later
    37     m_arrowsize_y = 30; // maybe get the image size later
    38     m_topleftarrow_x = 0;
    39     m_topleftarrow_y = 0;
    40 
    41     m_menuPopup = NULL;
    42     m_changed = false;
    43 
    4441    getSettings();
    4542    getScreenInfo();
    46     m_whicharrow = true;
    47 
    48     m_xsize = GetMythMainWindow()->GetUIScreenRect().width();
    49     m_ysize = GetMythMainWindow()->GetUIScreenRect().height();
    50 
    5143}
    5244
    5345MythAppearance::~MythAppearance() {}
  • mythtv/programs/mythfrontend/programrecpriority.cpp

    diff --git a/mythtv/programs/mythfrontend/programrecpriority.cpp b/mythtv/programs/mythfrontend/programrecpriority.cpp
    index 5cf780e..9da3ff8 100644
    a b using namespace std;  
    3232// overloaded version of ProgramInfo with additional recording priority
    3333// values so we can keep everything together and don't
    3434// have to hit the db mulitiple times
    35 ProgramRecPriorityInfo::ProgramRecPriorityInfo(void) : ProgramInfo()
     35ProgramRecPriorityInfo::ProgramRecPriorityInfo(void)
     36    : ProgramInfo(),
     37      recTypeRecPriority(0), recType(kNotRecording),
     38      matchCount(0),         recCount(0),
     39      avg_delay(0),          autoRecPriority(0)
    3640{
    37     recTypeRecPriority = 0;
    38     recType = kNotRecording;
    39     avg_delay = 0;
    40     autoRecPriority = 0;
    4141}
     42
    4243ProgramRecPriorityInfo::ProgramRecPriorityInfo(const ProgramRecPriorityInfo &other)
    43                       : ProgramInfo::ProgramInfo(other)
     44    : ProgramInfo::ProgramInfo(other),
     45      recTypeRecPriority(other.recTypeRecPriority), recType(other.recType),
     46      matchCount(other.matchCount),                 recCount(other.recCount),
     47      avg_delay(other.avg_delay),                   autoRecPriority(other.autoRecPriority)
    4448{
    45     recTypeRecPriority = other.recTypeRecPriority;
    46     recType = other.recType;
    47     avg_delay = other.avg_delay;
    48     autoRecPriority = other.autoRecPriority;
    4949}
    5050
    5151ProgramRecPriorityInfo& ProgramRecPriorityInfo::operator=(const ProgramInfo &other)