// Delete the box
//AVO: do this delete outside the lock to allow for recursive calls within the destructor
// as this box is not in the stack any more, there is no chance for a second delete
- LogNT::getInstance()->debug(TAG, "remove: going to delete boxx {}, num {}", (void*)toDelete, numBoxes);
+ LogNT::getInstance()->debug(TAG, "remove: going to delete boxx {}, num {}", static_cast<void*>(toDelete), numBoxes);
delete toDelete;
osd->doRender();
boxLock.unlock();
//AVO: do the delete outside the lock to allow for recursive deletes
- LogNT::getInstance()->debug(TAG, "removeall: going to delete boxx {}, num={}", (void*)toDel, numBoxes);
+ LogNT::getInstance()->debug(TAG, "removeall: going to delete boxx {}, num={}", static_cast<void*>(toDel), numBoxes);
if (display) Video::getInstance()->setVideoDisplay(*display);
if (toDel) delete toDel;
{
LogNT::getInstance()->debug(TAG, "Giving command to i={}", i);
retVal = boxes[i]->handleCommand(command);
- if (retVal == 1)
+ if (retVal == ABANDON_COMMAND)
{
// not handled but don't give to any more boxes
return 0;
}
- if (retVal == 2)
+ if (retVal == COMMAND_HANDLED)
{
- // command handled
retVal2 = 1;
break;
}
- else if (retVal == 4)
+ else if (retVal == DELETE_ME)
{
// LogNT::getInstance()->debug(TAG, "Return 4: i={}, boxes[i]={}", i, (void*)boxes[i]);
remove(boxes[i]);
return;
}
}
- LogNT::getInstance()->error(TAG, "Remove child box called, child {} not found", (void*)oldChild);
+ LogNT::getInstance()->error(TAG, "Remove child box called, child {} not found", static_cast<void*>(oldChild));
}
void Boxx::removeVisibleChilds(Region & r)
{
Json::Value v = jconfigro[section][key];
if (!v.isInt64()) return false;
- out = v.asInt64();
+ out = static_cast<int>(v.asInt64());
return true;
}
std::string lircIP;
bool checkA = Config::getInstance()->getString("input_lirc", "lirc_ip", lircIP);
int lircPort = 8765;
- bool checkB = Config::getInstance()->getInt("input_lirc", "lirc_port", lircPort);
+ /* bool checkB = */ Config::getInstance()->getInt("input_lirc", "lirc_port", lircPort);
std::string lircSocket;
bool checkC = Config::getInstance()->getString("input_lirc", "lirc_socket", lircSocket);
else if (checkA) // If no checkC, must be checkA
{
LogNT::getInstance()->info(TAG, "Starting with IP: {} {}", lircIP, lircPort);
- tr = tcp.connect(lircIP, lircPort);
+ tr = tcp.connect(lircIP, static_cast<USHORT>(lircPort));
}
if (!tr)
}
}
-const UCHAR InputMan::getVompKeyNumber(const char* vompKeyName)
+UCHAR InputMan::getVompKeyNumber(const char* vompKeyName)
{
if (!strcmp(vompKeyName, "VOLUMEUP")) return Input::VOLUMEUP;
else if (!strcmp(vompKeyName, "VOLUMEDOWN")) return Input::VOLUMEDOWN;
bool saveOptionstoServer();
static const char* getVompKeyName(UCHAR vompKey);
- static const UCHAR getVompKeyNumber(const char* vompKeyName);
+ static UCHAR getVompKeyNumber(const char* vompKeyName);
std::string getHardCodedHardwareKeyNamesForVompKey(UCHAR vompKey);
if (std::find(receivers.begin(), receivers.end(), newMR) == receivers.end())
{
- logger->debug(TAG, "addReceiver: not found, adding {}", (void*)newMR);
+ logger->debug(TAG, "addReceiver: not found, adding {}", static_cast<void*>(newMR));
receivers.push_back(newMR);
}
}
while(1)
{
- logger->debug(TAG, "Attempt remove receiver {}", (void*)toRemove);
+ logger->debug(TAG, "Attempt remove receiver {}", static_cast<void*>(toRemove));
if (messageBeingProcessed && (messageBeingProcessed->to == toRemove))
{
// The message currently being processed by Control is with the receiver we're trying to remove
// Release mutex, delay and retry
- logger->info(TAG, "Remove delay! Does this ever happen? {}", (void*)toRemove);
+ logger->info(TAG, "Remove delay! Does this ever happen? {}", static_cast<void*>(toRemove));
ul.unlock();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
ReceiversI toRemoveI = std::find(receivers.begin(), receivers.end(), toRemove);
if (toRemoveI == receivers.end())
{
- logger->error(TAG, "Remove error 1 {}", (void*)toRemove);
+ logger->error(TAG, "Remove error 1 {}", static_cast<void*>(toRemove));
return;
}
receivers.erase(toRemoveI);
- logger->debug(TAG, "Removed receiver {}", (void*)toRemove);
+ logger->debug(TAG, "Removed receiver {}", static_cast<void*>(toRemove));
break;
}
}
if (!messageBeingProcessed->p_to && !receiverExists(messageBeingProcessed->to))
{
// Receiver for this message has been deleted already
- logger->debug(TAG, "Dropping message {} for non-existent receiver {}", (void*)messageBeingProcessed, (void*)messageBeingProcessed->to);
+ logger->debug(TAG, "Dropping message {} for non-existent receiver {}", static_cast<void*>(messageBeingProcessed), static_cast<void*>(messageBeingProcessed->to));
delete messageBeingProcessed;
messageBeingProcessed = NULL;
continue;
}
- logger->debug(TAG, "Dispatching message {} to {}", (void*)messageBeingProcessed, (void*)messageBeingProcessed->to);
+ logger->debug(TAG, "Dispatching message {} to {}", static_cast<void*>(messageBeingProcessed), static_cast<void*>(messageBeingProcessed->to));
lockWrapper.unlock();
dispatchMessage(messageBeingProcessed);
m->from = this;
m->message = Message::PLAYER_EVENT;
m->parameter = PlayerRadioRec::STOP_PLAYBACK;
- logger->debug(TAG, "Posting message to {}...", (void*)messageQueue);
+ logger->debug(TAG, "Posting message to {}...", static_cast<void*>(messageQueue));
messageQueue->postMessage(m);
}
for (ULONG i = 0; i < numComponents; i++)
{
- LogNT::getInstance()->info(TAG, "i: {}, languages[i]={:p}:{}", i, (void*)languages[i], languages[i]);
- LogNT::getInstance()->info(TAG, "i: {}, descripti[i]={:p}:{}", i, (void*)descriptions[i], descriptions[i]);
+ LogNT::getInstance()->info(TAG, "i: {}, languages[i]={:p}:{}", i, static_cast<void*>(languages[i]), languages[i]);
+ LogNT::getInstance()->info(TAG, "i: {}, descripti[i]={:p}:{}", i, static_cast<void*>(descriptions[i]), descriptions[i]);
if (languages[i]) delete[] (languages[i]);
if (descriptions[i]) delete[] (descriptions[i]);
}
if (recInfo) delete recInfo;
recInfoFor = this;
recInfo = vdr->getRecInfo(fileName);
- logger->debug(TAG, "Recording has loaded recInfo {}", (void*)recInfo);
+ logger->debug(TAG, "Recording has loaded recInfo {}", static_cast<void*>(recInfo));
if (!vdr->isConnected()) Control::getInstance()->connectionLost();
struct sockaddr_un uds;
uds.sun_family = AF_UNIX;
strcpy(uds.sun_path, socketFile.c_str());
- int connectResult = ::connect(sockfd, (struct sockaddr *)&uds, pathLength + sizeof(uds.sun_family));
+ int connectResult = ::connect(sockfd, reinterpret_cast<struct sockaddr *>(&uds), pathLength + sizeof(uds.sun_family));
if (connectResult == 0) // success
{
return waitForConnect(connectResult);
}
+#ifdef WIN32
bool TCP::waitForConnect(int connectResult)
{
-#ifdef WIN32
if ((connectResult != SOCKET_ERROR) || (WSAGetLastError() != WSAEWOULDBLOCK))
#else
+bool TCP::waitForConnect(int)
+{
if (errno != EINPROGRESS)
#endif
{
timerList.push_back(t);
recalc = true;
timersCond.notify_all();
- logger->debug(TAG, "Timer set for {} ref {}", (void*)client, clientReference);
+ logger->debug(TAG, "Timer set for {} ref {}", static_cast<void*>(client), clientReference);
return true; // unlock
}
if (te->restartAfterFinish)
{
- logger->debug(TAG, "timerEventFinished RESTART for {} {}", (void*)te->client, te->clientReference);
+ logger->debug(TAG, "timerEventFinished RESTART for {} {}", static_cast<void*>(te->client), te->clientReference);
te->restartAfterFinish = false;
te->running = false;
te->completed = false;
if (!initted) return false;
- logger->debug(TAG, "Starting cancel timer {} {}, list size = {}", (void*)client, clientReference, timerList.size());
+ logger->debug(TAG, "Starting cancel timer {} {}, list size = {}", static_cast<void*>(client), clientReference, timerList.size());
std::unique_lock<std::mutex> lockWrapper(timersMutex); // lock
timerList.erase(i);
delete foundTimerEvent;
- logger->debug(TAG, "Removed timer for {} ref {}", (void*)client, clientReference);
+ logger->debug(TAG, "Removed timer for {} ref {}", static_cast<void*>(client), clientReference);
recalc = true;
timersCond.notify_all(); // shutdown could be being called? notify_all guarantees we wake masterLoop
return true; // unlock
{
// Case 2 b.
// The thread requesting cancelTimer is the timer thread itself, the timer has already fired.
- logger->debug(TAG, "{} ref {} cancelTimer itself calling - ignore", (void*)client, clientReference);
+ logger->debug(TAG, "{} ref {} cancelTimer itself calling - ignore", static_cast<void*>(client), clientReference);
foundTimerEvent->restartAfterFinish = false; // in case a restart had already been set.
return true; // unlock
}
// So, wait on the cond and go around each time we wake. One of them will have been after the timerThread finished,
// which turns it into a case 3.
- logger->debug(TAG, "{} ref {} cancelTimer WAITING", (void*)client, clientReference);
+ logger->debug(TAG, "{} ref {} cancelTimer WAITING", static_cast<void*>(client), clientReference);
timersCond.wait(lockWrapper); //unlocks in wait
// locked
- logger->debug(TAG, "{} ref {} cancelTimer go-around", (void*)client, clientReference);
+ logger->debug(TAG, "{} ref {} cancelTimer go-around", static_cast<void*>(client), clientReference);
} // end of the big while loop
}
threadStartProtect.lock();
threadStartProtect.unlock();
- LogNT::getInstance()->debug(TAG, "sending timer to {} with parameter {}", (void*)client, clientReference);
+ LogNT::getInstance()->debug(TAG, "sending timer to {} with parameter {}", static_cast<void*>(client), clientReference);
client->timercall(clientReference);
Timers::getInstance()->reapTimerEvent(this);
});
int newPort; // copy around because of type mismatch
if (config->getInt("server", "port", newPort))
{
- serverFromConfig.port = newPort;
+ serverFromConfig.port = static_cast<USHORT>(newPort);
logger->debug(TAG, "Port read fron config: {}", serverFromConfig.port);
}
// Now we have > 0 servers found
- for (ULONG i = 0; i < numServers; i++)
+ for (int i = 0; i < numServers; i++)
logger->info(TAG, "Found server: {} {} {} {}", vdpc[i].ipVersion, vdpc[i].ip.c_str(), vdpc[i].name.c_str(), vdpc[i].port, vdpc[i].version);
if (numServers == 1)
time_t now;
time(&now);
eventLista[0] = VDR::getInstance()->getChannelSchedule(channelNumber, now, 24 * 60 * 60 * 30); // one month
- LogNT::getInstance()->debug(TAG, "Eventlist {:#x} {}", (void*)eventLista[0], channelNumber);
+ LogNT::getInstance()->debug(TAG, "Eventlist {:#x} {}", static_cast<void*>(eventLista[0]), channelNumber);
}
void VEpgListAdvanced::drawData(bool doIndexPop)
setPosition(50, v->getScreenHeight()-50);
setTitleBarOn(0);
info=NULL;
- LogNT::getInstance()->debug("VPictureBanner", "created {}", (void*)this);
+ LogNT::getInstance()->debug("VPictureBanner", "created {}", static_cast<void*>(this));
//TODO compute sizes from text
rotsize=70;
infsize=50;
VPictureBanner::~VPictureBanner()
{
MessageQueue::getInstance()->removeReceiver(this);
- LogNT::getInstance()->debug("VPictureBanner", "deleted {}", (void*)this);
+ LogNT::getInstance()->debug("VPictureBanner", "deleted {}", static_cast<void*>(this));
}
{
if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY()))
{
- // FIXME - this probably also breaks
Input::sendInputKey(Input::OK);
}
}