From 66fb9d45342d3bc412e0011a06961adda646999c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 17 Apr 2016 14:53:38 +0200 Subject: [PATCH] zapit: fix comparison of constant 0 with expression of type 'bool' is always false --- src/zapit/src/fastscan.cpp | 4 ++-- src/zapit/src/pat.cpp | 2 +- src/zapit/src/scanbat.cpp | 2 +- src/zapit/src/scannit.cpp | 2 +- src/zapit/src/scanpmt.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/zapit/src/fastscan.cpp b/src/zapit/src/fastscan.cpp index c6cf21a8f..96e5ed532 100644 --- a/src/zapit/src/fastscan.cpp +++ b/src/zapit/src/fastscan.cpp @@ -336,7 +336,7 @@ bool CServiceScan::ReadFst(unsigned short pid, unsigned short operator_id, bool cDemux * dmx = new cDemux(); dmx->Open(DMX_PSI_CHANNEL); - if (dmx->sectionFilter(pid, filter, mask, 3, 3000) < 0) { + if (!dmx->sectionFilter(pid, filter, mask, 3, 3000)) { delete dmx; return false; } @@ -586,7 +586,7 @@ bool CServiceScan::ParseFnt(unsigned short pid, unsigned short operator_id) mask[0] = mask[1] = mask[2] = 0xFF; printf("[FNT] scaning pid %d operator %d\n", pid, operator_id); - if (dmx->sectionFilter(pid, filter, mask, 3, 3000) < 0) { + if (!dmx->sectionFilter(pid, filter, mask, 3, 3000)) { delete dmx; return false; } diff --git a/src/zapit/src/pat.cpp b/src/zapit/src/pat.cpp index 82588a9c3..9f3fd6d3f 100644 --- a/src/zapit/src/pat.cpp +++ b/src/zapit/src/pat.cpp @@ -70,7 +70,7 @@ bool CPat::Parse() do { /* set filter for program association section */ /* read section */ - if ((dmx->sectionFilter(0, filter, mask, 5) < 0) || (i = dmx->Read(buffer, PAT_SECTION_SIZE) < 0)) + if ((!dmx->sectionFilter(0, filter, mask, 5)) || (i = dmx->Read(buffer, PAT_SECTION_SIZE) < 0)) { delete dmx; printf("[pat.cpp] dmx read failed\n"); diff --git a/src/zapit/src/scanbat.cpp b/src/zapit/src/scanbat.cpp index 24112fed8..01d655599 100644 --- a/src/zapit/src/scanbat.cpp +++ b/src/zapit/src/scanbat.cpp @@ -97,7 +97,7 @@ bool CBat::Read() filter[0] = 0x4A; mask[0] = 0xFF; - if (dmx->sectionFilter(0x11, filter, mask, flen) < 0) { + if (!dmx->sectionFilter(0x11, filter, mask, flen)) { delete dmx; return false; } diff --git a/src/zapit/src/scannit.cpp b/src/zapit/src/scannit.cpp index dfa106759..dc47c6686 100644 --- a/src/zapit/src/scannit.cpp +++ b/src/zapit/src/scannit.cpp @@ -106,7 +106,7 @@ bool CNit::Read() flen = 3; } - if (dmx->sectionFilter(0x10, filter, mask, flen) < 0) { + if (!dmx->sectionFilter(0x10, filter, mask, flen)) { delete dmx; #ifdef DEBUG_NIT printf("[NIT] filter failed\n"); diff --git a/src/zapit/src/scanpmt.cpp b/src/zapit/src/scanpmt.cpp index f62cbf60b..be71ac995 100644 --- a/src/zapit/src/scanpmt.cpp +++ b/src/zapit/src/scanpmt.cpp @@ -73,7 +73,7 @@ bool CPmt::Read(unsigned short pid, unsigned short sid) mask[2] = 0xFF; mask[3] = 0x01; mask[4] = 0xFF; - if ((dmx->sectionFilter(pid, filter, mask, 5) < 0) || (dmx->Read(buffer, PMT_SECTION_SIZE) < 0)) { + if ((!dmx->sectionFilter(pid, filter, mask, 5)) || (dmx->Read(buffer, PMT_SECTION_SIZE) < 0)) { printf("CPmt::Read: pid %x failed\n", pid); ret = false; }