From bf3fc70d2dbf9cc6eaa34d38f170f0f0e1d7ab60 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Wed, 15 Jun 2011 17:49:15 +0300 Subject: [PATCH] Added cppcheck target into Makefile. --- HISTORY | 1 + Makefile | 3 +++ device.c | 4 ++-- sectionfilter.c | 6 +++--- statistics.c | 1 + 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/HISTORY b/HISTORY index c56b9a0..a9541ed 100644 --- a/HISTORY +++ b/HISTORY @@ -157,3 +157,4 @@ VDR Plugin 'iptv' Revision History channel (Thanks to Zdeněk Kopřivík). - Canonicalized the configuration directory. - Added support for LDFLAGS. +- Added cppcheck target into Makefile. diff --git a/Makefile b/Makefile index f8a9701..25d6345 100644 --- a/Makefile +++ b/Makefile @@ -130,3 +130,6 @@ dist: $(I18Npo) clean clean: @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot + +cppcheck: $(OBJS) + @cppcheck --enable=information,style,unusedFunction -v -f $(OBJS:%.o=%.c) diff --git a/device.c b/device.c index ecf12f1..3a05c77 100644 --- a/device.c +++ b/device.c @@ -215,7 +215,7 @@ bool cIptvDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) cIptvTransponderParameters itp(Channel->Parameters()); debug("cIptvDevice::SetChannelDevice(%d)\n", deviceIndex); - + if (isempty(itp.Address())) { error("Unrecognized IPTV address: %s", Channel->Parameters()); return false; @@ -372,7 +372,6 @@ bool cIptvDevice::IsBuffering(void) bool cIptvDevice::GetTSPacket(uchar *&Data) { - int Count = 0; //debug("cIptvDevice::GetTSPacket(%d)\n", deviceIndex); if (tsBuffer && !IsBuffering()) { if (isPacketDelivered) { @@ -381,6 +380,7 @@ bool cIptvDevice::GetTSPacket(uchar *&Data) // Update buffer statistics AddBufferStatistic(TS_SIZE, tsBuffer->Available()); } + int Count = 0; uchar *p = tsBuffer->Get(Count); if (p && Count >= TS_SIZE) { if (*p != TS_SYNC_BYTE) { diff --git a/sectionfilter.c b/sectionfilter.c index 05d6440..8305aea 100644 --- a/sectionfilter.c +++ b/sectionfilter.c @@ -91,10 +91,10 @@ void cIptvSectionFilter::New(void) int cIptvSectionFilter::Filter(void) { - uint8_t neq = 0; - int i; - if (secbuf) { + int i; + uint8_t neq = 0; + for (i = 0; i < DMX_MAX_FILTER_SIZE; ++i) { uint8_t local_xor = (uint8_t)(filter_value[i] ^ secbuf[i]); if (maskandmode[i] & local_xor) diff --git a/statistics.c b/statistics.c index 3a9cf40..0dddc37 100644 --- a/statistics.c +++ b/statistics.c @@ -164,6 +164,7 @@ void cIptvStreamerStatistics::AddStreamerStatistic(long Bytes) // Buffer statistic class cIptvBufferStatistics::cIptvBufferStatistics() : dataBytes(0), + freeSpace(0), usedSpace(0), timer(), mutex()