Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed various complaints by CLion #114

Merged
merged 1 commit into from Oct 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/libhts/htsmsg.c
Expand Up @@ -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;
}

Expand Down
11 changes: 0 additions & 11 deletions src/AutoRecordings.cpp
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/AutoRecordings.h
Expand Up @@ -47,7 +47,6 @@ class AutoRecordings
/* 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 */
Expand Down
5 changes: 1 addition & 4 deletions src/HTSPConnection.cpp
Expand Up @@ -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" {
Expand All @@ -31,7 +29,6 @@ extern "C" {
}

#include "Tvheadend.h"
#include "tvheadend/Settings.h"

using namespace std;
using namespace ADDON;
Expand Down Expand Up @@ -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))
Expand Down
16 changes: 2 additions & 14 deletions src/HTSPDemuxer.cpp
Expand Up @@ -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)
Expand All @@ -48,7 +36,7 @@ CHTSPDemuxer::CHTSPDemuxer ( CHTSPConnection &conn )
m_lastUse = 0;
}

CHTSPDemuxer::~CHTSPDemuxer ( void )
CHTSPDemuxer::~CHTSPDemuxer ()
{
}

Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/HTSPTypes.h
Expand Up @@ -111,7 +111,7 @@ struct SSubscription
active(false),
weight(SUBSCRIPTION_WEIGHT_NORMAL)
{
static int previousId = 0;
static uint32_t previousId = 0;
subscriptionId = ++previousId;
}
};
4 changes: 2 additions & 2 deletions src/HTSPVFS.cpp
Expand Up @@ -39,7 +39,7 @@ CHTSPVFS::CHTSPVFS ( CHTSPConnection &conn )
{
}

CHTSPVFS::~CHTSPVFS ( void )
CHTSPVFS::~CHTSPVFS ()
{
}

Expand Down Expand Up @@ -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)
Expand Down
11 changes: 0 additions & 11 deletions src/TimeRecordings.cpp
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/TimeRecordings.h
Expand Up @@ -47,7 +47,6 @@ class TimeRecordings
/* 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 */
Expand Down
14 changes: 1 addition & 13 deletions src/Tvheadend.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down
13 changes: 4 additions & 9 deletions src/Tvheadend.h
Expand Up @@ -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);
Expand All @@ -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 );
Expand Down Expand Up @@ -167,7 +167,7 @@ class CHTSPRegister

public:
CHTSPRegister ( CHTSPConnection *conn );
~CHTSPRegister ( void );
~CHTSPRegister ();

private:
CHTSPConnection *m_conn;
Expand Down Expand Up @@ -307,7 +307,6 @@ class CHTSPDemuxer
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 );

Expand Down Expand Up @@ -410,7 +409,7 @@ class CTvheadend
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;
Expand Down Expand Up @@ -535,10 +534,6 @@ class CTvheadend
{
return m_conn.IsConnected();
}
inline void Disconnect ( void )
{
m_conn.Disconnect();
}
inline void OnSleep ( void )
{
m_conn.OnSleep();
Expand Down
2 changes: 0 additions & 2 deletions src/client.cpp
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions src/tvheadend/entity/AutoRecording.cpp
Expand Up @@ -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)
{
Expand All @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/tvheadend/entity/RecordingBase.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/tvheadend/entity/RecordingBase.h
Expand Up @@ -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).
Expand Down
1 change: 0 additions & 1 deletion src/xbmc_codec_descriptor.hpp
Expand Up @@ -40,7 +40,6 @@ class CodecDescriptor
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)
Expand Down