Skip to content

Commit

Permalink
Fix several cppcheck warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
stichnot committed Jan 30, 2013
1 parent 031c724 commit a8591ad
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 18 deletions.
1 change: 0 additions & 1 deletion mythtv/libs/libmythbase/dbutil.cpp
Expand Up @@ -531,7 +531,6 @@ bool DBUtil::CreateTemporaryDBConf(
filename = createTempFile("/tmp/mythtv_db_backup_conf_XXXXXX");
const QByteArray tmpfile = filename.toLocal8Bit();
const DatabaseParams dbParams = gCoreContext->GetDatabaseParams();
const QString dbSchemaVer = gCoreContext->GetSetting("DBSchemaVer");

FILE *fp = fopen(tmpfile.constData(), "w");
if (!fp)
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythbase/mythdbcon.cpp
Expand Up @@ -938,7 +938,6 @@ void MSqlEscapeAsAQuery(QString &query, MSqlBindings &bindings)
i += rx.matchedLength();
}

q = query;
QVariant val;
QString holder;

Expand Down
3 changes: 1 addition & 2 deletions mythtv/libs/libmythtv/cc708window.cpp
Expand Up @@ -552,9 +552,8 @@ void CC708Pen::SetPenStyle(uint style)
}

CC708Character::CC708Character(const CC708Window &win)
: attr(win.pen.attr), character(' ')
{
attr = win.pen.attr;
character = ' ';
}

bool CC708CharacterAttribute::operator==(
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/subtitlescreen.cpp
Expand Up @@ -871,10 +871,10 @@ void SubtitleScreen::DisplayAVSubtitles(void)
if (lh > 0)
{
bbox = QRect(0, uh, rect->w, lh);
lh = DisplayScaledAVSubtitles(rect, bbox, false, display,
subtitle.forced,
QString("avsub%1b").arg(i),
displayuntil, late);
DisplayScaledAVSubtitles(rect, bbox, false, display,
subtitle.forced,
QString("avsub%1b").arg(i),
displayuntil, late);
}
}
#ifdef USING_LIBASS
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -12653,7 +12653,6 @@ void TV::ShowOSDStopWatchingRecording(PlayerContext *ctx)

QString message;
QString videotype = QString::null;
QStringList options;

if (StateIsLiveTV(GetState(ctx)))
videotype = tr("Live TV");
Expand Down
10 changes: 5 additions & 5 deletions mythtv/libs/libmythtv/videobuffers.cpp
Expand Up @@ -353,7 +353,7 @@ void VideoBuffers::DoneDisplayingFrame(VideoFrame *frame)
QMutexLocker locker(&global_lock);

if(used.contains(frame))
remove(kVideoBuffer_used, frame);
Remove(kVideoBuffer_used, frame);

enqueue(kVideoBuffer_finished, frame);

Expand All @@ -364,7 +364,7 @@ void VideoBuffers::DoneDisplayingFrame(VideoFrame *frame)
{
if (!decode.contains(*it))
{
remove(kVideoBuffer_finished, *it);
Remove(kVideoBuffer_finished, *it);
enqueue(kVideoBuffer_avail, *it);
}
}
Expand Down Expand Up @@ -488,7 +488,7 @@ void VideoBuffers::enqueue(BufferType type, VideoFrame *frame)
return;
}

void VideoBuffers::remove(BufferType type, VideoFrame *frame)
void VideoBuffers::Remove(BufferType type, VideoFrame *frame)
{
if (!frame)
return;
Expand Down Expand Up @@ -531,7 +531,7 @@ void VideoBuffers::safeEnqueue(BufferType dst, VideoFrame* frame)

QMutexLocker locker(&global_lock);

remove(kVideoBuffer_all, frame);
Remove(kVideoBuffer_all, frame);
enqueue(dst, frame);
}

Expand Down Expand Up @@ -663,7 +663,7 @@ void VideoBuffers::DiscardFrames(bool next_frame_keyframe)
// Make sure frames used by decoder are last...
// This is for libmpeg2 which still uses the frames after a reset.
for (it = decode.begin(); it != decode.end(); ++it)
remove(kVideoBuffer_all, *it);
Remove(kVideoBuffer_all, *it);
for (it = decode.begin(); it != decode.end(); ++it)
available.enqueue(*it);
decode.clear();
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/videobuffers.h
Expand Up @@ -94,7 +94,7 @@ class VideoBuffers
void requeue(BufferType dst, BufferType src, int num = 1);
void enqueue(BufferType, VideoFrame*);
void safeEnqueue(BufferType, VideoFrame* frame);
void remove(BufferType, VideoFrame *); // multiple buffer types ok
void Remove(BufferType, VideoFrame *); // multiple buffer types ok
frame_queue_t::iterator begin_lock(BufferType); // this locks VideoBuffer
frame_queue_t::iterator end(BufferType);
void end_lock() { global_lock.unlock(); } // this unlocks VideoBuffer
Expand Down
5 changes: 2 additions & 3 deletions mythtv/libs/libmythtv/videosource.cpp
Expand Up @@ -2406,7 +2406,7 @@ void CaptureCard::Save(void)
init_cardid = cardid;

// Delete old clone cards as required.
for (uint i = cardids.size() - 1; (i > cloneCount) && cardids.size(); i--)
for (uint i = cardids.size() - 1; (i > cloneCount) && !cardids.empty(); i--)
{
CardUtil::DeleteCard(cardids.back());
cardids.pop_back();
Expand Down Expand Up @@ -2773,7 +2773,7 @@ void StartingChannel::SetSourceID(const QString &sourceid)
// (selecting the old start channel if it is there).
QString order = gCoreContext->GetSetting("ChannelOrdering", "channum");
ChannelUtil::SortChannels(channels, order);
bool has_visible = false, found_existing = false;
bool has_visible = false;
for (uint i = 0; i < channels.size() && !has_visible; i++)
has_visible |= channels[i].visible;

Expand All @@ -2784,7 +2784,6 @@ void StartingChannel::SetSourceID(const QString &sourceid)
if (!has_visible || channels[i].visible || sel)
{
addSelection(channum, channum, sel);
found_existing |= sel;
}
}
}
Expand Down

0 comments on commit a8591ad

Please sign in to comment.