Ticket #5576: mythphone-uninit.patch

File mythphone-uninit.patch, 4.9 KB (added by Erik Hovland <erik@…>, 16 years ago)

initiliazes member variables in ctors

  • mythplugins/mythphone/mythphone/directory.cpp

    Fixes initialization defects in mythphone.
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     mythplugins/mythphone/mythphone/directory.cpp  |   43 ++++++++++--------------
     mythplugins/mythphone/mythphone/dtmffilter.cpp |    1 +
     mythplugins/mythphone/mythphone/h263.cpp       |   14 +++-----
     mythplugins/mythphone/mythphone/vxml.cpp       |   14 +++-----
     mythplugins/mythphone/mythphone/wavfile.cpp    |    4 +-
     5 files changed, 33 insertions(+), 43 deletions(-)
    
    diff --git a/mythplugins/mythphone/mythphone/directory.cpp b/mythplugins/mythphone/mythphone/directory.cpp
    index 56df94c..7094013 100644
    a b static int counter = 0; 
    2626///////////////////////////////////////////////////////
    2727
    2828DirEntry::DirEntry(QString nn, QString uri, QString fn, QString sn, QString ph, bool ohl)
     29    : NickName(nn),      FirstName(fn)
     30    , Surname(sn),       Uri(uri)
     31    , PhotoFile(ph),     id(counter++)
     32    , SpeedDial(false),  onHomeLan(ohl)
     33    , inDatabase(false), changed(true)
     34    , dbId(-1),          TreeNode(0)
     35    , SpeeddialNode(0)
    2936{
    30     NickName = nn;
    31     FirstName = fn;
    32     Surname = sn;
    33     Uri = uri;
    34     PhotoFile = ph;
    35     id = counter++;
    36     SpeedDial = false;
    37     inDatabase = false;
    38     changed = true;
    39     onHomeLan = ohl;
    40     dbId = -1;
    4137}
    4238
    4339
    4440DirEntry::DirEntry(DirEntry *Original)
     41    : NickName(Original->NickName),   FirstName(Original->FirstName)
     42    , Surname(Original->Surname),     Uri(Original->Uri)
     43    , PhotoFile(Original->PhotoFile), id(counter++)
     44    , SpeedDial(Original->SpeedDial), onHomeLan(Original->onHomeLan)
     45    , inDatabase(false),              changed(true)
     46    , dbId(-1),                       TreeNode(0)
     47    , SpeeddialNode(0)
    4548{
    46     NickName = Original->NickName;
    47     FirstName = Original->FirstName;
    48     Surname = Original->Surname;
    49     Uri = Original->Uri;
    50     PhotoFile = Original->PhotoFile;
    51     onHomeLan = Original->onHomeLan;
    52     id = counter++;
    53     inDatabase = false;
    54     changed = true;
    55     dbId = -1;
    56     TreeNode = 0;
    57     SpeeddialNode = 0;
    5849}
    5950
    6051
    void CallHistory::deleteRecords() 
    578569
    579570
    580571DirectoryContainer::DirectoryContainer()
    581 {
    582572    // Create the Call History directory
    583     callHistory = new CallHistory();
     573    : callHistory(new CallHistory()), TreeRoot(0)
     574    , voicemailTree(0),               receivedcallsTree(0)
     575    , placedcallsTree(0),             speeddialTree(0)
     576{
    584577}
    585578
    586579
  • mythplugins/mythphone/mythphone/dtmffilter.cpp

    diff --git a/mythplugins/mythphone/mythphone/dtmffilter.cpp b/mythplugins/mythphone/mythphone/dtmffilter.cpp
    index fb7c657..b1cba87 100644
    a b Goertzel Generic Filter class. 
    171171**********************************************************************/
    172172
    173173goertzel::goertzel(int N, float targetFreq, float sampleRate)
     174    : Match(0)
    174175{
    175176    initialise(N, targetFreq, sampleRate);
    176177}
  • mythplugins/mythphone/mythphone/h263.cpp

    diff --git a/mythplugins/mythphone/mythphone/h263.cpp b/mythplugins/mythphone/mythphone/h263.cpp
    index 1c99cf6..f60b5b4 100644
    a b using namespace std; 
    2424
    2525
    2626H263Container::H263Container()
     27    : pictureIn(0),          h263Encoder(0)
     28    , h263Decoder(0),        h263EncContext(0)
     29    , h263DecContext(0),     MaxPostEncodeSize(0)
     30    , lastCompressedSize(0), PostEncodeFrame(0)
     31    , PreEncodeFrame(0)
    2732{
    28     lastCompressedSize = 0;
    29     PostEncodeFrame = 0;
    30     h263Encoder = 0;
    31     h263EncContext = 0;
    32 
    33     h263Decoder = 0;
    34     h263DecContext = 0;
    35     pictureIn = 0;
     33    memset(&pictureOut, 0, sizeof(pictureOut));
    3634
    3735    avcodec_init();
    3836    avcodec_register_all();
  • mythplugins/mythphone/mythphone/vxml.cpp

    diff --git a/mythplugins/mythphone/mythphone/vxml.cpp b/mythplugins/mythphone/mythphone/vxml.cpp
    index 549a1c5..f42b90c 100644
    a b void vxmlVarContainer::removeMatching(QString N) 
    983983}
    984984
    985985vxmlVariable::vxmlVariable(QString N, QString V)
     986    : Name(N),   Type("STRING")
     987    , sValue(V), spValue(0)
     988    ,spLength(0)
    986989{
    987     Name = N;
    988     sValue = V;
    989     Type = "STRING";
    990     spValue = 0;
    991990}
    992991
    993992vxmlVariable::vxmlVariable(QString N, short *wav, int S)
     993    : Name(N),    Type("SHORTPTR")
     994    , sValue(""), spValue(wav)
     995    , spLength(S)
    994996{
    995     Name = N;
    996     spValue = wav;
    997     spLength = S;
    998     Type = "SHORTPTR";
    999997}
    1000998
  • mythplugins/mythphone/mythphone/wavfile.cpp

    diff --git a/mythplugins/mythphone/mythphone/wavfile.cpp b/mythplugins/mythphone/mythphone/wavfile.cpp
    index aefbece..730e28f 100644
    a b using namespace std; 
    2020#include <mythtv/mythverbose.h>
    2121
    2222wavfile::wavfile()
     23    : loaded(false), audio(0)
    2324{
    24     loaded=false;
    25     audio = 0;
     25    memset(&w, 0, sizeof(w));
    2626}
    2727
    2828wavfile::~wavfile()