Skip to content
Permalink
Browse files

Fix some conversation warnings

  • Loading branch information...
manuelm committed Nov 18, 2018
1 parent 2369d9e commit d8b3f35343bd2dd516f408de5ac61dcc38a85c24
Showing with 26 additions and 26 deletions.
  1. +8 −8 src/DvbData.cpp
  2. +1 −1 src/DvbData.h
  3. +10 −10 src/Timers.cpp
  4. +4 −4 src/Timers.h
  5. +3 −3 src/client.cpp
@@ -365,7 +365,7 @@ void Dvb::GetTimerTypes(PVR_TIMER_TYPE types[], int *size)
int i = 0;
for (auto &timer : timerTypes)
types[i++] = timer;
*size = timerTypes.size();
*size = static_cast<int>(timerTypes.size());
XBMC->Log(LOG_DEBUG, "transfered %u timers", *size);
}

@@ -425,7 +425,7 @@ bool Dvb::DeleteTimer(const PVR_TIMER &timer)
unsigned int Dvb::GetTimersAmount()
{
CLockObject lock(m_mutex);
return m_timers.GetTimerCount();
return static_cast<int>(m_timers.GetTimerCount());
}

/***************************************************************************
@@ -849,7 +849,7 @@ void *Dvb::Process()
m_mutex.Unlock();
Sleep(8000); /* Sleep enough time to let the media server grab the EPG data */
m_mutex.Lock();
XBMC->Log(LOG_INFO, "Performing forced EPG update!");
XBMC->Log(LOG_INFO, "Triggering EPG update on current channel!");
PVR->TriggerEpgUpdate(m_currentChannel);
}

@@ -859,15 +859,15 @@ void *Dvb::Process()
m_mutex.Unlock();
Sleep(1000);
m_mutex.Lock();
XBMC->Log(LOG_INFO, "Performing forced timer updates!");
XBMC->Log(LOG_INFO, "Running forced timer updates!");
TimerUpdates();
update = 0;
}

if (update >= interval)
{
update = 0;
XBMC->Log(LOG_INFO, "Performing timer/recording updates!");
XBMC->Log(LOG_INFO, "Running timer + recording updates!");
TimerUpdates();
PVR->TriggerRecordingUpdate();

@@ -969,7 +969,7 @@ Dvb::httpResponse Dvb::GetFromAPI(const char* format, ...)
if (res.file)
{
char buffer[1024];
while (int bytesRead = XBMC->ReadFile(res.file, buffer, 1024))
while (ssize_t bytesRead = XBMC->ReadFile(res.file, buffer, 1024))
res.content.append(buffer, bytesRead);
XBMC->CloseFile(res.file);
res.file = nullptr;
@@ -1149,7 +1149,7 @@ bool Dvb::LoadChannels()

std::string content;
char buffer[1024];
while (int bytesRead = XBMC->ReadFile(fileHandle, buffer, 1024))
while (ssize_t bytesRead = XBMC->ReadFile(fileHandle, buffer, 1024))
content.append(buffer, bytesRead);
XBMC->CloseFile(fileHandle);

@@ -1256,7 +1256,7 @@ bool Dvb::LoadChannels()
}
}

XBMC->Log(LOG_INFO, "Loaded (%u/%u) channels in (%u/%u) groups",
XBMC->Log(LOG_INFO, "Loaded (%u/%lu) channels in (%u/%lu) groups",
m_channelAmount, m_channels.size(), m_groupAmount, m_groups.size());
// force channel sync as stream urls may have changed (e.g. rstp on/off)
PVR->TriggerChannelUpdate();
@@ -40,7 +40,7 @@ namespace dvbviewer
long UTCOffset();
void RemoveNullChars(std::string& str);
std::string ConvertToUtf8(const std::string& src);
}; // namespace dvbviewer
} // namespace dvbviewer

/* forward declaration */
class DvbGroup;
@@ -254,8 +254,8 @@ Timers::Error Timers::RefreshTimers(const char *name, const char *endpoint,
timer.second.syncState = T::SyncState::NONE;

std::vector<T> newTimers;
unsigned int updated = 0, unchanged = 0;
std::size_t pos = 0;
std::size_t updated = 0, unchanged = 0;
unsigned int pos = 0;
for (const TiXmlElement *xTimer = doc.RootElement()->FirstChildElement(xmltag);
xTimer; xTimer = xTimer->NextSiblingElement(xmltag), ++pos)
{
@@ -287,7 +287,7 @@ Timers::Error Timers::RefreshTimers(const char *name, const char *endpoint,
newTimers.push_back(newTimer);
}

unsigned int removed = 0;
std::size_t removed = 0;
for (auto it = timerlist.begin(); it != timerlist.end();)
{
const T &timer = it->second;
@@ -302,7 +302,7 @@ Timers::Error Timers::RefreshTimers(const char *name, const char *endpoint,
++it;
}

unsigned int added = newTimers.size();
std::size_t added = newTimers.size();
for (auto &newTimer : newTimers)
{
newTimer.id = m_nextTimerId++;
@@ -311,8 +311,8 @@ Timers::Error Timers::RefreshTimers(const char *name, const char *endpoint,
timerlist[newTimer.id] = newTimer;
}

XBMC->Log(LOG_DEBUG, "%s list update: removed=%u, unchanged=%u, updated=%u"
", added=%u", name, removed, unchanged, updated, added);
XBMC->Log(LOG_DEBUG, "%s list update: removed=%lu, unchanged=%lu, updated=%lu"
", added=%lu", name, removed, unchanged, updated, added);
changes = (removed || updated || added);
return SUCCESS;
}
@@ -337,7 +337,7 @@ Timer *Timers::GetTimer(std::function<bool (const Timer&)> func)
return GetTimer<Timer>(func, m_timers);
}

unsigned int Timers::GetTimerCount()
std::size_t Timers::GetTimerCount()
{
return m_timers.size();
}
@@ -494,7 +494,7 @@ Timers::Error Timers::RefreshTimers(bool &changes)
m_timers, changes);
}

Timers::Error Timers::ParseTimerFrom(const TiXmlElement *xml, std::size_t pos,
Timers::Error Timers::ParseTimerFrom(const TiXmlElement *xml, unsigned int pos,
Timer &timer)
{
if (!XMLUtils::GetString(xml, "GUID", timer.guid))
@@ -608,7 +608,7 @@ AutoTimer *Timers::GetAutoTimer(std::function<bool (const AutoTimer&)> func)
return GetTimer<AutoTimer>(func, m_autotimers);
}

unsigned int Timers::GetAutoTimerCount()
std::size_t Timers::GetAutoTimerCount()
{
return m_autotimers.size();
}
@@ -793,7 +793,7 @@ Timers::Error Timers::RefreshAutoTimers(bool &changes)
"api/searchlist.html", "Search", m_autotimers, changes);
}

Timers::Error Timers::ParseTimerFrom(const TiXmlElement *xml, std::size_t pos,
Timers::Error Timers::ParseTimerFrom(const TiXmlElement *xml, unsigned int pos,
AutoTimer &timer)
{
if (xml->QueryStringAttribute("Name", &timer.title) != TIXML_SUCCESS)
@@ -132,8 +132,8 @@ class Timers
Timer *GetTimer(std::function<bool (const Timer&)> func);
AutoTimer *GetAutoTimer(std::function<bool (const AutoTimer&)> func);

unsigned int GetTimerCount();
unsigned int GetAutoTimerCount();
std::size_t GetTimerCount();
std::size_t GetAutoTimerCount();

void GetTimers(std::vector<PVR_TIMER> &timers);
void GetAutoTimers(std::vector<PVR_TIMER> &timers);
@@ -158,9 +158,9 @@ class Timers
bool IsAutoTimer(const PVR_TIMER &timer);

Error ParseTimerFrom(const PVR_TIMER &tmr, Timer &timer);
Error ParseTimerFrom(const TiXmlElement *xml, std::size_t pos, Timer &timer);
Error ParseTimerFrom(const TiXmlElement *xml, unsigned int pos, Timer &timer);
Error ParseTimerFrom(const PVR_TIMER &tmr, AutoTimer &timer);
Error ParseTimerFrom(const TiXmlElement *xml, std::size_t pos, AutoTimer &timer);
Error ParseTimerFrom(const TiXmlElement *xml, unsigned int pos, AutoTimer &timer);

void ParseDate(const std::string &date, std::tm &timeinfo);
void ParseTime(const std::string &time, std::tm &timeinfo);
@@ -355,7 +355,7 @@ bool CanSeekStream(void)

int ReadLiveStream(unsigned char *buffer, unsigned int size)
{
return (strReader) ? strReader->ReadData(buffer, size) : 0;
return (strReader) ? static_cast<int>(strReader->ReadData(buffer, size)) : 0;
}

long long SeekLiveStream(long long position, int whence)
@@ -447,7 +447,7 @@ int ReadRecordedStream(unsigned char *buffer, unsigned int size)
if (!recReader)
return 0;

return recReader->ReadData(buffer, size);
return static_cast<int>(recReader->ReadData(buffer, size));
}

long long SeekRecordedStream(long long position, int whence)
@@ -539,7 +539,7 @@ PVR_ERROR IsEPGTagRecordable(const EPG_TAG*, bool*) { return PVR_ERROR_NOT_IMPLE
PVR_ERROR GetEPGTagStreamProperties(const EPG_TAG*, PVR_NAMED_VALUE*, unsigned int*) { return PVR_ERROR_NOT_IMPLEMENTED; }
PVR_ERROR GetEPGTagEdl(const EPG_TAG* epgTag, PVR_EDL_ENTRY edl[], int *size) { return PVR_ERROR_NOT_IMPLEMENTED; }
bool SeekTime(double, bool, double*) { return false; }
void SetSpeed(int) {};
void SetSpeed(int) {}
PVR_ERROR GetDescrambleInfo(PVR_DESCRAMBLE_INFO*) { return PVR_ERROR_NOT_IMPLEMENTED; }

}

0 comments on commit d8b3f35

Please sign in to comment.
You can’t perform that action at this time.