[SCM] kodi-pvr-hts/master: fixed various complaints by CLion

tiber-guest at users.alioth.debian.org tiber-guest at users.alioth.debian.org
Wed Mar 2 23:01:46 UTC 2016


The following commit has been merged in the master branch:
commit 7428865c74d9fbd7efd7b7c4c7f925f1b22f7fcc
Author: Sam Stenvall <sam.stenvall at nordsoftware.com>
Date:   Wed Oct 14 11:59:52 2015 +0300

    fixed various complaints by CLion

diff --git a/lib/libhts/htsmsg.c b/lib/libhts/htsmsg.c
index 0223a92..c9059fb 100644
--- a/lib/libhts/htsmsg.c
+++ b/lib/libhts/htsmsg.c
@@ -445,6 +445,7 @@ htsmsg_get_map_multi(htsmsg_t *msg, ...)
 
   while(msg != NULL && (n = va_arg(ap, char *)) != NULL)
     msg = htsmsg_get_map(msg, n);
+  va_end(ap);
   return msg;
 }
 
diff --git a/src/AutoRecordings.cpp b/src/AutoRecordings.cpp
index 3ac4e39..dd9f9ca 100644
--- a/src/AutoRecordings.cpp
+++ b/src/AutoRecordings.cpp
@@ -125,17 +125,6 @@ void AutoRecordings::GetAutorecTimers(std::vector<PVR_TIMER> &timers)
   }
 }
 
-const std::string AutoRecordings::GetTimerStringIdFromIntId(unsigned int intId) const
-{
-  for (auto tit = m_autoRecordings.begin(); tit != m_autoRecordings.end(); ++tit)
-  {
-    if (tit->second.GetId() == intId)
-      return tit->second.GetStringId();
-  }
-  tvherror("Autorec: Unable to obtain string id for int id %d", intId);
-  return std::string();
-}
-
 const unsigned int AutoRecordings::GetTimerIntIdFromStringId(const std::string &strId) const
 {
   for (auto tit = m_autoRecordings.begin(); tit != m_autoRecordings.end(); ++tit)
diff --git a/src/AutoRecordings.h b/src/AutoRecordings.h
index a51e523..591374c 100644
--- a/src/AutoRecordings.h
+++ b/src/AutoRecordings.h
@@ -47,7 +47,6 @@ public:
   /* data access */
   int  GetAutorecTimerCount() const;
   void GetAutorecTimers(std::vector<PVR_TIMER> &timers);
-  const std::string GetTimerStringIdFromIntId(unsigned int intId) const;
   const unsigned int GetTimerIntIdFromStringId(const std::string &strId) const;
 
   /* client to server messages */
diff --git a/src/HTSPConnection.cpp b/src/HTSPConnection.cpp
index 4b5e043..958f538 100644
--- a/src/HTSPConnection.cpp
+++ b/src/HTSPConnection.cpp
@@ -20,9 +20,7 @@
  */
 
 #include "platform/threads/mutex.h"
-#include "platform/threads/atomics.h"
 #include "platform/util/StringUtils.h"
-#include "platform/util/timeutils.h"
 #include "platform/sockets/tcp.h"
 
 extern "C" {
@@ -31,7 +29,6 @@ extern "C" {
 }
 
 #include "Tvheadend.h"
-#include "tvheadend/Settings.h"
 
 using namespace std;
 using namespace ADDON;
@@ -288,7 +285,7 @@ bool CHTSPConnection::SendMessage0 ( const char *method, htsmsg_t *msg )
   int     e;
   void   *buf;
   size_t  len;
-  ssize_t c = -1;
+  ssize_t c;
   uint32_t seq;
 
   if (!htsmsg_get_u32(msg, "seq", &seq))
diff --git a/src/HTSPDemuxer.cpp b/src/HTSPDemuxer.cpp
index 232fbe0..b4ced4a 100644
--- a/src/HTSPDemuxer.cpp
+++ b/src/HTSPDemuxer.cpp
@@ -20,18 +20,6 @@
  */
 
 #include "Tvheadend.h"
-#include "tvheadend/Settings.h"
-
-#include "platform/threads/mutex.h"
-#include "platform/threads/atomics.h"
-#include "platform/util/timeutils.h"
-#include "platform/sockets/tcp.h"
-
-extern "C" {
-#include "libhts/htsmsg_binary.h"
-#include "libhts/sha1.h"
-}
-
 #include "xbmc_codec_descriptor.hpp"
 
 #define TVH_TO_DVD_TIME(x) ((double)x * DVD_TIME_BASE / 1000000.0)
@@ -48,7 +36,7 @@ CHTSPDemuxer::CHTSPDemuxer ( CHTSPConnection &conn )
   m_lastUse = 0;
 }
 
-CHTSPDemuxer::~CHTSPDemuxer ( void )
+CHTSPDemuxer::~CHTSPDemuxer ()
 {
 }
 
@@ -173,7 +161,7 @@ bool CHTSPDemuxer::Seek
   /* Build message */
   m = htsmsg_create_map();  
   htsmsg_add_u32(m, "subscriptionId", m_subscription.subscriptionId);
-  htsmsg_add_s64(m, "time",           (int64_t)time * 1000LL);
+  htsmsg_add_s64(m, "time",           (int64_t)time * 1000);
   htsmsg_add_u32(m, "absolute",       1);
 
   /* Send and Wait */
diff --git a/src/HTSPTypes.h b/src/HTSPTypes.h
index 3125d98..91f5f8d 100644
--- a/src/HTSPTypes.h
+++ b/src/HTSPTypes.h
@@ -111,7 +111,7 @@ struct SSubscription
     active(false),
     weight(SUBSCRIPTION_WEIGHT_NORMAL)
   {
-    static int previousId = 0;
+    static uint32_t previousId = 0;
     subscriptionId = ++previousId;
   }
 };
diff --git a/src/HTSPVFS.cpp b/src/HTSPVFS.cpp
index 10961f2..2cc1590 100644
--- a/src/HTSPVFS.cpp
+++ b/src/HTSPVFS.cpp
@@ -39,7 +39,7 @@ CHTSPVFS::CHTSPVFS ( CHTSPConnection &conn )
 {
 }
 
-CHTSPVFS::~CHTSPVFS ( void )
+CHTSPVFS::~CHTSPVFS ()
 {
 }
 
@@ -97,7 +97,7 @@ ssize_t CHTSPVFS::Read ( unsigned char *buf, unsigned int len )
     return -1;
 
   /* Read */
-  int read = SendFileRead(buf, len);
+  ssize_t read = SendFileRead(buf, len);
 
   /* Update */
   if (read > 0)
diff --git a/src/TimeRecordings.cpp b/src/TimeRecordings.cpp
index 9abf157..2e83167 100644
--- a/src/TimeRecordings.cpp
+++ b/src/TimeRecordings.cpp
@@ -100,17 +100,6 @@ void TimeRecordings::GetTimerecTimers(std::vector<PVR_TIMER> &timers)
   }
 }
 
-const std::string TimeRecordings::GetTimerStringIdFromIntId(unsigned int intId) const
-{
-  for (auto tit = m_timeRecordings.begin(); tit != m_timeRecordings.end(); ++tit)
-  {
-    if (tit->second.GetId() == intId)
-      return tit->second.GetStringId();
-  }
-  tvherror("Timerec: Unable to obtain string id for int id %d", intId);
-  return std::string();
-}
-
 const unsigned int TimeRecordings::GetTimerIntIdFromStringId(const std::string &strId) const
 {
   for (auto tit = m_timeRecordings.begin(); tit != m_timeRecordings.end(); ++tit)
diff --git a/src/TimeRecordings.h b/src/TimeRecordings.h
index 8d0bf7d..87a9bc3 100644
--- a/src/TimeRecordings.h
+++ b/src/TimeRecordings.h
@@ -47,7 +47,6 @@ public:
   /* data access */
   int  GetTimerecTimerCount() const;
   void GetTimerecTimers(std::vector<PVR_TIMER> &timers);
-  const std::string GetTimerStringIdFromIntId(unsigned int intId) const;
   const unsigned int GetTimerIntIdFromStringId(const std::string &strId) const;
 
   /* client to server messages */
diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp
index 8a6f380..af60b74 100644
--- a/src/Tvheadend.cpp
+++ b/src/Tvheadend.cpp
@@ -25,13 +25,6 @@
 #include "Tvheadend.h"
 #include "tvheadend/utilities/Utilities.h"
 
-#include "platform/util/util.h"
-#include "platform/threads/atomics.h"
-
-extern "C" {
-#include "libhts/htsmsg_binary.h"
-}
-
 using namespace std;
 using namespace ADDON;
 using namespace PLATFORM;
@@ -387,7 +380,7 @@ PVR_ERROR CTvheadend::GetRecordings ( ADDON_HANDLE handle )
 
       /* Time/Duration */
       rec.recordingTime = (time_t)recording.GetStart();
-      rec.iDuration =     (time_t)(recording.GetStop() - recording.GetStart());
+      rec.iDuration =     recording.GetStop() - recording.GetStart();
 
       /* Priority */
       rec.iPriority = recording.GetPriority();
@@ -1360,9 +1353,6 @@ void CTvheadend::SyncChannelsCompleted ( void )
   if (m_asyncState.GetState() > ASYNC_CHN)
     return;
 
-  Channels::iterator cit = m_channels.begin();
-  Tags::iterator tit = m_tags.begin();
-
   /* Tags */
   utilities::erase_if(m_tags, [](const TagMapEntry &entry)
   {
@@ -1619,7 +1609,6 @@ void CTvheadend::ParseChannelDelete ( htsmsg_t *msg )
 
 void CTvheadend::ParseRecordingAddOrUpdate ( htsmsg_t *msg, bool bAdd )
 {
-  bool update = false;
   const char *state, *str;
   uint32_t id, channel, eventId, retention, priority;
   int64_t start, stop, startExtra, stopExtra;
@@ -1876,7 +1865,6 @@ bool CTvheadend::ParseEvent ( htsmsg_t *msg, bool bAdd, Event &evt )
 
 void CTvheadend::ParseEventAddOrUpdate ( htsmsg_t *msg, bool bAdd )
 {
-  bool update = false;
   Event tmp;
 
   /* Parse */
diff --git a/src/Tvheadend.h b/src/Tvheadend.h
index 493e373..25a61fb 100644
--- a/src/Tvheadend.h
+++ b/src/Tvheadend.h
@@ -84,7 +84,7 @@ extern "C" {
 static inline void tvhlog ( ADDON::addon_log_t lvl, const char *fmt, ... )
 {
   char buf[16384];
-  size_t c = sprintf(buf, "pvr.hts - ");
+  int c = sprintf(buf, "pvr.hts - ");
   va_list va;
   va_start(va, fmt);
   vsnprintf(buf + c, sizeof(buf) - c, fmt, va);
@@ -111,7 +111,7 @@ typedef PLATFORM::SyncedBuffer<CHTSPMessage> CHTSPMessageQueue;
 class CHTSPResponse
 {
 public:
-  CHTSPResponse(void);
+  CHTSPResponse();
   ~CHTSPResponse();
   htsmsg_t *Get ( PLATFORM::CMutex &mutex, uint32_t timeout );
   void      Set ( htsmsg_t *m );
@@ -167,7 +167,7 @@ class CHTSPRegister
 
 public:
   CHTSPRegister ( CHTSPConnection *conn );
-  ~CHTSPRegister ( void );
+  ~CHTSPRegister ();
  
 private:
   CHTSPConnection *m_conn;
@@ -307,7 +307,6 @@ private:
   bool         Seek           ( int time, bool backwards, double *startpts );
   void         Speed          ( int speed );
   void         Weight         ( enum eSubscriptionWeight weight );
-  int          CurrentId      ( void );
   PVR_ERROR    CurrentStreams ( PVR_STREAM_PROPERTIES *streams );
   PVR_ERROR    CurrentSignal  ( PVR_SIGNAL_STATUS &sig );
 
@@ -410,7 +409,7 @@ public:
 private:
   bool      CreateTimer       ( const tvheadend::entity::Recording &tvhTmr, PVR_TIMER &tmr );
 
-  uint32_t GetNextUnnumberedChannelNumber ( void );
+  uint32_t GetNextUnnumberedChannelNumber ();
   std::string GetImageURL     ( const char *str );
 
   PLATFORM::CMutex            m_mutex;
@@ -535,10 +534,6 @@ public:
   {
     return m_conn.IsConnected();
   }
-  inline void Disconnect ( void )
-  {
-    m_conn.Disconnect();
-  }
   inline void OnSleep ( void )
   {
     m_conn.OnSleep();
diff --git a/src/client.cpp b/src/client.cpp
index d473bab..28fb172 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -22,8 +22,6 @@
 #include "client.h"
 #include "kodi/xbmc_pvr_dll.h"
 #include "kodi/libKODI_guilib.h"
-#include "platform/threads/mutex.h"
-#include "platform/threads/atomics.h"
 #include "platform/util/util.h"
 #include "Tvheadend.h"
 #include "tvheadend/Settings.h"
diff --git a/src/tvheadend/entity/AutoRecording.cpp b/src/tvheadend/entity/AutoRecording.cpp
index 106afea..1fcbe11 100644
--- a/src/tvheadend/entity/AutoRecording.cpp
+++ b/src/tvheadend/entity/AutoRecording.cpp
@@ -59,8 +59,8 @@ time_t AutoRecording::GetStart() const
   if (Settings::GetInstance().bAutorecApproxTime)
   {
     /* Calculate the approximate start time from the starting window */
-    if ((m_startWindowBegin == int32_t(-1)) ||
-        (m_startWindowEnd == int32_t(-1))) // no starting window set => "any time"
+    if ((m_startWindowBegin == -1) ||
+        (m_startWindowEnd == -1)) // no starting window set => "any time"
       return 0;
     else if (m_startWindowEnd < m_startWindowBegin)
     {
@@ -78,7 +78,7 @@ time_t AutoRecording::GetStart() const
   }
   else
   {
-    if (m_startWindowBegin == int32_t(-1)) // "any time"
+    if (m_startWindowBegin == -1) // "any time"
       return 0;
 
     return LocaltimeToUTC(m_startWindowBegin);
@@ -99,7 +99,7 @@ time_t AutoRecording::GetStop() const
   }
   else
   {
-    if (m_startWindowEnd == int32_t(-1)) // "any time"
+    if (m_startWindowEnd == -1) // "any time"
       return 0;
 
     return LocaltimeToUTC(m_startWindowEnd);
diff --git a/src/tvheadend/entity/RecordingBase.cpp b/src/tvheadend/entity/RecordingBase.cpp
index fe80e34..0f766df 100644
--- a/src/tvheadend/entity/RecordingBase.cpp
+++ b/src/tvheadend/entity/RecordingBase.cpp
@@ -171,7 +171,7 @@ time_t RecordingBase::LocaltimeToUTC(int32_t lctime)
 }
 
 // static
-int RecordingBase::GetNextIntId()
+unsigned int RecordingBase::GetNextIntId()
 {
   static unsigned int intId = 0;
   return ++intId;
diff --git a/src/tvheadend/entity/RecordingBase.h b/src/tvheadend/entity/RecordingBase.h
index 8ce3c8e..c14f197 100644
--- a/src/tvheadend/entity/RecordingBase.h
+++ b/src/tvheadend/entity/RecordingBase.h
@@ -72,7 +72,7 @@ namespace tvheadend
       static time_t LocaltimeToUTC(int32_t lctime);
 
     private:
-      static int GetNextIntId();
+      static unsigned int GetNextIntId();
 
       std::string m_sid;        // ID (string!) of dvr[Time|Auto]recEntry.
       uint32_t m_enabled;       // If [time|auto]rec entry is enabled (activated).
diff --git a/src/xbmc_codec_descriptor.hpp b/src/xbmc_codec_descriptor.hpp
index 2d17fb7..1450abb 100644
--- a/src/xbmc_codec_descriptor.hpp
+++ b/src/xbmc_codec_descriptor.hpp
@@ -40,7 +40,6 @@ public:
     m_strName(name) {}
   virtual ~CodecDescriptor(void) {}
 
-  const std::string& Name(void) const  { return m_strName; }
   xbmc_codec_t Codec(void) const { return m_codec; }
 
   static CodecDescriptor GetCodecByName(const char* strCodecName)

-- 
kodi-pvr-hts packaging



More information about the pkg-multimedia-commits mailing list