Skip to content

Commit

Permalink
Const Correctness fixes in libmythtv (cppcheck)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartm committed Aug 27, 2011
1 parent 3c1f1a5 commit 1b75fdb
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythversion.h
Expand Up @@ -12,7 +12,7 @@
/// Update this whenever the plug-in API changes.
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
/// libmythui class methods used by plug-ins.
#define MYTH_BINARY_VERSION "0.25.20110826-1"
#define MYTH_BINARY_VERSION "0.25.20110827-1"

/** \brief Increment this whenever the MythTV network protocol changes.
*
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/audioplayer.cpp
Expand Up @@ -9,7 +9,7 @@ AudioPlayer::AudioPlayer(MythPlayer *parent, bool muted)
m_orig_channels(-1), m_codec(0), m_format(FORMAT_NONE),
m_samplerate(44100), m_codec_profile(0),
m_stretchfactor(1.0f),m_passthru(false),
m_lock(QMutex::Recursive), m_muted_on_creation(muted),
m_lock(QMutex::Recursive), m_muted_on_creation(muted),
m_main_device(QString::null), m_passthru_device(QString::null),
m_no_audio_in(false), m_no_audio_out(false)
{
Expand Down Expand Up @@ -285,7 +285,7 @@ bool AudioPlayer::SetMuted(bool mute)
return true;
}

LOG(VB_AUDIO, LOG_ERR,
LOG(VB_AUDIO, LOG_ERR,
QString("not changing sound mute state %1").arg(IsMuted()));

return false;
Expand Down
10 changes: 5 additions & 5 deletions mythtv/libs/libmythtv/audioplayer.h
Expand Up @@ -41,13 +41,13 @@ class MTV_PUBLIC AudioPlayer
bool Pause(bool pause);
bool IsPaused(void);
void PauseAudioUntilBuffered(void);
int GetCodec(void) { return m_codec; }
int GetNumChannels(void) { return m_channels; }
int GetOrigChannels(void) { return m_orig_channels; }
int GetSampleRate(void) { return m_samplerate; }
int GetCodec(void) const { return m_codec; }
int GetNumChannels(void) const { return m_channels; }
int GetOrigChannels(void) const { return m_orig_channels; }
int GetSampleRate(void) const { return m_samplerate; }
uint GetVolume(void);
uint AdjustVolume(int change);
float GetStretchFactor(void) { return m_stretchfactor; }
float GetStretchFactor(void) const { return m_stretchfactor; }
void SetStretchFactor(float factor);
bool ToggleUpmix(void);
bool CanPassthrough(int samplerate, int channels, int codec, int profile);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/decoderbase.h
Expand Up @@ -96,7 +96,7 @@ class DecoderBase
int testbufsize = kDecoderProbeBufferSize) = 0;

virtual void SetEof(bool eof) { ateof = eof; }
bool GetEof(void) { return ateof; }
bool GetEof(void) const { return ateof; }

void setExactSeeks(bool exact) { exactseeks = exact; }
bool getExactSeeks(void) const { return exactseeks; }
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/jitterometer.cpp
Expand Up @@ -8,7 +8,7 @@
#define UNIX_PROC_STAT "/proc/stat"
#define MAX_CORES 8

Jitterometer::Jitterometer(QString nname, int ncycles)
Jitterometer::Jitterometer(const QString &nname, int ncycles)
: count(0), num_cycles(ncycles), starttime_valid(0), last_fps(0),
last_sd(0), name(nname), cpustat(NULL), laststats(NULL)
{
Expand Down Expand Up @@ -114,7 +114,7 @@ bool Jitterometer::RecordEndTime()
if (!lastcpustats.isEmpty())
extra = QString("CPUs: ") + lastcpustats;

LOG(VB_PLAYBACK, LOG_INFO,
LOG(VB_PLAYBACK, LOG_INFO,
name + QString("Mean: %1 Std.Dev: %2 fps: %3 ")
.arg((int)mean).arg((int)standard_deviation)
.arg(last_fps, 0, 'f', 2) + extra);
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/jitterometer.h
Expand Up @@ -35,12 +35,12 @@
class Jitterometer
{
public:
Jitterometer(QString nname, int num_cycles = 0);
Jitterometer(const QString &nname, int num_cycles = 0);
~Jitterometer();

float GetLastFPS(void) { return last_fps; }
float GetLastSD(void) { return last_sd; }
QString GetLastCPUStats(void) { return lastcpustats; }
float GetLastFPS(void) const { return last_fps; }
float GetLastSD(void) const { return last_sd; }
QString GetLastCPUStats(void) const { return lastcpustats; }
void SetNumCycles(int cycles);
bool RecordCycleTime();
void RecordStartTime();
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mythplayer.h
Expand Up @@ -175,7 +175,7 @@ class MTV_PUBLIC MythPlayer
PIPLocation GetNextPIPLocation(void) const;

// Bool Gets
bool IsPaused(void) { return allpaused; }
bool IsPaused(void) const { return allpaused; }
bool GetRawAudioState(void) const;
bool GetLimitKeyRepeat(void) const { return limitKeyRepeat; }
bool GetEof(void);
Expand Down
10 changes: 5 additions & 5 deletions mythtv/libs/libmythtv/teletextreader.h
Expand Up @@ -78,15 +78,15 @@ class TeletextReader
QString GetPage(void);
void SetPage(int page, int subpage);
void SetSubPage(int subpage) { m_cursubpage = subpage; }
bool PageChanged(void) { return m_page_changed; }
bool PageChanged(void) const { return m_page_changed; }
void SetPageChanged(bool changed) { m_page_changed = changed; }
void SetShowHeader(bool show) { m_curpage_showheader = show; }
void SetHeaderChanged(bool changed) { m_header_changed = changed; }
bool IsSubtitle(void) { return m_curpage_issubtitle; }
bool IsSubtitle(void) const { return m_curpage_issubtitle; }
void SetIsSubtitle(bool sub) { m_curpage_issubtitle = sub; }
bool IsTransparent(void) { return m_transparent; }
bool RevealHidden(void) { return m_revealHidden; }
int GetPageInput(uint num) { return m_pageinput[num]; }
bool IsTransparent(void) const { return m_transparent; }
bool RevealHidden(void) const { return m_revealHidden; }
int GetPageInput(uint num) const { return m_pageinput[num]; }
TeletextSubPage* FindSubPage(void)
{ return FindSubPage(m_curpage, m_cursubpage); }
uint8_t* GetHeader(void) { return m_header; }
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/videooutbase.h
Expand Up @@ -152,7 +152,7 @@ class VideoOutput
virtual long long GetFramesPlayed(void) { return framesPlayed; };

/// \brief Returns true if a fatal error has been encountered.
bool IsErrored() { return errorState != kError_None; }
bool IsErrored() const { return errorState != kError_None; }
/// \brief Returns error type
VideoErrorState GetError(void) const { return errorState; }
// Video Buffer Management
Expand Down

0 comments on commit 1b75fdb

Please sign in to comment.