Skip to content

Commit

Permalink
cppcheck: Fix non-boolean return value from boolean function warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdude42 committed Apr 4, 2019
1 parent 7d0337e commit d2bb607
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 45 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmythbase/zipentry_p.h
Expand Up @@ -71,8 +71,8 @@ class ZipEntryP

bool lhEntryChecked; // Is true if the local header record for this entry has been parsed

inline bool isEncrypted() const { return gpFlag[0] & 0x01; }
inline bool hasDataDescriptor() const { return gpFlag[0] & 0x08; }
inline bool isEncrypted() const { return ( gpFlag[0] & 0x01 ) != 0; }
inline bool hasDataDescriptor() const { return ( gpFlag[0] & 0x08 ) != 0; }
};

#endif // OSDAB_ZIPENTRY_P__H
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/channelutil.h
Expand Up @@ -33,8 +33,8 @@ class pid_cache_item_t
uint GetTableID(void) const
{ return (m_sid_tid&0x100) ? 0 : GetID(); }
uint GetID(void) const { return m_sid_tid & 0xff; }
bool IsPCRPID(void) const { return m_sid_tid&0x200; }
bool IsPermanent(void) const { return m_sid_tid&0x10000; }
bool IsPCRPID(void) const { return ( m_sid_tid&0x200 ) != 0; }
bool IsPermanent(void) const { return ( m_sid_tid&0x10000 ) != 0; }
uint GetComposite(void) const { return m_sid_tid; }
private:
uint m_pid {0};
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mpeg/atsctables.h
Expand Up @@ -732,7 +732,7 @@ class MTV_PUBLIC SystemTimeTable : public PSIPTable
// reserved 2 14.1 3
// DS_day_of_month 5 14.3
// DS_hour 8 15.0
bool InDaylightSavingsTime() const { return pesdata()[14]&0x80; }
bool InDaylightSavingsTime() const { return ( pesdata()[14]&0x80 ) != 0; }
uint DayDaylightSavingsStarts() const { return pesdata()[14]&0x1f; }
uint HourDaylightSavingsStarts() const { return pesdata()[15]; }
// for (I = 0;I< N;I++) { descriptor() }
Expand Down
18 changes: 9 additions & 9 deletions mythtv/libs/libmythtv/mpeg/dvbdescriptors.h
Expand Up @@ -184,9 +184,9 @@ class LinkageDescriptor : public MPEGDescriptor
// target_event_id 16 9.0
uint TargetEventID(void) const { return (_data[9]<<8) | _data[10]; }
// target_listed 1 11.0
bool IsTargetListed(void) const { return _data[11]&0x80; }
bool IsTargetListed(void) const { return ( _data[11]&0x80 ) != 0; }
// event_simulcast 1 11.1
bool IsEventSimulcast(void) const { return _data[11]&0x40; }
bool IsEventSimulcast(void) const { return ( _data[11]&0x40 ) != 0; }
// reserved 6 11.2
// }
// for (i=0;i<N;i++)
Expand Down Expand Up @@ -819,7 +819,7 @@ class SatelliteDeliverySystemDescriptor : public MPEGDescriptor
double OrbitalPositionFloat() const
{ return ((double) OrbitalPosition()) / 10.0; }
/// west_east_flag 1 8.0
bool IsEast(void) const { return (_data[8]&0x80); }
bool IsEast(void) const { return ( (_data[8]&0x80) ) != 0; }
bool IsWest(void) const { return !IsEast(); }
// polarization 2 8.1
uint Polarization(void) const { return (_data[8]>>5)&0x3; }
Expand Down Expand Up @@ -931,7 +931,7 @@ class TerrestrialDeliverySystemDescriptor : public MPEGDescriptor
return (Bandwidth() <= kBandwidth5Mhz) ? bs[Bandwidth()] : "auto";
}
// priority 1 6.3
bool HighPriority(void) const { return _data[6] & 0x10; }
bool HighPriority(void) const { return ( _data[6] & 0x10 ) != 0; }
// time_slicing_indicator 1 6.4
bool IsTimeSlicingIndicatorUsed(void) const { return !(_data[6] & 0x08); }
// MPE-FEC_indicator 1 6.5
Expand Down Expand Up @@ -972,7 +972,7 @@ class TerrestrialDeliverySystemDescriptor : public MPEGDescriptor
static QString hs[] = { "n", "1", "2", "4", "a", "a", "a", "a" };
return hs[Hierarchy()];
}
bool NativeInterleaver(void) const { return _data[7] & 0x20; }
bool NativeInterleaver(void) const { return ( _data[7] & 0x20 ) != 0; }
uint Alpha(void) const
{
uint i = (_data[7]>>3) & 0x3;
Expand Down Expand Up @@ -1987,13 +1987,13 @@ class AC3Descriptor : public MPEGDescriptor
// descriptor_length 8 1.0

// component_type_flag 1 2.0
bool HasComponentType(void) const { return _data[2] & 0x80; }
bool HasComponentType(void) const { return ( _data[2] & 0x80 ) != 0; }
// bsid_flag 1 2.1
bool HasBSID(void) const { return _data[2] & 0x40; }
bool HasBSID(void) const { return ( _data[2] & 0x40 ) != 0; }
// mainid_flag 1 2.2
bool HasMainID(void) const { return _data[2] & 0x20; }
bool HasMainID(void) const { return ( _data[2] & 0x20 ) != 0; }
// asvc_flag 1 2.3
bool HasASVC(void) const { return _data[2] & 0x10; }
bool HasASVC(void) const { return ( _data[2] & 0x10 ) != 0; }
// reserved_flags 4 2.4
// if (component_type_flag == 1)
// { component_type 8 uimsbf }
Expand Down
16 changes: 8 additions & 8 deletions mythtv/libs/libmythtv/mpeg/mpegdescriptors.h
Expand Up @@ -358,21 +358,21 @@ class AVCVideoDescriptor : public MPEGDescriptor
// profile_idc 8 2.0
uint ProfileIDC(void) const { return _data[2]; }
// constraint_set0_flag 1 3.0
bool ConstaintSet0(void) const { return _data[3]&0x80; }
bool ConstaintSet0(void) const { return ( _data[3]&0x80 ) != 0; }
// constraint_set1_flag 1 3.1
bool ConstaintSet1(void) const { return _data[3]&0x40; }
bool ConstaintSet1(void) const { return ( _data[3]&0x40 ) != 0; }
// constraint_set2_flag 1 3.2
bool ConstaintSet2(void) const { return _data[3]&0x20; }
bool ConstaintSet2(void) const { return ( _data[3]&0x20 ) != 0; }
// AVC_compatible_flags 5 3.3
uint AVCCompatible(void) const { return _data[3]&0x1f; }
// level_idc 8 4.0
uint LevelIDC(void) const { return _data[4]; }
// AVC_still_present 1 5.0
bool AVCStill(void) const { return _data[5]&0x80; }
bool AVCStill(void) const { return ( _data[5]&0x80 ) != 0; }
// AVC_24_hour_picture_flag 1 5.1
bool AVC24HourPicture(void) const { return _data[5]&0x40; }
bool AVC24HourPicture(void) const { return ( _data[5]&0x40 ) != 0; }
bool FramePackingSEINotPresentFlag(void)
const { return _data[5]&0x20; }
const { return ( _data[5]&0x20 ) != 0; }
// reserved 6 bslbf
QString toString() const override; // MPEGDescriptor
};
Expand All @@ -387,7 +387,7 @@ class AVCTimingAndHRDDescriptor : public MPEGDescriptor
// descriptor_tag 8 0.0 0x
// descriptor_length 8 1.0
// hrd_management_valid 1 2.0
bool HRDManagementValid(void) const { return _data[2]&0x80; }
bool HRDManagementValid(void) const { return ( _data[2]&0x80 ) != 0; }
// reserved 6 2.1
// picture_and_timing_info_present 1 2.7
bool HasPictureAndTimingInfo(void) const { return _data[2]&0x01;}
Expand Down Expand Up @@ -420,7 +420,7 @@ class HEVCVideoDescriptor : public MPEGDescriptor
// profile_space 2 2.0
uint ProfileSpace(void) const { return _data[2]&0xC0 >> 6; }
// tier_flag 1 2.2
bool Tier(void) const { return _data[2]&0x20; }
bool Tier(void) const { return ( _data[2]&0x20 ) != 0; }
// profile_idc 5 2.3
uint ProfileIDC(void) const { return _data[2] >> 3; }
// profile_compatibility_indication 32 3.0
Expand Down
20 changes: 10 additions & 10 deletions mythtv/libs/libmythtv/mpeg/mpegtables.h
Expand Up @@ -479,9 +479,9 @@ class MTV_PUBLIC PSIPTable : public PESPacket
uint TableID(void) const { return StreamID(); }

// section_syntax_ind 1 1.0 8 ATSC -- should always be 1
bool SectionSyntaxIndicator(void) const { return pesdata()[1] & 0x80; }
bool SectionSyntaxIndicator(void) const { return ( pesdata()[1] & 0x80 ) != 0; }
// private_indicator 1 1.1 9
bool PrivateIndicator(void) const { return pesdata()[1] & 0x40; }
bool PrivateIndicator(void) const { return ( pesdata()[1] & 0x40 ) != 0; }
// reserved 2 1.2 10

// section_length 12 1.4 12 always less than 0x3fd
Expand Down Expand Up @@ -853,7 +853,7 @@ class MTV_PUBLIC SpliceTimeView
public:
explicit SpliceTimeView(const unsigned char *data) : _data(data) { }
// time_specified_flag 1 0.0
bool IsTimeSpecified(void) const { return _data[0] & 0x80; }
bool IsTimeSpecified(void) const { return ( _data[0] & 0x80 ) != 0; }
// if (time_specified_flag == 1)
// reserved 6 0.1
// pts_time 33 0.6
Expand Down Expand Up @@ -941,17 +941,17 @@ class MTV_PUBLIC SpliceInsertView
(_ptrs1[0][2] << 8) | (_ptrs1[0][3]));
}
// splice_event_cancel 1 4.0 + _ptrs1[0]
bool IsSpliceEventCancel(void) const { return _ptrs1[0][4] & 0x80; }
bool IsSpliceEventCancel(void) const { return ( _ptrs1[0][4] & 0x80 ) != 0; }
// reserved 7 4.1 + _ptrs1[0]
// if (splice_event_cancel_indicator == 0) {
// out_of_network_flag 1 5.0 + _ptrs1[0]
bool IsOutOfNetwork(void) const { return _ptrs1[0][5] & 0x80; }
bool IsOutOfNetwork(void) const { return ( _ptrs1[0][5] & 0x80 ) != 0; }
// program_splice_flag 1 5.1 + _ptrs1[0]
bool IsProgramSplice(void) const { return _ptrs1[0][5] & 0x40; }
bool IsProgramSplice(void) const { return ( _ptrs1[0][5] & 0x40 ) != 0; }
// duration_flag 1 5.2 + _ptrs1[0]
bool IsDuration(void) const { return _ptrs1[0][5] & 0x20; }
bool IsDuration(void) const { return ( _ptrs1[0][5] & 0x20 ) != 0; }
// splice_immediate_flag 1 5.3 + _ptrs1[0]
bool IsSpliceImmediate(void) const { return _ptrs1[0][5] & 0x20; }
bool IsSpliceImmediate(void) const { return ( _ptrs1[0][5] & 0x20 ) != 0; }
// reserved 4 5.4 + _ptrs1[0]
// if ((program_splice_flag == 1) && (splice_immediate_flag == ‘0’))
// splice_time() 8-38 6.0 + _ptrs1[0]
Expand Down Expand Up @@ -1019,7 +1019,7 @@ class MTV_PUBLIC SpliceInformationTable : public PSIPTable
uint SpliceProtocolVersion(void) const { return pesdata()[3]; }
void SetSpliceProtocolVersion(uint ver) { pesdata()[3] = ver; }
// encrypted_packet 1 4.0
bool IsEncryptedPacket(void) const { return pesdata()[4] & 0x80; }
bool IsEncryptedPacket(void) const { return ( pesdata()[4] & 0x80 ) != 0; }
void SetEncryptedPacket(bool val)
{
pesdata()[4] = (pesdata()[4] & ~0x80) | ((val) ? 0x80 : 0);
Expand Down Expand Up @@ -1189,7 +1189,7 @@ class MTV_PUBLIC AdaptationFieldControl
/** discontinuity_indicator
* (time base may change) 1 1.0
*/
bool Discontinuity(void) const { return _data[1] & 0x80; }
bool Discontinuity(void) const { return ( _data[1] & 0x80 ) != 0; }
// random_access_indicator (?) 1 1.1
bool RandomAccess(void) const { return bool(_data[1] & 0x40); }
// elementary_stream_priority_indicator 1 1.2
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/mpeg/sctedescriptors.h
Expand Up @@ -38,7 +38,7 @@ class FrameRateDescriptor : public MPEGDescriptor
// descriptor_tag 8 0.0 0x82
// descriptor_length 8 1.0
// multiple_frame_rate_flag 1 2.0
bool MultipleFrameRates(void) const { return _data[2] & 0x80; }
bool MultipleFrameRates(void) const { return ( _data[2] & 0x80 ) != 0; }
// frame_rate_code 4 2.1
uint FrameRateCode(void) const { return (_data[2] >> 3) & 0xF; }
/// returns maximum frame rate in video
Expand Down Expand Up @@ -88,9 +88,9 @@ class ExtendedVideoDescriptor : public MPEGDescriptor
// descriptor_tag 8 0.0 0x83
// descriptor_length 8 1.0
// catalog_mode_flag 1 2.0
bool CatalogModeFlag(void) const { return _data[2] & 0x80; }
bool CatalogModeFlag(void) const { return ( _data[2] & 0x80 ) != 0; }
// video_includes_setup 1 2.1
bool VideoIncludesSetup(void) const { return _data[2] & 0x40; }
bool VideoIncludesSetup(void) const { return ( _data[2] & 0x40 ) != 0; }
// reserved 6 2.2

QString toString(void) const override // MPEGDescriptor
Expand Down Expand Up @@ -188,7 +188,7 @@ class FrequencySpecificationDescriptor : public MPEGDescriptor
// descriptor_tag 8 0.0 0x90
// descriptor_length 8 1.0
// frequency_unit 1 2.0
bool FrequencyUnit(void) const { return _data[2] & 0x80; }
bool FrequencyUnit(void) const { return ( _data[2] & 0x80 ) != 0; }
uint FrequencyUnitHz(void) const
{ return FrequencyUnit() ? 10000 : 125000; }
// carrier_frequency 15 2.1
Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmythtv/mpeg/sctetables.h
Expand Up @@ -130,7 +130,7 @@ class ModulationModeSubtable
uint InnerCodingMode(void) const { return _beg[0] & 0xf; }
QString InnerCodingModeString(void) const;
// split_bitstream_mode 1 1.0+_beg
bool SplitBitstreamMode(void) const { return _beg[1] & 0x80; }
bool SplitBitstreamMode(void) const { return ( _beg[1] & 0x80 ) != 0; }
// zero 2 1.1+_beg
// modulation_format 5 1.3+_beg
enum // Table 5.9
Expand Down Expand Up @@ -335,7 +335,7 @@ class MTV_PUBLIC DefinedChannelsMapSubtable
uint DCMDataLength(void) const { return _data[9] & 0x7f; }
// for (i=0; i<DCM_data_length; i++) {
// range_defined 1 10.0+i
bool RangeDefined(uint i) const { return _data[10+i] & 0x80; }
bool RangeDefined(uint i) const { return ( _data[10+i] & 0x80 ) != 0; }
// channels_count 7 10.1+i
uint ChannelsCount(uint i) const { return _data[10+i] & 0x7f; }
// }
Expand All @@ -356,10 +356,10 @@ class VirtualChannelMapSubtable

// zero 2 7.0
// descriptors_included 1 7.2
bool DescriptorsIncluded(void) const { return _data[7] & 0x20; }
bool DescriptorsIncluded(void) const { return ( _data[7] & 0x20 ) != 0; }
// zero 5 7.3
// splice 1 8.0
bool Splice(void) const { return _data[8] & 0x80; }
bool Splice(void) const { return ( _data[8] & 0x80 ) != 0; }
// zero 7 8.1
// activation_time 32 9.0
uint ActivationTimeRaw(void) const
Expand Down Expand Up @@ -389,7 +389,7 @@ class VirtualChannelMapSubtable
uint VirtualChannelNumber(uint i) const
{ return ((_ptrs[i][0]<<8) | _ptrs[i][1]) & 0xfff; }
// application_virtual_channel 1 2.0+_ptrs[i]
bool ApplicationVirtualChannel(uint i) const { return _ptrs[i][1] & 0x80; }
bool ApplicationVirtualChannel(uint i) const { return ( _ptrs[i][1] & 0x80 ) != 0; }
// zero 1 2.1+_ptrs[i]
// path_select 1 2.2+_ptrs[i]
enum // Table 5.18 path select
Expand Down Expand Up @@ -436,7 +436,7 @@ class VirtualChannelMapSubtable
// } else {
// CDS_reference 8 5.0+_ptrs[i]
// scrambled 1 6.0+_ptrs[i]
bool Scrambled(uint i) const { return _ptrs[i][6] & 0x80; }
bool Scrambled(uint i) const { return ( _ptrs[i][6] & 0x80 ) != 0; }
// zero 3 6.1+_ptrs[i]
// video_standard 4 6.4+_ptrs[i]
enum // Table 5.21 video standard
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/mpeg/splicedescriptors.h
Expand Up @@ -181,13 +181,13 @@ class SegmentationDescriptor : public SpliceDescriptor
QChar(_data[8]) + QChar(_data[9]);
}
// segmentation_event_cancel_indicator 1 10.0
bool IsSegmentationEventCancel(void) const { return _data[10] & 0x80; }
bool IsSegmentationEventCancel(void) const { return ( _data[10] & 0x80 ) != 0; }
// reserved 7 10.1
// if (segmentation_event_cancel_indicator == ‘0’) {
// program_seg_flag 1 11.0
bool IsProgramSegmentation(void) const { return _data[11] & 0x80; }
bool IsProgramSegmentation(void) const { return ( _data[11] & 0x80 ) != 0; }
// seg_duration_flag 1 11.1
bool HasSegmentationDuration(void) const { return _data[11] & 0x40; }
bool HasSegmentationDuration(void) const { return ( _data[11] & 0x40 ) != 0; }
// reserved 6 11.2
// if (program_segmentation_flag == ‘0’) {
// component_count 8 12
Expand Down

0 comments on commit d2bb607

Please sign in to comment.