]> git.vomp.tv Git - vompclient.git/commitdiff
43 CWFs
authorChris Tallon <chris@vomp.tv>
Sat, 25 Sep 2021 16:26:03 +0000 (17:26 +0100)
committerChris Tallon <chris@vomp.tv>
Sat, 25 Sep 2021 16:26:03 +0000 (17:26 +0100)
16 files changed:
boxstack.cc
boxx.cc
config.cc
inputlirc.cc
inputman.cc
inputman.h
messagequeue.cc
playerradiorec.cc
recinfo.cc
recording.cc
tcp.cc
timers.cc
vconnect.cc
vepglistadvanced.cc
vpicturebanner.cc
vserverselect.cc

index 415fb4b6af15745df12af8ed545423da6dee6a3e..95774758fcf04c41803b1937615f478bea5e1af9 100644 (file)
@@ -187,7 +187,7 @@ int BoxStack::remove(Boxx* toDelete)
   // 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();
@@ -483,7 +483,7 @@ void BoxStack::removeAllExceptWallpaper()
     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;
@@ -510,19 +510,18 @@ int BoxStack::handleCommand(int command)
     {
       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]);
diff --git a/boxx.cc b/boxx.cc
index bc7bdcb70c78a46a6d12b506e1c431331d85acad..342f64c68cf7410cf3a9d6ba78fd985d04e89e27 100644 (file)
--- a/boxx.cc
+++ b/boxx.cc
@@ -94,7 +94,7 @@ void Boxx::remove(Boxx* oldChild)
       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)
index 0b46e14e78f9060dbd24a207c075c5547e43f261..a6230a56aacfcc8f120a57ba94f175c3b0121402 100644 (file)
--- a/config.cc
+++ b/config.cc
@@ -93,7 +93,7 @@ bool Config::getInt(const std::string& section, const std::string& key, int& out
 {
   Json::Value v = jconfigro[section][key];
   if (!v.isInt64()) return false;
-  out = v.asInt64();
+  out = static_cast<int>(v.asInt64());
   return true;
 }
 
index c112ece1589bf472d6cf14ec11a6f86d077276e3..0e786e641b8d7115d94cfe2be4c3cbff3adf6c14 100644 (file)
@@ -109,7 +109,7 @@ bool InputLIRC::start()
   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);
 
@@ -124,7 +124,7 @@ bool InputLIRC::start()
   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)
index c7088f05c1b37f14736fb1dd55e61568d2656317..a8573eff8547e880f8576b78899d8f004256f111 100644 (file)
@@ -387,7 +387,7 @@ const char* InputMan::getVompKeyName(UCHAR number)
   }
 }
 
-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;
index 923a2418bb5f015c0fa94aef0c44fcc464e99ace..4740b15c520350755df667c517f4ecabe8dd0482 100644 (file)
@@ -117,7 +117,7 @@ class InputMan: public AbstractOption
     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);
index 51d67f2b198a0a0d0f6b98ea36426bcace4842d5..22a16ebce8bb85d92ac92f6d64c687801be84fe8 100644 (file)
@@ -68,7 +68,7 @@ void MessageQueue::addReceiver(MessageReceiver* newMR)
 
   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);
   }
 }
@@ -83,13 +83,13 @@ void MessageQueue::removeReceiver(MessageReceiver* toRemove)
 
   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));
@@ -100,12 +100,12 @@ void MessageQueue::removeReceiver(MessageReceiver* toRemove)
       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;
     }
   }
@@ -131,13 +131,13 @@ void MessageQueue::messageLoop()
       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);
index a4f881bfc16c97e0699bcc731f5b45edb91eb2cd..be63041c5de79b7fbbba7de126eb4dcfdf7a4369 100644 (file)
@@ -541,6 +541,6 @@ void PlayerRadioRec::threadMethod()
   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);
 }
index 77e9056a86c4eb6f74ba20d46a0b2926d1f6f4ec..9c9cdf127d3010a650c3a4ed63cc8fb71a2134a9 100644 (file)
@@ -60,8 +60,8 @@ RecInfo::~RecInfo()
 
   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]);
   }
index 3142ef718f3af2f738e3a23f57efe2683db1c791..153e6d7c563fae3eb32274f27d5decb4c2ba59d3 100644 (file)
@@ -109,7 +109,7 @@ void Recording::loadRecInfo()
   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();
 
diff --git a/tcp.cc b/tcp.cc
index ddf955b6f934f169e248ab8ba1f3294a4aeae771..7debd2cf7b9362a25e040ba47135c4836167c9c5 100644 (file)
--- a/tcp.cc
+++ b/tcp.cc
@@ -103,7 +103,7 @@ bool TCP::connectSocket(const std::string& socketFile)
   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
   {
@@ -161,11 +161,13 @@ bool TCP::connect(const std::string& ip, USHORT port)
   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
   {
index 4a69709fb70720ebbe923056eef5ebd8bd0eaef9..9f579cd9e8fc02b848aa6f8bb0b2eccaa8713430 100644 (file)
--- a/timers.cc
+++ b/timers.cc
@@ -163,7 +163,7 @@ bool Timers::setTimerC(TimerReceiver* client, int clientReference, std::chrono::
   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
 }
 
@@ -258,7 +258,7 @@ void Timers::reap() // Master timers thread, mutex locked (or shutdown, mutex lo
 
       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;
@@ -312,7 +312,7 @@ bool Timers::cancelTimer(TimerReceiver* client, int clientReference)
 
   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
 
@@ -343,7 +343,7 @@ bool Timers::cancelTimer(TimerReceiver* client, int clientReference)
 
       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
@@ -353,7 +353,7 @@ bool Timers::cancelTimer(TimerReceiver* client, int clientReference)
     {
       // 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
     }
@@ -365,10 +365,10 @@ bool Timers::cancelTimer(TimerReceiver* client, int clientReference)
     // 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
 }
@@ -385,7 +385,7 @@ void TimerEvent::run()
     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);
   });
index fc5018f812896bb31b06dd77154ab783796ebc1c..a98368903ccd918689dd53306aa638e71f804720 100644 (file)
@@ -123,7 +123,7 @@ void VConnect::threadMethod()
     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);
     }
 
@@ -162,7 +162,7 @@ void VConnect::threadMethod()
 
     // 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)
index e09c7fb151535da8b784dc44de4e4a4dff965818..8f87ff3f28f8b71cb6ff9602ff46555a06179590 100644 (file)
@@ -467,7 +467,7 @@ void VEpgListAdvanced::updateEpgDataChannel()
   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)
index e266ab3abf5c4dcb2696a16093bdb6ff73d5070b..50830879826c239af8702a14db157053074e6739 100644 (file)
@@ -39,7 +39,7 @@ VPictureBanner::VPictureBanner(bool ld, bool sl)
   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;
@@ -50,7 +50,7 @@ VPictureBanner::VPictureBanner(bool ld, bool sl)
 VPictureBanner::~VPictureBanner()
 {
   MessageQueue::getInstance()->removeReceiver(this);
-  LogNT::getInstance()->debug("VPictureBanner", "deleted {}", (void*)this);
+  LogNT::getInstance()->debug("VPictureBanner", "deleted {}", static_cast<void*>(this));
 }
 
 
index 38f5c4c33eb6e640eb64b303eae168a1df7c4f9f..0f01528f979ce8e4b49b250be902350a6ce3d46c 100644 (file)
@@ -114,7 +114,6 @@ void VServerSelect::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY()))
     {
-      // FIXME - this probably also breaks
       Input::sendInputKey(Input::OK);
     }
   }