{
if (learnMode != NOLEARNMODE)
{
- setHWCtoCommand(code, learnMode);
+ setHWCtoCommand(code, static_cast<UCHAR>(learnMode));
InputMan::getInstance()->cancelLearnMode();
return NA_LEARN;
}
bool InputMan::init()
{
- bool i1{}, i2{}, i3{}, i4{};
+ bool ret;
+ bool oneOK{};
#ifdef VOMP_PLATFORM_RASPBERRY
inputLinux = new InputLinux();
- i1 = inputLinux->init();
- if (!i1) { delete inputLinux; inputLinux = NULL; }
+ ret = inputLinux->init();
+ if (ret)
+ oneOK = true;
+ else
+ { delete inputLinux; inputLinux = NULL; }
// FIXME enable modules by new config system NCONFIG
// inputCEC = new InputCEC();
-// i2 = inputCEC->init();
-// if (!i2) { delete inputCEC; inputCEC = NULL; }
+// ret = inputCEC->init();
+// if (ret)
+// oneOK = true;
+// else
+// { delete inputCEC; inputCEC = NULL; }
#endif
inputUDP = new InputUDP();
- i3 = inputUDP->init();
- if (!i3) { delete inputUDP; inputUDP = NULL; }
+ ret = inputUDP->init();
+ if (ret)
+ oneOK = true;
+ else
+ { delete inputUDP; inputUDP = NULL; }
#ifdef WIN32
inputWin = new InputWin();
- i4 = inputWin->init();
- if (!i4) { delete inputWin; inputWin = NULL; }
+ ret = inputWin->init();
+ if (ret)
+ oneOK = true;
+ else
+ { delete inputWin; inputWin = NULL; }
#endif
- if (!i1 && !i2 && !i3 && !i4)
+ if (!oneOK)
{
Log::getInstance()->log("InputMan", Log::CRIT, "InputMan could not init any input module");
return false;
{
Log::getInstance()->log("InputMan", Log::DEBUG, "Start");
- bool i1{}, i3{};
+ bool oneOK{};
#ifdef VOMP_PLATFORM_RASPBERRY
- if (inputLinux)
- {
- i1 = inputLinux->start();
- }
+ if (inputLinux && inputLinux->start()) oneOK = true;
#endif
- if (inputUDP)
- {
- i3 = inputUDP->start();
- }
+ if (inputUDP && inputUDP->start()) oneOK = true;
+
+ if (!oneOK)
+ Log::getInstance()->log("InputMan", Log::CRIT, "InputMan could not start any input module");
- return i1;
+ return oneOK;
}
void InputMan::stop()
if (strcmp(fontname,cur_fontname)) {
// new font!
if (cur_fontname) free(cur_fontname);
- cur_fontname=(char*)malloc(strlen(fontname)+1);
+ cur_fontname = static_cast<char*>(malloc(strlen(fontname)+1));
strcpy(cur_fontname,fontname);
struct OpenVGCommand comm;
unsigned int buffer_len=(command.param1*command.param2)>>3;
unsigned char * buffer=(unsigned char*)malloc(buffer_len);
unsigned char * r_buffer1=buffer;
- const unsigned char * r_buffer2=(const unsigned char *)command.data;
+ const unsigned char* r_buffer2= static_cast<const unsigned char *>(command.data);
unsigned char *buffer_end=buffer+buffer_len;
while (r_buffer1!=buffer_end) {
unsigned char byte=*r_buffer2;
// Log::getInstance()->log("OsdOpenVG", Log::DEBUG, "putOpenVGCommand wait_for");
std::unique_lock<std::mutex> ul(vgTaskSignalMutex);
- auto a = vgTaskSignal.wait_for(ul, std::chrono::milliseconds(100));
+ /*auto a = */ vgTaskSignal.wait_for(ul, std::chrono::milliseconds(100));
ul.unlock();
/*
if (a == std::cv_status::timeout)
numGot = 0;
ignoreTimer = false;
- numWidth = static_cast<int>(VDR::getInstance()->getChannelNumberWidth());
+ numWidth = VDR::getInstance()->getChannelNumberWidth();
if (numWidth > 10) numWidth = 10;
for (int i = 0; i < numWidth; i++) input[i] = -1;
int connect();
void disconnect();
bool isConnected() { return connected; }
- ULONG getChannelNumberWidth() { return channelNumberWidth; }
+ int getChannelNumberWidth() { return channelNumberWidth; }
void setVDRShutdown(bool doShutdown) { doVDRShutdown = doShutdown; }
void shutdownVDR();
bool connected{};
ULONG maxChannelNumber{};
bool doVDRShutdown{};
- ULONG channelNumberWidth{1};
+ int channelNumberWidth{1};
VDR_PacketReceiver* TEMP_SINGLE_VDR_PR;
std::mutex threadStartProtect;
chanList = tchanList;
vchannelList = tvchannelList;
- numberWidth = (int)VDR::getInstance()->getChannelNumberWidth();
+ numberWidth = VDR::getInstance()->getChannelNumberWidth();
currentChannelIndex = 0;
previousChannelIndex = 0;
playing = false;
// Convert channel number to index
- UINT i;
- for(i = 0; i < chanList->size(); i++)
+ for(UINT i = 0; i < chanList->size(); i++)
{
- if ((*chanList)[i]->number == (UINT)initialChannelNumber)
+ if ((*chanList)[i]->number == initialChannelNumber)
{
currentChannelIndex = i;
osdChannelIndex = i;
UINT i;
for(i = 0; i < chanList->size(); i++)
{
- if ((*chanList)[i]->number == (UINT)newData)
+ if ((*chanList)[i]->number == newData)
{
newChannel = i;
break;
case Input::OK:
{
learnmode = true;
- InputMan::getInstance()->EnterLearningMode(reinterpret_cast<ULONG>(sl.getCurrentOptionData()));
+ // Two casts to get from void* to UCHAR. Wow. First reinterpret from void* to ULONG, then static to UCHAR
+ InputMan::getInstance()->EnterLearningMode(
+ static_cast<UCHAR>(reinterpret_cast<ULONG>(sl.getCurrentOptionData())));
return 1;
}
case Input::BACK: