From 17c45c0e2c5a267b0fcf4657d37d3bf61c50049c Mon Sep 17 00:00:00 2001 From: Daniel Kristjansson Date: Mon, 22 Aug 2011 14:17:34 -0400 Subject: [PATCH] Fix some minor issues discovered by cppcheck. --- mythtv/libs/libmythtv/asirecorder.cpp | 3 ++- mythtv/libs/libmythtv/dbchannelinfo.cpp | 10 ++++++++-- mythtv/libs/libmythtv/dtvmultiplex.cpp | 21 +++++++++++++++++++-- mythtv/libs/libmythtv/dtvmultiplex.h | 2 +- mythtv/libs/libmythtv/recordinginfo.h | 6 +++++- mythtv/libs/libmythtv/ringbuffer.h | 1 - mythtv/libs/libmythtv/signalmonitor.cpp | 4 ++-- mythtv/libs/libmythtv/signalmonitor.h | 3 --- 8 files changed, 37 insertions(+), 13 deletions(-) diff --git a/mythtv/libs/libmythtv/asirecorder.cpp b/mythtv/libs/libmythtv/asirecorder.cpp index 07eee43e5b1..f213d3af784 100644 --- a/mythtv/libs/libmythtv/asirecorder.cpp +++ b/mythtv/libs/libmythtv/asirecorder.cpp @@ -31,7 +31,8 @@ #define LOC QString("ASIRec(%1): ").arg(tvrec->GetCaptureCardNum()) ASIRecorder::ASIRecorder(TVRec *rec, ASIChannel *channel) : - DTVRecorder(rec), m_channel(channel), m_stream_handler(NULL) + DTVRecorder(rec), m_channel(channel), m_stream_handler(NULL), + m_record_mpts(false) { SetStreamData(new MPEGStreamData(-1,false)); if (channel->GetProgramNumber() < 0 || !channel->GetMinorChannel()) diff --git a/mythtv/libs/libmythtv/dbchannelinfo.cpp b/mythtv/libs/libmythtv/dbchannelinfo.cpp index 3f470a7ef96..cb0646b9779 100644 --- a/mythtv/libs/libmythtv/dbchannelinfo.cpp +++ b/mythtv/libs/libmythtv/dbchannelinfo.cpp @@ -17,9 +17,15 @@ #include "channelgroup.h" #include "sourceutil.h" -DBChannel::DBChannel(const DBChannel &other) +DBChannel::DBChannel(const DBChannel &other) : + channum(other.channum), callsign(other.callsign), + name(other.name), icon(other.icon), + chanid(other.chanid), + major_chan(other.major_chan), minor_chan(other.minor_chan), + mplexid((other.mplexid == 32767) ? 0 : other.mplexid), + sourceid(other.sourceid), cardid (other.cardid), + grpid(other.grpid), visible(other.visible) { - (*this) = other; } DBChannel::DBChannel( diff --git a/mythtv/libs/libmythtv/dtvmultiplex.cpp b/mythtv/libs/libmythtv/dtvmultiplex.cpp index a509ba6fd98..35b4666b1f2 100644 --- a/mythtv/libs/libmythtv/dtvmultiplex.cpp +++ b/mythtv/libs/libmythtv/dtvmultiplex.cpp @@ -6,6 +6,25 @@ #define LOC QString("DTVMux: ") +DTVMultiplex::DTVMultiplex(const DTVMultiplex &other) : + frequency(other.frequency), + symbolrate(other.symbolrate), + inversion(other.inversion), + bandwidth(other.bandwidth), + hp_code_rate(other.hp_code_rate), + lp_code_rate(other.lp_code_rate), + modulation(other.modulation), + trans_mode(other.trans_mode), + guard_interval(other.guard_interval), + hierarchy(other.hierarchy), + polarity(other.polarity), + fec(other.fec), + mod_sys(other.mod_sys), + rolloff(other.rolloff), + mplex(other.mplex), + sistandard(other.sistandard) +{ +} DTVMultiplex &DTVMultiplex::operator=(const DTVMultiplex &other) { @@ -25,7 +44,6 @@ DTVMultiplex &DTVMultiplex::operator=(const DTVMultiplex &other) rolloff = other.rolloff; mplex = other.mplex; sistandard = other.sistandard; - sistandard.detach(); return *this; } @@ -324,7 +342,6 @@ bool DTVMultiplex::FillFromDB(DTVTunerType type, uint mplexid) mplex = mplexid; sistandard = query.value(13).toString(); - sistandard.detach(); // Parse the query into our DVBTuning class return ParseTuningParams( diff --git a/mythtv/libs/libmythtv/dtvmultiplex.h b/mythtv/libs/libmythtv/dtvmultiplex.h index b707bc91647..273131c6ca5 100644 --- a/mythtv/libs/libmythtv/dtvmultiplex.h +++ b/mythtv/libs/libmythtv/dtvmultiplex.h @@ -24,7 +24,7 @@ class DTVMultiplex public: DTVMultiplex() : frequency(0), symbolrate(0), mplex(0), sistandard(QString::null) { } - DTVMultiplex(const DTVMultiplex &other) { (*this) = other; } + DTVMultiplex(const DTVMultiplex &other); DTVMultiplex &operator=(const DTVMultiplex &other); virtual ~DTVMultiplex() { } diff --git a/mythtv/libs/libmythtv/recordinginfo.h b/mythtv/libs/libmythtv/recordinginfo.h index 0bab231a2e8..a177534d04d 100644 --- a/mythtv/libs/libmythtv/recordinginfo.h +++ b/mythtv/libs/libmythtv/recordinginfo.h @@ -29,7 +29,11 @@ typedef AutoDeleteDeque RecordingList; class MTV_PUBLIC RecordingInfo : public ProgramInfo { public: - RecordingInfo(void) : record(NULL) {} + RecordingInfo(void) : + oldrecstatus(rsUnknown), + savedrecstatus(rsUnknown), + future(false), + record(NULL) {} RecordingInfo(const RecordingInfo &other) : ProgramInfo(other), oldrecstatus(other.oldrecstatus), diff --git a/mythtv/libs/libmythtv/ringbuffer.h b/mythtv/libs/libmythtv/ringbuffer.h index 2ada4992479..f551ecdd31a 100644 --- a/mythtv/libs/libmythtv/ringbuffer.h +++ b/mythtv/libs/libmythtv/ringbuffer.h @@ -214,7 +214,6 @@ class MTV_PUBLIC RingBuffer : protected MThread bool ateof; // protected by rwlock bool readsallowed; // protected by rwlock bool setswitchtonext; // protected by rwlock - bool ignorereadahead; // protected by rwlock uint rawbitrate; // protected by rwlock float playspeed; // protected by rwlock int fill_threshold; // protected by rwlock diff --git a/mythtv/libs/libmythtv/signalmonitor.cpp b/mythtv/libs/libmythtv/signalmonitor.cpp index c2d69872e35..9f793eb479b 100644 --- a/mythtv/libs/libmythtv/signalmonitor.cpp +++ b/mythtv/libs/libmythtv/signalmonitor.cpp @@ -175,11 +175,11 @@ SignalMonitor *SignalMonitor::Init(QString cardtype, int db_cardnum, SignalMonitor::SignalMonitor(int _capturecardnum, ChannelBase *_channel, uint64_t wait_for_mask) : MThread("SignalMonitor"), - channel(_channel), + channel(_channel), pParent(NULL), capturecardnum(_capturecardnum), flags(wait_for_mask), update_rate(25), minimum_update_rate(5), update_done(false), notify_frontend(true), - eit_scan(false), + eit_scan(false), tablemon(false), signalLock (QObject::tr("Signal Lock"), "slock", 1, true, 0, 1, 0), signalStrength(QObject::tr("Signal Power"), "signal", diff --git a/mythtv/libs/libmythtv/signalmonitor.h b/mythtv/libs/libmythtv/signalmonitor.h index c876c65c01a..aa9a051057a 100644 --- a/mythtv/libs/libmythtv/signalmonitor.h +++ b/mythtv/libs/libmythtv/signalmonitor.h @@ -201,9 +201,6 @@ class SignalMonitor : protected MThread bool eit_scan; QString error; - MythTimer m_channelTimer; - int m_channelTimeout; - SignalMonitorValue signalLock; SignalMonitorValue signalStrength; SignalMonitorValue scriptStatus;