]> git.vomp.tv Git - vompclient.git/commitdiff
20 warnings. Ish. Change Message::ADD_VIEW to use void* data for view pointer
authorChris Tallon <chris@vomp.tv>
Thu, 6 Feb 2020 15:59:53 +0000 (15:59 +0000)
committerChris Tallon <chris@vomp.tv>
Thu, 6 Feb 2020 15:59:53 +0000 (15:59 +0000)
13 files changed:
GNUmakefile
boxstack.cc
surfacevector.h
tcp.cc
vepgsettimer.cc
vmedialist.cc
vradiorec.cc
vrecording.cc
vsleeptimer.cc
vteletextview.cc
vvideomedia.cc
vvideorec.cc
wol.cc

index 81267bfc5ee01d55d671877a56e12f08adb90571..82382801a1c3a89709fa3dd342a569f905bbfc41 100644 (file)
@@ -61,7 +61,7 @@ OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY)
 CROSSLIBS =
 INCLUDES = -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/usr/include/freetype2 -I/usr/include/ImageMagick -I/usr/include/ImageMagick-6 -I/usr/include/arm-linux-gnueabihf/ImageMagick-6
 PLATFORM = -DVOMP_PLATFORM_RASPBERRY
-CXXFLAGS_EXTRA =
+CXXFLAGS_EXTRA = -Wno-psabi
 endif
 
 ifeq ($(vomp_platform),crossraspberry)
index 5ba9cc8581683e35d39f71c3455295c39ed7de99..9813615bb9e69856f1fe35eaeda9325b7857b627 100644 (file)
@@ -591,7 +591,7 @@ void BoxStack::processMessage(Message* m)
     }
     case Message::ADD_VIEW:
     {
-      Boxx* toAdd = reinterpret_cast<Boxx*>(m->parameter);
+      Boxx* toAdd = reinterpret_cast<Boxx*>(m->data);
       add(toAdd);
       toAdd->draw();
       update(toAdd);
index a052452cfb1f6d8c430b4ee75ee674dd06129598..903df7a70d3ed64cb75c4e1467609aae4583c314 100644 (file)
@@ -64,7 +64,7 @@ class SurfaceVector : public Surface
     void drawTTChar(int ox, int oy,int x, int y, cTeletextChar c);
 
     void readPixel(int /* x */, int /* y */, unsigned char* /* r */, unsigned char* /* g */, unsigned char* /* b */) {};
-    void screenShot(const char* fileName) {};
+    void screenShot(const char* /* fileName */) {};
 
   protected:
 
@@ -75,8 +75,8 @@ class SurfaceVector : public Surface
     Mutex command_mutex;
     OsdVector* osd;
 
-    void drawPixel(int x, int y, unsigned int c, bool fastdraw){}; // these are not supported!
-    void drawPixel(int x, int y, Colour& c, bool fastdraw){};
+    void drawPixel(int /* x */, int /* y */, unsigned int /* c */, bool /* fastdraw */){}; // these are not supported!
+    void drawPixel(int /* x */, int /* y */, Colour& /* c */, bool /* fastdraw */){};
 };
 
 #endif
diff --git a/tcp.cc b/tcp.cc
index 278816c77e0c54fce3cfc2f1ac1f09d1b9624640..bbee70de92995fdf67c11120292cd8b9021adb1f 100644 (file)
--- a/tcp.cc
+++ b/tcp.cc
@@ -227,9 +227,9 @@ int TCP::connectTo(char* host, unsigned short port)
   // so the socket became available for writing. Contrary to expectation, this doesn't actually
   // mean it connected...
 
-  int soError;
+  int soError; // SO_ERROR optval is int
   socklen_t soErrorSize = sizeof(soError);
-  int gso = getsockopt(sock, SOL_SOCKET, SO_ERROR,(char*) &soError, &soErrorSize);
+  int gso = getsockopt(sock, SOL_SOCKET, SO_ERROR, reinterpret_cast<void*>(&soError), &soErrorSize);
 
   if ((gso == 0) && (soError == 0))
   {
@@ -263,7 +263,9 @@ The full documentation:
 void TCP::setReceiveWindow(size_t rxBufferSize)
 {
   // Set receive window
-  int r = setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char*)&rxBufferSize, sizeof(size_t));
+  // According to docs, optval in setsockopt is a pointer to int unless otherwise noted
+  int rxSize = rxBufferSize;
+  int r = setsockopt(sock, SOL_SOCKET, SO_RCVBUF, reinterpret_cast<void*>(&rxSize), sizeof(size_t));
   Log::getInstance()->log("TCP", Log::DEBUG, "Set receive window to %i, success(=0): %i", rxBufferSize, r);
 }
 
@@ -282,7 +284,7 @@ int TCP::sendData(void* bufR, size_t count)
   size_t bytes_sent = 0;
   int this_write;
 
-  unsigned char* buf = (unsigned char*)bufR;
+  unsigned char* buf = static_cast<unsigned char*>(bufR);
 
   MUTEX_LOCK(&mutex);
 
index 0725c080fa7e44c5625e86757499e0d4abb461a8..2f1bf3bd089bd6ef51b81e6882fe82fde1e52b65 100644 (file)
@@ -279,7 +279,7 @@ void VEpgSetTimer::doit()
   Message* m = new Message();
   m->message = Message::ADD_VIEW;
   m->to = boxstack;
-  m->parameter = (ULONG)vi;
+  m->data = reinterpret_cast<void*>(vi);
   MessageQueue::getInstance()->postMessage(m);
 }
 
index 63db05f26081512b2cace82d3a0f5677f2b252a0..472d3cc61042ebd01dc51394da186cbce436d707 100644 (file)
@@ -1184,7 +1184,7 @@ int VMediaList::load() {
     Message* m = new Message();
     m->message = Message::ADD_VIEW;
     m->to = boxstack;
-    m->parameter = (ULONG)vi;
+    m->data = reinterpret_cast<void*>(vi);
     MessageQueue::getInstance()->postMessage(m);
   }
   return 1;
index 9b9b5f0db0d63ea7d4f5efc524ea83954fcdb491..416a1e3086613f52d3c542550897bc6471daf2d9 100644 (file)
@@ -177,7 +177,7 @@ void VRadioRec::go(bool resume)
     m = new Message();
     m->message = Message::ADD_VIEW;
     m->to = boxstack;
-    m->parameter = (ULONG)vi;
+    m->data = reinterpret_cast<void*>(vi);
     MessageQueue::getInstance()->postMessage(m);
   }
 }
index cb569d9d3327eed6b514f20d0611ae3837c7b539..3e50fdcf137907b66396761be70ff910c89d6ec9 100644 (file)
@@ -265,7 +265,7 @@ int VRecording::handleCommand(int command)
               Message* m = new Message();
               m->message = Message::ADD_VIEW;
               m->to = BoxStack::getInstance();
-              m->parameter = (ULONG)vi;
+              m->data = reinterpret_cast<void*>(vi);
               MessageQueue::getInstance()->postMessage(m);
 
               if (ret == 1)
index 7402047e7b3179f2ae81e3b612541111bd5011df..826e33d40c8722b659aba7bf643b2e8e518ab045 100644 (file)
@@ -161,7 +161,7 @@ void Sleeptimer::threadMethod()
       Message* m1 = new Message();
       m1->message = Message::ADD_VIEW;
       m1->to = BoxStack::getInstance();
-      m1->parameter = reinterpret_cast<ULONG>(count);
+      m1->data = reinterpret_cast<void*>(count);
       MessageQueue::getInstance()->postMessage(m1);
     }
     MILLISLEEP(1000);
index bc765f652396f44f39f9395af413a2fe967b780b..5e47bc475bd853b45e8ce799e37c9409361942a5 100644 (file)
@@ -175,7 +175,7 @@ void VTeletextView::doKey(int command)
 
 }
 
-void VTeletextView::timercall(int clientReference)
+void VTeletextView::timercall(int /* clientReference */)
 {
     
 }
index d6154f894ccf53203d75bb63ee289b8eb2b47f2a..efb2bdcfb6145f083defc45cd56e4ad91d9a5d0e 100644 (file)
@@ -193,7 +193,7 @@ void VVideoMedia::go(bool resume)
     m = new Message();
     m->message = Message::ADD_VIEW;
     m->to = boxstack;
-    m->parameter = (ULONG)vi;
+    m->data = reinterpret_cast<void*>(vi);
     MessageQueue::getInstance()->postMessage(m);
   }
 }
index 43e4b7bd398e9533a795b7f1f798f4e42e5d8784..0be0d5cf2edcac94d76220d14b759f35950f3450 100644 (file)
@@ -214,7 +214,7 @@ void VVideoRec::go(bool resume)
     m = new Message();
     m->message = Message::ADD_VIEW;
     m->to = boxstack;
-    m->parameter = (ULONG)vi;
+    m->data = reinterpret_cast<void*>(vi);
     MessageQueue::getInstance()->postMessage(m);
   }
 }
diff --git a/wol.cc b/wol.cc
index 38f124409145a307fb4ff1e7a0329586863849ba..c5b7f0babb0acc8c09e599529b7570f9ebd92e2e 100644 (file)
--- a/wol.cc
+++ b/wol.cc
@@ -273,7 +273,7 @@ int Wol::doWakeUp()
       *ptr++ = ethaddr [i];
 
   /* Send the packet out */
-  if (sendto (packet,(char*) buf, 102, 0, (struct sockaddr *)&sap, sizeof (sap)) < 0)
+  if (sendto (packet,(char*) buf, 102, 0, reinterpret_cast<struct sockaddr *>(&sap), sizeof (sap)) < 0)
   {
     fprintf (stderr, " sendto failed, %s\n",
     strerror(errno));