19 changes: 9 additions & 10 deletions mythtv/libs/libmythtv/mpeg/dvbdescriptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ class CountryAvailabilityDescriptor : public MPEGDescriptor
uint CountryCount(void) const { return ((DescriptorLength() - 1) / 3); }

// country_avail_flag 1 2.0
bool IsAvailable(void) const { return (m_data[2] & 0x1); }
bool IsAvailable(void) const { return (m_data[2] & 0x1) != 0; }
// reserved_future_use 7 2.1
//
// for (i=0; i<N; i++)
Expand Down Expand Up @@ -833,11 +833,10 @@ class SatelliteDeliverySystemDescriptor : public MPEGDescriptor
static QString ps[] = { "h", "v", "l", "r" };
return ps[Polarization()];
}
bool IsCircularPolarization(void) const { return (m_data[8]>>6)&0x1; }
bool IsLinearPolarization(void) const { return !((m_data[8]>>6)&0x1); }
bool IsHorizontalLeftPolarization(void) const { return (m_data[8]>>5)&0x1; }
bool IsVerticalRightPolarization(void) const
{ return !((m_data[8]>>5)&0x1); }
bool IsCircularPolarization(void) const { return ((m_data[8]>>6)&0x1) != 0; }
bool IsLinearPolarization(void) const { return ((m_data[8]>>6)&0x1) == 0; }
bool IsHorizontalLeftPolarization(void) const { return ((m_data[8]>>5)&0x1) != 0; }
bool IsVerticalRightPolarization(void) const { return ((m_data[8]>>5)&0x1) == 0; }
// roll off 2 8.3
enum
{
Expand Down Expand Up @@ -938,9 +937,9 @@ class TerrestrialDeliverySystemDescriptor : public MPEGDescriptor
// priority 1 6.3
bool HighPriority(void) const { return ( m_data[6] & 0x10 ) != 0; }
// time_slicing_indicator 1 6.4
bool IsTimeSlicingIndicatorUsed(void) const { return !(m_data[6] & 0x08); }
bool IsTimeSlicingIndicatorUsed(void) const { return (m_data[6] & 0x08) == 0; }
// MPE-FEC_indicator 1 6.5
bool IsMPE_FECUsed(void) const { return !(m_data[6] & 0x04); }
bool IsMPE_FECUsed(void) const { return (m_data[6] & 0x04) == 0; }
// reserved_future_use 2 6.6
// constellation 2 7.0
enum
Expand Down Expand Up @@ -1037,7 +1036,7 @@ class TerrestrialDeliverySystemDescriptor : public MPEGDescriptor
return tm[TransmissionMode()];
}
// other_frequency_flag 1 8.7
bool OtherFrequencyInUse(void) const { return m_data[8] & 0x1; }
bool OtherFrequencyInUse(void) const { return (m_data[8] & 0x1) != 0; }
// reserved_future_use 32 9.0

QString toString(void) const override; // MPEGDescriptor
Expand Down Expand Up @@ -1180,7 +1179,7 @@ class LocalTimeOffsetDescriptor : public MPEGDescriptor
// local_time_off_polarity 1 3.7+p
/// -1 if true, +1 if false (behind utc, ahead of utc, resp).
bool LocalTimeOffsetPolarity(uint i) const
{ return m_data[2 + i*13 + 3] & 0x01; }
{ return (m_data[2 + i*13 + 3] & 0x01) != 0; }
// local_time_offset 16 4.0+p
uint LocalTimeOffset(uint i) const
{ return (m_data[2 + i*13 + 4] << 8) | m_data[2 + i*13 + 5]; }
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mpeg/mpegdescriptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ class AVCTimingAndHRDDescriptor : public MPEGDescriptor
bool HRDManagementValid(void) const { return ( m_data[2]&0x80 ) != 0; }
// reserved 6 2.1
// picture_and_timing_info_present 1 2.7
bool HasPictureAndTimingInfo(void) const { return m_data[2]&0x01;}
bool HasPictureAndTimingInfo(void) const { return (m_data[2]&0x01) != 0;}
// if (picture_and_timing_info_present) {
// 90kHz_flag 1 3.0
// reserved 7 3.1
Expand Down
24 changes: 12 additions & 12 deletions mythtv/libs/libmythtv/mpeg/pespacket.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,33 @@ class MTV_PUBLIC PESPacket
uint ScramblingControl() const
{ return (m_pesData[3] & 0x30) >> 4; }
/// 1 bit Indicates if this is a high priority packet
bool HighPriority() const { return (m_pesData[3] & 0x8) >> 3; }
bool HighPriority() const { return ((m_pesData[3] & 0x8) >> 3) != 0; }
/// 1 bit Data alignment indicator (must be 0 for video)
bool DataAligned() const { return (m_pesData[3] & 0x4) >> 2; }
bool DataAligned() const { return ((m_pesData[3] & 0x4) >> 2) != 0; }
/// 1 bit If true packet may contain copy righted material and is
/// known to have once contained materiale with copy rights.
/// If false packet may contain copy righted material but is
/// not known to have ever contained materiale with copy rights.
bool CopyRight() const { return (m_pesData[3] & 0x2) >> 1; }
bool CopyRight() const { return ((m_pesData[3] & 0x2) >> 1) != 0; }
/// 1 bit Original Recording
bool OriginalRecording() const { return m_pesData[3] & 0x1; }
bool OriginalRecording() const { return (m_pesData[3] & 0x1) != 0; }

/// 1 bit Presentation Time Stamp field is present
bool HasPTS() const { return (m_pesData[4] & 0x80) >> 7; }
bool HasPTS() const { return ((m_pesData[4] & 0x80) >> 7) != 0; }
/// 1 bit Decoding Time Stamp field is present
bool HasDTS() const { return (m_pesData[4] & 0x40) >> 6; }
bool HasDTS() const { return ((m_pesData[4] & 0x40) >> 6) != 0; }
/// 1 bit Elementary Stream Clock Reference field is present
bool HasESCR() const { return (m_pesData[4] & 0x20) >> 5; }
bool HasESCR() const { return ((m_pesData[4] & 0x20) >> 5) != 0; }
/// 1 bit Elementary Stream Rate field is present
bool HasESR() const { return (m_pesData[4] & 0x10) >> 4; }
bool HasESR() const { return ((m_pesData[4] & 0x10) >> 4) != 0; }
/// 1 bit DSM field present (should always be false for broadcasts)
bool HasDSM() const { return (m_pesData[4] & 0x8) >> 3; }
bool HasDSM() const { return ((m_pesData[4] & 0x8) >> 3) != 0; }
/// 1 bit Additional Copy Info field is present
bool HasACI() const { return (m_pesData[4] & 0x4) >> 2; }
bool HasACI() const { return ((m_pesData[4] & 0x4) >> 2) != 0; }
/// 1 bit Cyclic Redundancy Check present
virtual bool HasCRC() const { return (m_pesData[4] & 0x2) >> 1; }
virtual bool HasCRC() const { return ((m_pesData[4] & 0x2) >> 1) != 0; }
/// 1 bit Extension flags are present
bool HasExtensionFlags() const { return m_pesData[4] & 0x1; }
bool HasExtensionFlags() const { return (m_pesData[4] & 0x1) != 0; }

/// Presentation Time Stamp, present if HasPTS() is true
uint64_t PTS(void) const
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mpeg/sctedescriptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class ModulationParamsDescriptor : public MPEGDescriptor
// inner_coding_mode 4 2.4
uint InnerCodingMode(void) const { return m_data[2] & 0x0f; }
// split_bitstream_mode 1 3.0
bool SplitBitstreamMode(void) const { return m_data[3] >> 7; }
bool SplitBitstreamMode(void) const { return (m_data[3] >> 7) != 0; }
//reserved 2 3.1
//modulation_format 5 3.3
uint ModulationFormat(void) const { return m_data[3] & 0x1F; }
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/mythplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ void MythPlayer::EnableCaptions(uint mode, bool osd_msg)
bool MythPlayer::ToggleCaptions(void)
{
SetCaptionsEnabled(!((bool)m_textDisplayMode));
return m_textDisplayMode;
return m_textDisplayMode != 0U;
}

bool MythPlayer::ToggleCaptions(uint type)
Expand All @@ -1224,10 +1224,10 @@ bool MythPlayer::ToggleCaptions(uint type)
if (m_textDisplayMode)
DisableCaptions(m_textDisplayMode, (origMode & mode) != 0U);
if (origMode & mode)
return m_textDisplayMode;
return m_textDisplayMode != 0U;
if (mode)
EnableCaptions(mode);
return m_textDisplayMode;
return m_textDisplayMode != 0U;
}

void MythPlayer::SetCaptionsEnabled(bool enable, bool osd_msg)
Expand Down Expand Up @@ -3537,7 +3537,7 @@ bool MythPlayer::UpdateFFRewSkip(void)
m_fpsMultiplier = m_decoder->GetfpsMultiplier();
m_frameInterval = (int) (1000000.0 / m_videoFrameRate / static_cast<double>(temp_speed))
/ m_fpsMultiplier;
m_ffrewSkip = (m_playSpeed != 0.0F);
m_ffrewSkip = static_cast<int>(m_playSpeed != 0.0F);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mythplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class MTV_PUBLIC MythPlayer
float GetFrameRate(void) const { return m_videoFrameRate; }
void GetPlaybackData(InfoMap &infoMap);
bool IsAudioNeeded(void)
{ return !(FlagIsSet(kVideoIsNull)) && m_playerCtx->IsAudioNeeded(); }
{ return ((FlagIsSet(kVideoIsNull)) == 0) && m_playerCtx->IsAudioNeeded(); }
uint GetVolume(void) { return m_audio.GetVolume(); }
int GetFreeVideoFrames(void) const;
AspectOverrideMode GetAspectOverride(void) const;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mythsystemevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ void MythSystemEventHandler::SubstituteMatches(const QStringList &tokens,

// 1st, try loading RecordingInfo / ProgramInfo
RecordingInfo recinfo(chanid, recstartts);
bool loaded = recinfo.GetChanID();
bool loaded = recinfo.GetChanID() != 0U;
if (loaded)
recinfo.SubstituteMatches(command);
else
Expand Down
10 changes: 5 additions & 5 deletions mythtv/libs/libmythtv/opengl/mythopenglvideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -915,10 +915,10 @@ QString MythOpenGLVideo::TypeToProfile(VideoFrameType Type)
QString MythOpenGLVideo::VideoResizeToString(VideoResizing Resize)
{
QStringList reasons;
if (Resize & Deinterlacer) reasons << "Deinterlacer";
if (Resize & Sampling) reasons << "Sampling";
if (Resize & Performance) reasons << "Performance";
if (Resize & Framebuffer) reasons << "Framebuffer";
if ((Resize & Deinterlacer) != 0U) reasons << "Deinterlacer";
if ((Resize & Sampling) != 0U) reasons << "Sampling";
if ((Resize & Performance) != 0U) reasons << "Performance";
if ((Resize & Framebuffer) != 0U) reasons << "Framebuffer";
return reasons.join(",");
}

Expand All @@ -934,7 +934,7 @@ QOpenGLFramebufferObject* MythOpenGLVideo::CreateVideoFrameBuffer(VideoFrameType
// GLES3.0 needs specific texture formats - needs more work and it
// is currently unclear whether QOpenGLFrameBufferObject has the
// requisite flexibility for those formats.
bool sixteenbitfb = !m_gles;
bool sixteenbitfb = (m_gles == 0);
bool sixteenbitvid = ColorDepth(OutputType) > 8;
GLenum format = (sixteenbitfb && sixteenbitvid) ? QOpenGLTexture::RGBA16_UNorm : 0;
if (format)
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/opengl/mythvaapidrminterop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ bool MythVAAPIInteropDRM::TestPrimeInterop(void)
{
s_supported = true;
for (auto & texture : textures)
s_supported &= texture->m_data && texture->m_textureId;
s_supported &= texture->m_data && (texture->m_textureId != 0U);
ClearDMATextures(m_context, textures);
}
for (uint32_t i = 0; i < vadesc.num_objects; ++i)
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/opengl/mythvdpauinterop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ bool MythVDPAUInterop::InitVDPAU(AVVDPAUDeviceContext* DeviceContext, VdpVideoSu
return true;
}

return m_mixer && m_outputSurface;
return (m_mixer != 0U) && (m_outputSurface != 0U);
}

/*! \brief Map VDPAU video surfaces to an OpenGL texture.
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/opengl/mythvideooutopengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ void MythVideoOutputOpenGL::PrepareFrame(VideoFrame *Frame, FrameScanType Scan,
m_render->logDebugMarker(LOC + "CLEAR_START");

int gray = m_dbLetterboxColour == kLetterBoxColour_Gray25 ? 64 : 0;
bool useclear = !Frame || dummy || m_render->GetExtraFeatures() & kGLTiled;
bool useclear = !Frame || dummy || ((m_render->GetExtraFeatures() & kGLTiled) != 0);
#if QT_VERSION < QT_VERSION_CHECK(5, 8, 0)
// Qt < 5.8 uses a different QRegion API. Just clear and remove this code
// when 5.8 is standard
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/opengl/mythvideotexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ vector<MythVideoTexture*> MythVideoTexture::CreateSoftwareTextures(MythRenderOpe
}

// OpenGL ES 2.0 has very limited texture format support
bool legacy = Context->GetExtraFeatures() & kGLLegacyTextures;
bool legacy = (Context->GetExtraFeatures() & kGLLegacyTextures) != 0;
// GLES3 supports GL_RED etc and 16bit formats but there are no unsigned,
// normalised 16bit integer formats. So we must use unsigned integer formats
// for 10bit video textures which force:-
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/previewgeneratorqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ QString PreviewGeneratorQueue::GeneratePreviewImage(
QString ret;

bool is_special = !outputfile.isEmpty() || time >= 0 ||
size.width() || size.height();
(size.width() != 0) || (size.height() != 0);

bool needs_gen = true;
if (!is_special)
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/recorders/ExternalStreamHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,12 +805,12 @@ void ExternalStreamHandler::run(void)
if (remainder == 0)
{
buffer.clear();
good_data = len;
good_data = (len != 0U);
}
else if (len > remainder) // leftover bytes
{
buffer.remove(0, len - remainder);
good_data = len;
good_data = (len != 0U);
}
else if (len == remainder)
good_data = false;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/channelbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ bool ChannelBase::Init(QString &startchannel, bool setchan)
ChannelInfoList::const_iterator cit =
find(m_channels.begin(), m_channels.end(), chanid);

if (chanid && cit != m_channels.end())
if ((chanid != 0U) && (cit != m_channels.end()))
{
if (!setchan)
{
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/dtvchannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ QString DTVChannel::GetSuggestedTuningMode(bool is_live_tv) const
if (m_inputId && !input.isEmpty())
quickTuning = CardUtil::GetQuickTuning(m_inputId, input);

bool useQuickTuning = (quickTuning && is_live_tv) || (quickTuning > 1);
bool useQuickTuning = ((quickTuning != 0U) && is_live_tv) || (quickTuning > 1);

QMutexLocker locker(&m_dtvinfo_lock);
if (!useQuickTuning && ((m_sistandard == "atsc") || (m_sistandard == "dvb")))
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/recorderbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ void RecorderBase::FrameRateChange(uint framerate, long long frame)
{
// Populate the recordfile table as early as possible, the average
// value will be determined when the recording completes.
if (!m_curRecording->GetRecordingFile()->m_videoFrameRate)
if (m_curRecording->GetRecordingFile()->m_videoFrameRate == 0.0)
{
m_curRecording->GetRecordingFile()->m_videoFrameRate = (double)framerate / 1000.0;
m_curRecording->GetRecordingFile()->Save();
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/recorderbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class FrameRate
public:
explicit FrameRate(uint n, uint d=1) : m_num(n), m_den(d) {}
double toDouble(void) const { return m_num / (double)m_den; }
bool isNonzero(void) const { return m_num; }
bool isNonzero(void) const { return m_num != 0U; }
uint getNum(void) const { return m_num; }
uint getDen(void) const { return m_den; }
QString toString(void) const { return QString("%1/%2").arg(m_num).arg(m_den); }
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/streamhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ bool StreamHandler::UpdateFiltersFromStreamData(void)
// PIDs that need to be added..
for (auto lit = pids.constBegin(); lit != pids.constEnd(); ++lit)
{
if (*lit && (m_pidInfo.find(lit.key()) == m_pidInfo.end()))
if ((*lit != 0U) && (m_pidInfo.find(lit.key()) == m_pidInfo.end()))
{
add_pids[lit.key()] = CreatePIDInfo(
lit.key(), StreamID::PrivSec, 0);
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/recordinginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ void RecordingInfo::clone(const RecordingInfo &other,
bool ignore_non_serialized_data)
{
bool is_same =
(m_chanId && m_recStartTs.isValid() && m_startTs.isValid() &&
((m_chanId != 0U) && m_recStartTs.isValid() && m_startTs.isValid() &&
m_chanId == other.GetChanID() &&
m_recStartTs == other.GetRecordingStartTime() &&
m_startTs == other.GetScheduledStartTime());
Expand Down Expand Up @@ -402,7 +402,7 @@ void RecordingInfo::clone(const ProgramInfo &other,
bool ignore_non_serialized_data)
{
bool is_same =
(m_chanId && m_recStartTs.isValid() && m_startTs.isValid() &&
((m_chanId != 0U) && m_recStartTs.isValid() && m_startTs.isValid() &&
m_chanId == other.GetChanID() &&
m_recStartTs == other.GetRecordingStartTime() &&
m_startTs == other.GetScheduledStartTime());
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/sourceutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ bool SourceUtil::IsProperlyConnected(uint sourceid, bool strict)
}

bool tune_mismatch =
(counts["ANALOG_TUNING"] && counts["DIGITAL_TUNING"]) ||
(counts["VIRTUAL_TUNING"] && counts["DIGITAL_TUNING"]);
bool enc_mismatch = counts["ENCODER"] && counts["NOT_ENCODER"];
bool scan_mismatch = counts["SCAN"] && counts["NO_SCAN"];
((counts["ANALOG_TUNING"] != 0U) && (counts["DIGITAL_TUNING"] != 0U)) ||
((counts["VIRTUAL_TUNING"] != 0U) && (counts["DIGITAL_TUNING"] != 0U));
bool enc_mismatch = (counts["ENCODER"] != 0U) && (counts["NOT_ENCODER"] != 0U);
bool scan_mismatch = (counts["SCAN"] != 0U) && (counts["NO_SCAN"] != 0U);

if (tune_mismatch)
{
Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmythtv/tv_play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4878,7 +4878,7 @@ bool TV::ActivePostQHandleAction(PlayerContext *ctx, const QStringList &actions)
if (!CommitQueuedInput(ctx))
{
ctx->LockDeletePlayer(__FILE__, __LINE__);
SetBookmark(ctx, ctx->m_player->GetBookmark());
SetBookmark(ctx, ctx->m_player->GetBookmark() != 0U);
ctx->UnlockDeletePlayer(__FILE__, __LINE__);
}
}
Expand Down Expand Up @@ -6422,7 +6422,7 @@ void TV::UpdateNavDialog(PlayerContext *ctx)
osdInfo info;
ctx->LockDeletePlayer(__FILE__, __LINE__);
bool paused = (ctx->m_player
&& (ctx->m_ffRewState || ctx->m_ffRewSpeed != 0
&& ((ctx->m_ffRewState != 0) || (ctx->m_ffRewSpeed != 0)
|| ctx->m_player->IsPaused()));
ctx->UnlockDeletePlayer(__FILE__, __LINE__);
info.text["paused"] = (paused ? "Y" : "N");
Expand Down Expand Up @@ -6739,7 +6739,7 @@ void TV::ChangeSpeed(PlayerContext *ctx, int direction)

ctx->LockDeletePlayer(__FILE__, __LINE__);
if (ctx->m_player && !ctx->m_player->Play(
(!ctx->m_ffRewSpeed) ? ctx->m_tsNormal: speed, !ctx->m_ffRewSpeed))
(!ctx->m_ffRewSpeed) ? ctx->m_tsNormal: speed, ctx->m_ffRewSpeed == 0))
{
ctx->m_ffRewSpeed = old_speed;
ctx->UnlockDeletePlayer(__FILE__, __LINE__);
Expand Down Expand Up @@ -7722,7 +7722,7 @@ void TV::ChangeChannel(PlayerContext *ctx, uint chanid, const QString &chan)
}
foreach (const auto & rec, tmp)
{
if (!chanid || tunable_on.contains(rec.toUInt()))
if ((chanid == 0U) || tunable_on.contains(rec.toUInt()))
reclist.push_back(rec);
}
}
Expand Down Expand Up @@ -7786,7 +7786,7 @@ void TV::ChangeChannel(PlayerContext *ctx, uint chanid, const QString &chan)
if (ctx->m_player)
ctx->m_player->GetAudio()->Reset();

UnpauseLiveTV(ctx, chanid && GetQueuedChanID());
UnpauseLiveTV(ctx, (chanid != 0U) && (GetQueuedChanID() != 0U));

if (oldinputname != ctx->m_recorder->GetInput())
UpdateOSDInput(ctx);
Expand Down Expand Up @@ -11945,7 +11945,7 @@ void TV::PlaybackMenuInit(const MenuBase &menu)
m_tvmIsDvd = (m_tvmState == kState_WatchingDVD);
m_tvmIsBd = (ctx->m_buffer && ctx->m_buffer->IsBD() &&
ctx->m_buffer->BD()->IsHDMVNavigation());
m_tvmJump = (!m_tvmNumChapters && !m_tvmIsDvd &&
m_tvmJump = ((m_tvmNumChapters == 0) && !m_tvmIsDvd &&
!m_tvmIsBd && ctx->m_buffer &&
ctx->m_buffer->IsSeekingAllowed());
m_tvmIsLiveTv = StateIsLiveTV(m_tvmState);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/videocolourspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ VideoColourSpace::VideoColourSpace(VideoColourSpace *Parent)
SetContrast(m_dbSettings[kPictureAttribute_Contrast]);
SetSaturation(m_dbSettings[kPictureAttribute_Colour]);
SetHue(m_dbSettings[kPictureAttribute_Hue]);
SetFullRange(m_dbSettings[kPictureAttribute_Range]);
SetFullRange(m_dbSettings[kPictureAttribute_Range] != 0);
if (HasMythMainWindow())
{
MythDisplay* display = MythDisplay::AcquireRelease();
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/videodisplayprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ uint VideoDisplayProfile::GetMaxCPUs(void) const

bool VideoDisplayProfile::IsSkipLoopEnabled(void) const
{
return GetPreference("pref_skiploop").toInt();
return GetPreference("pref_skiploop").toInt() != 0;
}

QString VideoDisplayProfile::GetVideoRenderer(void) const
Expand Down
10 changes: 5 additions & 5 deletions mythtv/libs/libmythtv/videosource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ class VBIDevice : public CaptureCardComboBoxSetting
if (!(count = fillSelectionsFromDir(dev, card, driver)))
{
dev.setPath("/dev");
if (!(count = fillSelectionsFromDir(dev, card, driver)) &&
if (((count = fillSelectionsFromDir(dev, card, driver)) == 0U) &&
!getValue().isEmpty())
{
addSelection(getValue(),getValue(),true);
Expand Down Expand Up @@ -1199,7 +1199,7 @@ class DVBTuningDelay : public CaptureCardSpinBoxSetting
{
setValue("0");
setLabel(QObject::tr("DVB tuning delay (ms)"));
setValue(true);
setValue(static_cast<int>(true));
setHelpText(
QObject::tr("Some Linux DVB drivers, in particular for the "
"Hauppauge Nova-T, require that we slow down "
Expand Down Expand Up @@ -1857,7 +1857,7 @@ void ASIConfigurationGroup::probeCard(const QString &device)
return;
}

if (m_parent.getCardID() && m_parent.GetRawCardType() != "ASI")
if ((m_parent.getCardID() != 0) && m_parent.GetRawCardType() != "ASI")
{
m_cardInfo->setValue("");
return;
Expand Down Expand Up @@ -2876,7 +2876,7 @@ void InputGroup::Load(void)
while (query.next())
{
uint groupid = query.value(1).toUInt();
if (inputid && (query.value(0).toUInt() == inputid))
if ((inputid != 0U) && (query.value(0).toUInt() == inputid))
selected_groupids.push_back(groupid);

grpcnt[groupid]++;
Expand Down Expand Up @@ -3720,7 +3720,7 @@ void DVBConfigurationGroup::probeCard(const QString &videodevice)
return;
}

if (m_parent.getCardID() && m_parent.GetRawCardType() != "DVB")
if ((m_parent.getCardID() != 0) && m_parent.GetRawCardType() != "DVB")
{
m_cardName->setValue("");
m_cardType->setValue("");
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/visualisations/goom/ifs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ Trace (FRACTAL * F, F_PT xo, F_PT yo)
F_PT y = NAN;

SIMI *Cur = Cur_F->m_components;
for (F_PT i = Cur_F->m_nbSimi; i; --i, Cur++) {
for (int i = Cur_F->m_nbSimi; i != 0; --i, Cur++) {
Transform (Cur, xo, yo, &x, &y);

Buf->x = F->m_lx + ((x * F->m_lx) / (UNIT*2) );
Expand All @@ -365,7 +365,7 @@ Trace (FRACTAL * F, F_PT xo, F_PT yo)

Cur_Pt++;

if (F->m_depth && ((x - xo) / 16) && ((y - yo) / 16)) {
if (F->m_depth && (((x - xo) / 16) != 0.0F) && (((y - yo) / 16) != 0.0F)) {
F->m_depth--;
Trace (F, x, y);
F->m_depth++;
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/xine_demux_sputext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static inline void trail_space(char *s) {
// NOLINTNEXTLINE(clang-analyzer-core.uninitialized.Assign)
copy[0] = copy[1];
copy++;
} while(*copy);
} while(*copy != 0);
}
int i = strlen(s) - 1;
while (i > 0 && isspace(s[i]))
Expand Down Expand Up @@ -409,7 +409,7 @@ static subtitle_t *sub_read_line_subrip(demux_sputext_t *demuxstr,subtitle_t *cu
}
}
}
} while(i<SUB_MAX_TEXT && !end_sub);
} while(i<SUB_MAX_TEXT && (end_sub == 0));
if(i>=SUB_MAX_TEXT)
printf("Too many lines in a subtitle\n");
current->lines=i;
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythui/devices/mythcecadapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,15 +708,15 @@ void MythCECAdapter::HandleActions(MythCECActions Actions)
return;

// power state
if ((Actions & PowerOffTV) && m_powerOffTVAllowed)
if (((Actions & PowerOffTV) != 0U) && m_powerOffTVAllowed)
{
if (m_adapter->StandbyDevices(CECDEVICE_TV))
LOG(VB_GENERAL, LOG_INFO, LOC + "Asked TV to turn off.");
else
LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to turn TV off.");
}

if ((Actions & PowerOnTV) && m_powerOnTVAllowed)
if (((Actions & PowerOnTV) != 0U) && m_powerOnTVAllowed)
{
if (m_adapter->PowerOnDevices(CECDEVICE_TV))
LOG(VB_GENERAL, LOG_INFO, LOC + "Asked TV to turn on.");
Expand All @@ -725,7 +725,7 @@ void MythCECAdapter::HandleActions(MythCECActions Actions)
}

// HDMI input
if ((Actions & SwitchInput) && m_switchInputAllowed)
if (((Actions & SwitchInput) != 0U) && m_switchInputAllowed)
{
if (m_adapter->SetActiveSource())
LOG(VB_GENERAL, LOG_INFO, LOC + "Asked TV to switch to this input.");
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythui/mythedid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ bool MythEDID::ParseBaseBlock(const quint8 *Data)
// Note - the EDID format introduces slight rounding errors when converting
// to sRGB specs. If sRGB is set, the client should use the spec values - not
// the computed values
m_sRGB = Data[FEATURES_OFFSET] & 0x04;
m_sRGB = ((Data[FEATURES_OFFSET] & 0x04) != 0);
static const unsigned char s_sRGB[10] =
{ 0xEE, 0x91, 0xA3, 0x54, 0x4C, 0x99, 0x26, 0x0F, 0x50, 0x54 };
bool srgb = memcmp(Data + 0x19, s_sRGB, sizeof(s_sRGB)) == 0;
Expand Down Expand Up @@ -340,8 +340,8 @@ bool MythEDID::ParseVSDB(const quint8 *Data, uint Offset, uint Length)
break;

// Audio and video latencies
m_latencies = (Data[Offset + 7] & 0x80);
m_interLatencies = (Data[Offset + 7] & 0x40) && m_latencies;
m_latencies = ((Data[Offset + 7] & 0x80) != 0);
m_interLatencies = ((Data[Offset + 7] & 0x40) != 0) && m_latencies;

if (Length < 10 || (Offset + 10 >= m_size))
break;
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythui/opengl/mythrenderopengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ MythRenderOpenGL::~MythRenderOpenGL()
void MythRenderOpenGL::messageLogged(const QOpenGLDebugMessage &Message)
{
// filter unwanted messages
if (m_openGLDebuggerFilter & Message.type())
if ((m_openGLDebuggerFilter & Message.type()) != 0U)
return;

QString source("Unknown");
Expand Down Expand Up @@ -647,7 +647,7 @@ MythGLTexture* MythRenderOpenGL::CreateTextureFromQImage(QImage *Image)

QSize MythRenderOpenGL::GetTextureSize(const QSize &size, bool Normalised)
{
if ((m_features & NPOTTextures) || !Normalised)
if (((m_features & NPOTTextures) != 0U) || !Normalised)
return size;

int w = 64;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythui/platforms/mythdisplayx11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const std::vector<MythDisplayMode>& MythDisplayX11::GetVideoModes(void)
int width = static_cast<int>(mode.width);
int height = static_cast<int>(mode.height);
double rate = static_cast<double>(mode.dotClock) / (mode.vTotal * mode.hTotal);
bool interlaced = mode.modeFlags & RR_Interlace;
bool interlaced = (mode.modeFlags & RR_Interlace) != 0U;
if (interlaced)
rate *= 2.0;

Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythui/screensaver-x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class ScreenSaverX11Private
{
int dummy0 = 0;
int dummy1 = 0;
m_dpmsaware = DPMSQueryExtension(m_display->GetDisplay(),
&dummy0, &dummy1);
m_dpmsaware = (DPMSQueryExtension(m_display->GetDisplay(),
&dummy0, &dummy1) != 0);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythbackend/encoderlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class EncoderLink
/// \brief Returns true if the encoder is awake.
bool IsAwake(void) const { return (m_sleepStatus == sStatus_Awake); }
/// \brief Returns true if the encoder is asleep.
bool IsAsleep(void) const { return (m_sleepStatus & sStatus_Asleep); }
bool IsAsleep(void) const { return (m_sleepStatus & sStatus_Asleep) != 0; }
/// \brief Returns true if the encoder is waking up.
bool IsWaking(void) const { return (m_sleepStatus == sStatus_Waking); }
/// \brief Returns true if the encoder is falling asleep.
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythcommflag/ClassicCommDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ bool ClassicCommDetector::go()
{
float elapsed = flagTime.elapsed() / 1000.0;

if (elapsed)
if (elapsed != 0.0F)
flagFPS = currentFrameNumber / elapsed;
else
flagFPS = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythcommflag/PrePostRollFlagger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ long long PrePostRollFlagger::findBreakInrange(long long startFrame,
float elapsed = flagTime.elapsed() / 1000.0;

float flagFPS = 0.0F;
if (elapsed)
if (elapsed != 0.0F)
flagFPS = framesProcessed / elapsed;

int percentage = 0;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Action
/// \return true on success, false otherwise.
bool RemoveKey(const QString &key)
{
return m_keys.removeAll(key);
return m_keys.removeAll(key) != 0;
}

// Gets
Expand Down
38 changes: 19 additions & 19 deletions mythtv/programs/mythfrontend/customedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,48 +165,48 @@ QString CustomEdit::evaluate(QString clause)
QString mid = clause.mid(s0 + 1, e0 - s0 - 1);
QString repl = "";

if (!mid.compare("TITLE")) {
if (mid.compare("TITLE") == 0) {
repl = m_pginfo->GetTitle();
repl.replace("\'","\'\'");
} else if (!mid.compare("SUBTITLE")) {
} else if (mid.compare("SUBTITLE") == 0) {
repl = m_pginfo->GetSubtitle();
repl.replace("\'","\'\'");
} else if (!mid.compare("DESCR")) {
} else if (mid.compare("DESCR") == 0) {
repl = m_pginfo->GetDescription();
repl.replace("\'","\'\'");
} else if (!mid.compare("SERIESID")) {
} else if (mid.compare("SERIESID") == 0) {
repl = QString("%1").arg(m_pginfo->GetSeriesID());
} else if (!mid.compare("PROGID")) {
} else if (mid.compare("PROGID") == 0) {
repl = m_pginfo->GetProgramID();
} else if (!mid.compare("SEASON")) {
} else if (mid.compare("SEASON") == 0) {
repl = QString::number(m_pginfo->GetSeason());
} else if (!mid.compare("EPISODE")) {
} else if (mid.compare("EPISODE") == 0) {
repl = QString::number(m_pginfo->GetEpisode());
} else if (!mid.compare("CATEGORY")) {
} else if (mid.compare("CATEGORY") == 0) {
repl = m_pginfo->GetCategory();
} else if (!mid.compare("CHANID")) {
} else if (mid.compare("CHANID") == 0) {
repl = QString("%1").arg(m_pginfo->GetChanID());
} else if (!mid.compare("CHANNUM")) {
} else if (mid.compare("CHANNUM") == 0) {
repl = m_pginfo->GetChanNum();
} else if (!mid.compare("SCHEDID")) {
} else if (mid.compare("SCHEDID") == 0) {
repl = m_pginfo->GetChannelSchedulingID();
} else if (!mid.compare("CHANNAME")) {
} else if (mid.compare("CHANNAME") == 0) {
repl = m_pginfo->GetChannelName();
} else if (!mid.compare("DAYNAME")) {
} else if (mid.compare("DAYNAME") == 0) {
repl = m_pginfo->GetScheduledStartTime().toString("dddd");
} else if (!mid.compare("STARTDATE")) {
} else if (mid.compare("STARTDATE") == 0) {
repl = m_pginfo->GetScheduledStartTime().toString("yyyy-mm-dd hh:mm:ss");
} else if (!mid.compare("ENDDATE")) {
} else if (mid.compare("ENDDATE") == 0) {
repl = m_pginfo->GetScheduledEndTime().toString("yyyy-mm-dd hh:mm:ss");
} else if (!mid.compare("STARTTIME")) {
} else if (mid.compare("STARTTIME") == 0) {
repl = m_pginfo->GetScheduledStartTime().toString("hh:mm");
} else if (!mid.compare("ENDTIME")) {
} else if (mid.compare("ENDTIME") == 0) {
repl = m_pginfo->GetScheduledEndTime().toString("hh:mm");
} else if (!mid.compare("STARTSEC")) {
} else if (mid.compare("STARTSEC") == 0) {
QDateTime date = m_pginfo->GetScheduledStartTime();
QDateTime midnight = QDateTime(date.date());
repl = QString("%1").arg(midnight.secsTo(date));
} else if (!mid.compare("ENDSEC")) {
} else if (mid.compare("ENDSEC") == 0) {
QDateTime date = m_pginfo->GetScheduledEndTime();
QDateTime midnight = QDateTime(date.date());
repl = QString("%1").arg(midnight.secsTo(date));
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/statusbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ void StatusBox::doMachineStatus()
continue;
if (!(f & QNetworkInterface::IsRunning))
continue;
if (f & QNetworkInterface::IsLoopBack)
if ((f & QNetworkInterface::IsLoopBack) != 0U)
continue;

#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythpreviewgen/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int preview_helper(uint chanid, QDateTime starttime,
if (setpriority(PRIO_PROCESS, 0, 9))
LOG(VB_GENERAL, LOG_ERR, "Setting priority failed." + ENO);

if (!QFileInfo(infile).isReadable() && (!chanid || !starttime.isValid()))
if (!QFileInfo(infile).isReadable() && ((chanid == 0U) || !starttime.isValid()))
ProgramInfo::QueryKeyFromPathname(infile, chanid, starttime);

ProgramInfo *pginfo = nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ int dummy_delete(dummy_buffer *dbuf, uint64_t time)
sizeof(uint32_t));
dsize += size;
} else ex = 1;
} while (!ex);
} while (ex == 0);
#if 0
LOG(VB_GENERAL, LOG_INFO, QString("delete %1 ").arg(dummy_space(dbuf)));
#endif
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythtranscode/transcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@ int Transcode::TranscodeFile(const QString &inputname,

float flagFPS = 0.0;
float elapsed = flagTime.elapsed() / 1000.0;
if (elapsed)
if (elapsed != 0.0F)
flagFPS = curFrameNum / elapsed;

total_frame_count = GetPlayer()->GetCurrentFrameCount();
Expand Down