]> git.vomp.tv Git - vompclient.git/commitdiff
Some compiler warning fixes
authorChris Tallon <chris@vomp.tv>
Tue, 24 Jan 2017 23:21:45 +0000 (23:21 +0000)
committerChris Tallon <chris@vomp.tv>
Tue, 24 Jan 2017 23:21:45 +0000 (23:21 +0000)
23 files changed:
command.cc
defines.h
demuxer.cc
dsock.cc
dsock.h
dvbsubtitles.cc
osdvector.h
player.cc [changed mode: 0755->0644]
remote.cc
remote.h
remotelinux.cc
remotelinux.h
surface.cc
tcp.cc [changed mode: 0755->0644]
teletextdecodervbiebu.cc
vdr.cc
vepg.cc
vepglistadvanced.cc
vvideorec.cc
wol.cc
wpictureview.cc
wsymbol.cc
wtvmedia.cc

index 2bd5f493f06de19226bd8f04f118c3b078e1211a..6c6d99ce6cb0f58e64ee31974d94de483a60c0c3 100644 (file)
@@ -812,7 +812,7 @@ int Command::getLangPref(bool subtitle,const char* langcode)
                size_t pos=(*itty).langcode.find(templangcode);
                if (pos != string::npos) {
                        vector<struct ASLPref>::iterator itty2=langcodes.begin();
-                       for (int i=0; i<langcodes.size();i++) {
+                       for (unsigned int i=0; i<langcodes.size();i++) {
                                int pref=0;
                                if (subtitle) {
                                        pref=langcodes[i].subtitlepref;
index eb507c6ca06073440dd30bbd2b761bfc4b0f6112..ca9a1eeefb3f506b1d083e5d9e1b0747827f8b4b 100644 (file)
--- a/defines.h
+++ b/defines.h
@@ -47,6 +47,7 @@ int getClockRealTime(struct timespec *tp);
   #define Thread_TYPE ThreadWin
   #define ThreadID_TYPE unsigned int
   #define VectorHandle void* 
+  #define VECTOR_HANDLE_INIT NULL
 #ifndef WINDOWS_LEGACY
   #define Osd_TYPE OsdWinVector
   #define Surface_TYPE SurfaceVector
@@ -142,6 +143,8 @@ int getClockRealTime(struct timespec *tp);
   #define GRADIENT_DRAWING
   #define ADVANCED_MENUES // This is for special HD versions of our menus
   #define VectorHandle unsigned int 
+  #define VECTOR_HANDLE_INIT 0
+
 
   #define PICTURE_DECODER_MAGICK
   #define PICTURE_DECODER_OMX
@@ -169,6 +172,7 @@ int getClockRealTime(struct timespec *tp);
   #define VOMP_LINUX_CLOCK  CLOCK_REALTIME
 
   #define VectorHandle void*
+  #define VECTOR_HANDLE_INIT NULL
 
 #endif
 
index b8079236e996e79c5ca33bdad82fe136cc10d29e..50343cb101f59d737c1f354c9e187fad88cc3632 100644 (file)
@@ -392,7 +392,7 @@ UINT PESPacket::countPictureHeaders(bool h264, struct PictCountInfo& pinfo) cons
                                          nalu.getSe();
                                          nalu.getSe();
                                          UINT temp2=nalu.getUe();
-                                         for (int i=0;i<temp2;i++)
+                                         for (UINT i=0;i<temp2;i++)
                                                  nalu.getSe();
                                  }
                                  nalu.getUe(); //Num refframes
@@ -1006,7 +1006,7 @@ void Demuxer::parsePacketDetails(PESPacket& packet)
                     nalu.getSe();
                     nalu.getSe();
                     UINT temp2=nalu.getUe();
-                    for (int i=0;i<temp2;i++)
+                    for (UINT i=0;i<temp2;i++)
                         nalu.getSe();
                 }
                 nalu.getUe(); //Num refframes
index faa2485469be4c36533c90f77fda200f5b1e2d84..3ad854ea6f4d34020a5f8195d5d7c2b707b6cf12 100644 (file)
--- a/dsock.cc
+++ b/dsock.cc
@@ -140,7 +140,7 @@ char *DatagramSocket::getData(void)             {  return buf;  }
 char *DatagramSocket::getFromIPA(void)          {  return fromIPA;  }
 short DatagramSocket::getFromPort(void) const   {  return fromPort; }
 
-void DatagramSocket::send(char *ipa, short port, char *message, int length)
+void DatagramSocket::send(const char *ipa, short port, char *message, int length)
 {
   if (!initted) return;
 
diff --git a/dsock.h b/dsock.h
index 1c63bd22ccfa8ee0dcd526dd57da84e731cf8287..6723260fc6c7f147622fbf853e70697b7df608a8 100644 (file)
--- a/dsock.h
+++ b/dsock.h
@@ -56,7 +56,7 @@ class DatagramSocket
     char *getData(void);               // returns a pointer to the data
     char *getFromIPA(void);            // returns a pointer to from IP address
     short getFromPort(void) const;
-    void send(char *, short, char *, int); // send wants: IP Address ddn style, port,
+    void send(const char *, short, char *, int); // send wants: IP Address ddn style, port,
                                            // data, length of data
   private:
     bool initted;
index 2d9e7b7f3d434880d5a620dd1f819f9c91e25129..316e4035088c172df8f124c12f167ba86b101ae4 100644 (file)
@@ -51,8 +51,8 @@ uint64_t cTimeMs::Now(void)
   if (getClockRealTime(&tp) == 0)
     return (uint64_t(tp.tv_sec)) * 1000 + tp.tv_nsec / 1000000;
   else
-    Log::getInstance()->log("SUBTITLES", Log::DEBUG, "cTimeMs: clock_gettime(CLOCK_REALTIME) failed");
-
+    Log::getInstance()->log("SUBTITLES", Log::ERR, "cTimeMs: clock_gettime(CLOCK_REALTIME) failed");
+  return 0;
 }
 
 void cTimeMs::Set(int Ms)
index 41935b20850fd88c6adcb8bd401dd8f81b1d5383..9babaa6f06ce0a4669943798e014f2f7865e2b19 100644 (file)
@@ -71,7 +71,7 @@ public:
     {
                instr=DrawNoop;
                x=y=w=h=0;
-               reference = NULL;
+               reference = VECTOR_HANDLE_INIT;
     };
 
        inline static SVGCommand PaintPath(float ix, float iy, float iw, float ih, PathIndex path, VectorHandle ref)
old mode 100755 (executable)
new mode 100644 (file)
index 2144520e66d7652e27cbfc1370519bb7c6d0d325..c0e4c519468a28df690f93a8245949ae3ef19552 100644 (file)
--- a/remote.cc
+++ b/remote.cc
@@ -247,10 +247,9 @@ void Remote::LoadKeysConfig(VDR *vdr,const char *cfg)
        ULONG number=0;
        if (sscanf(cfg,"%ld",&number) != 1) return;
        Log::getInstance()->log("Remote", Log::INFO, "Config General/Remote keys num keys %d",number);
-       char buffer[1024];
        char keybuf[1024];
-       for (int i = 0; i < number; i++) {
-               sprintf(keybuf, "RemoteKey%d", i);
+       for (ULONG i = 0; i < number; i++) {
+               sprintf(keybuf, "RemoteKey%lu", i);
                const char *keytrans = vdr->configLoad("General", keybuf);
                if (keytrans) {
                        ULONG ul1, ul2;
index 19f370190593f665610cc7903f1a8b0645a24fb4..9ebc4e46c3a001083c0b35fc53122a9b6daf936f 100644 (file)
--- a/remote.h
+++ b/remote.h
@@ -49,7 +49,7 @@ class Remote: public AbstractOption
     void SaveKeysConfig();
     void EnterLearningMode(UCHAR command);
 
-    virtual int init(char *devName)=0;
+    virtual int init(const char *devName)=0;
     virtual int shutdown()=0;
     virtual UCHAR getButtonPress(int how)=0;
     virtual void clearBuffer()=0;
index f5ef7b8cc98a9a3ddae47a2a1a52dd7215dbe621..2d0270b1ed46571c0be5f2965b8ac967db74dcdf 100644 (file)
@@ -77,7 +77,7 @@ RemoteLinux::~RemoteLinux()
 #define test_bit(input,b)  ((1 << ((b) % 8))&(input)[b / 8] )
 
 
-int RemoteLinux::init(char* devName)
+int RemoteLinux::init(const char* devName)
 {
   if (initted) return 0;
   initted = 1;
@@ -248,7 +248,7 @@ UCHAR RemoteLinux::getButtonPress(int waitType) {
                FD_ZERO(&readfds);
 
                int maxfd = 0;
-               for (int i = 0; i < devices.size(); i++) {
+               for (unsigned int i = 0; i < devices.size(); i++) {
                        int cur_fd = devices[i];
                        maxfd = max(cur_fd, maxfd);
                        FD_SET(cur_fd, &readfds);
@@ -276,7 +276,7 @@ UCHAR RemoteLinux::getButtonPress(int waitType) {
                                return NA_SIGNAL;
 
                        }
-                       for (int i = 0; i < devices.size(); i++) {
+                       for (unsigned int i = 0; i < devices.size(); i++) {
                                int cur_fd = devices[i];
                                if (FD_ISSET(cur_fd, &readfds)) {
                                        struct input_event ev;
index 5e996ae6e8281e36012e53717cd6086f9b541f6d..da6b59296cd9250896f5479cf15bd4eb8626f062 100644 (file)
@@ -40,7 +40,7 @@ class RemoteLinux : public Remote
     RemoteLinux();
     virtual ~RemoteLinux();
 
-    int init(char *devName);
+    int init(const char *devName);
     int shutdown();
     int getDevice();
     UCHAR getButtonPress(int how);
index d3397b32338edb369e9c5e6e80325024b7d3adbf..bf49f0a32f9ad57e2b1bde3910f92e14c6ef82d1 100644 (file)
@@ -254,8 +254,8 @@ void Surface::drawTTChar(int ox, int oy, int x, int y, cTeletextChar c)
     } else {
         charsizey=18;
     }
-    int ttcharsizex=12;
-    int ttcharsizey=10;
+    //int ttcharsizex=12;
+    //int ttcharsizey=10;
     int screenposx=charsizex*x+ox; //12*40= 480 250
     int screenposy=y*charsizey+oy;
 
@@ -285,11 +285,11 @@ void Surface::drawTTChar(int ox, int oy, int x, int y, cTeletextChar c)
                 (uuc.green*fac1+ulc.green*fac2+luc.green*fac3+llc.green*fac4)/256,
                 (uuc.blue*fac1+ulc.blue*fac2+luc.blue*fac3+llc.blue*fac4)/256,
                 (uuc.alpha*fac1+ulc.alpha*fac2+luc.alpha*fac3+llc.alpha*fac4)/256); //if this is too slow make a table
-            int c = (  (res.alpha << 24 )
-                        | (res.red    << 16)
-                        | (res.green  <<  8)
-                        | (res.blue        ) );
-            drawPixel(screenposx+px,screenposy+py,c, true);
+            int newcolour = (  (res.alpha  << 24)
+                             | (res.red    << 16)
+                             | (res.green  <<  8)
+                             | (res.blue        ) );
+            drawPixel(screenposx+px, screenposy+py, newcolour, true);
         }
     }
 
@@ -302,7 +302,7 @@ void Surface::drawTTChar(int ox, int oy, int x, int y, cTeletextChar c)
 void Surface::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,
                unsigned int width, DrawStyle& nextColour) {
        startFastDraw();
-       int x, y;
+       unsigned int x, y;
        unsigned int bytesIn, bitsIn;
        int widthBytes=width/8;
        for (y = 0; y < height; y++) {
diff --git a/tcp.cc b/tcp.cc
old mode 100755 (executable)
new mode 100644 (file)
index ea1c80f..91e9049
--- a/tcp.cc
+++ b/tcp.cc
@@ -238,7 +238,6 @@ int TCP::sendData(void* bufR, size_t count)
 {
   size_t bytes_sent = 0;
   int this_write;
-  int temp_write;
 
   unsigned char* buf = (unsigned char*)bufR;
 
@@ -249,11 +248,11 @@ int TCP::sendData(void* bufR, size_t count)
     do
     {
 #ifndef WIN32
-      temp_write = this_write = write(sock, buf, count - bytes_sent);
-//      Log::getInstance()->log("TCP", Log::DEBUG, "TCP has written %i bytes", temp_write);
+      this_write = write(sock, buf, count - bytes_sent);
+//      Log::getInstance()->log("TCP", Log::DEBUG, "TCP has written %i bytes", this_write);
     } while ( (this_write < 0) && (errno == EINTR) );
 #else
-      temp_write = this_write = send(sock,(char*) buf, count- bytes_sent,0);
+      this_write = send(sock,(char*) buf, count- bytes_sent,0);
     } while ( (this_write == SOCKET_ERROR) && (WSAGetLastError() == WSAEINTR) );
 #endif
     if (this_write <= 0)
index 008346974628c4135f31962b79445ff5fc6ef8e2..0ea194f976475ace43d042973aa40482ab3ec3ab 100644 (file)
@@ -274,7 +274,7 @@ void TeletextDecoderVBIEBU::DecodeTeletext(const UCHAR* buffer, unsigned int fie
        }
        int pagenumber=hdrbuf[1];
        int pagemagazin=magazin<<8 | pagenumber;
-       int pagesubnumber=(hdrbuf[2]) || ((hdrbuf[3]<<8) & 0x3f7f);
+       // int pagesubnumber=(hdrbuf[2]) || ((hdrbuf[3]<<8) & 0x3f7f);
 
        if (pagemagazin == selectedpage) ourpage=true;
        else ourpage=false;
diff --git a/vdr.cc b/vdr.cc
index 28724a2d5c42d0c86fa214f5a45e12d4e1a98c4e..46f37b8063d1510c495d1f0472e77c7fe40333f3 100644 (file)
--- a/vdr.cc
+++ b/vdr.cc
@@ -675,7 +675,7 @@ int VDR::doLogin(unsigned int* v_server_min, unsigned int* v_server_max, unsigne
          unsigned int numlangcodes = vresp->extractULONG();
          subtitles = vresp->extractULONG();
          list.clear();
-         for (int i=0; i<numlangcodes; i++) {
+         for (unsigned int i=0; i<numlangcodes; i++) {
                  ASLPref newpref;
                  newpref.audiopref = vresp->extractLONG();
                  newpref.subtitlepref = vresp->extractLONG();
@@ -1866,7 +1866,7 @@ ULONG VDR::loadTVMediaRecThumb(TVMediaInfo & media)
        VDR_RequestPacket vrp;
 
        if (!vrp.init(VDR_LOADTVMEDIARECTHUMB, false, 0)) return -1;
-       if (!vrp.addString(media.primary_name.c_str())) return NULL;
+       if (!vrp.addString(media.primary_name.c_str())) return -1;
 
        VDR_PacketReceiver* vdrpr = new VDR_PacketReceiver();
        vdrpr->receiverChannel = VDR::CHANNEL_TVMEDIA;
@@ -1888,8 +1888,8 @@ ULONG VDR::loadTVMediaEventThumb(TVMediaInfo & media)
        VDR_RequestPacket vrp;
 
        if (!vrp.init(VDR_LOADTVMEDIAEVENTTHUMB, false, 0)) return -1;
-       if (!vrp.addULONG(media.primary_id)) return NULL;
-       if (!vrp.addULONG(media.secondary_id)) return NULL;
+       if (!vrp.addULONG(media.primary_id)) return -1;
+       if (!vrp.addULONG(media.secondary_id)) return -1;
 
        VDR_PacketReceiver* vdrpr = new VDR_PacketReceiver();
        vdrpr->receiverChannel = VDR::CHANNEL_TVMEDIA;
@@ -1911,7 +1911,7 @@ ULONG VDR::loadChannelLogo(TVMediaInfo & media)
        VDR_RequestPacket vrp;
 
        if (!vrp.init(VDR_LOADCHANNELLOGO, false, 0)) return -1;
-       if (!vrp.addULONG(media.primary_id)) return NULL;
+       if (!vrp.addULONG(media.primary_id)) return -1;
 
        VDR_PacketReceiver* vdrpr = new VDR_PacketReceiver();
        vdrpr->receiverChannel = VDR::CHANNEL_TVMEDIA;
diff --git a/vepg.cc b/vepg.cc
index a5babd0d97764bc76d1991fcfda5b001bb130c00..6f2b8003185648cabe4e3c5f2e537a8f19a4e906 100644 (file)
--- a/vepg.cc
+++ b/vepg.cc
@@ -323,7 +323,7 @@ void VEpg::drawData()
   // Not doing View::draw() every time causes
   // things not to be cleared off the surface properly
   // So, blank out the data area first
-  int screenwidth=Video::getInstance()->getScreenWidth();
+  //int screenwidth=Video::getInstance()->getScreenWidth();
   rectangle(
     chanListbox.getRootBoxOffsetX(),
     chanListbox.getRootBoxOffsetY() - getFontHeight() - 3,
index 7a02a8dabc9e4598734beebdcbf2f99179187308..22fb0a26141fa5f5a511ca51b76e4342d147f8a9 100644 (file)
@@ -401,7 +401,7 @@ void VEpgListAdvanced::updateEpgDataNowNext(bool changeState)
        for(int listIndex = startupdate; listIndex < endupdate; listIndex++)
        {
                if (listIndex < 0) continue;
-               if (listIndex >= chanlistsize) continue;
+               if (listIndex >= (int)chanlistsize) continue;
 
            chan = (*chanList)[listIndex];
                if (!eventLista[listIndex]) eventLista[listIndex] = VDR::getInstance()->getChannelSchedule(chan->number, now, 4 * 60 *60);
index 715605386d988bb11b1de12f88894d7c21d80063..3b0c879fefc8f846ff04263ded9628ec01b96a83 100644 (file)
@@ -708,7 +708,7 @@ void VVideoRec::doAudioSelector()
         ULONG mp_audcounter = 0;
         ULONG ac3_counter = 0;
         int dvb_subcounter = 1;*/
-        int i;
+        ULONG i;
         
         /*unsigned char type;
         char* lang;
diff --git a/wol.cc b/wol.cc
index 0772d00c97c9455b687f827ac74ce95eb831fd58..38f124409145a307fb4ff1e7a0329586863849ba 100644 (file)
--- a/wol.cc
+++ b/wol.cc
@@ -155,13 +155,15 @@ int Wol::find_ether(char *name)
 /* Input an Ethernet address and convert to binary. */
 int Wol::convertToBinary(char *bufp, unsigned char *addr)
 {
-    char c, *orig;
+    char c;
+#ifdef DEBUG
+    char* orig = bufp;
+#endif
     int i;
-        unsigned char *ptr = addr;
+    unsigned char *ptr = addr;
     unsigned val;
 
     i = 0;
-    orig = bufp;
     while ((*bufp != '\0') && (i < ETH_ALEN))
     {
         val = 0;
index 55a81f2b9e40c3caa36478350f8946e07093477c..9922318a814114d2c2f8fdddd8162af3207501b9 100644 (file)
@@ -231,7 +231,7 @@ WActorGallery::WActorGallery(Actors& actors)
 
 WArtworkGallery::WArtworkGallery(MovieInfo& movie)
 {
-       float pixelaspect=Osd::getInstance()->getPixelAspect();
+//     float pixelaspect=Osd::getInstance()->getPixelAspect();
        addTVMedia(movie.fanart);
        addTVMedia(movie.collectionFanart);
        addTVMedia(movie.collectionPoster);
index 99b08572be0775d8c57abd72ce6af27b4ffa9ca5..a5da06443d759dcc9dde8012c7ecba51c0aa1c02 100644 (file)
@@ -1076,7 +1076,7 @@ void WSymbol::draw()
   int widthBits = widthBytes * 8;
   int sHeight = heights[nextSymbol];
 
-  int x, y, bytesIn, bitsIn;
+//  int x, y, bytesIn, bitsIn;
 
   drawMonoBitmap(base,0,0,sHeight,widthBits, nextColour);
  /* startFastDraw();
index ca59b119107140c669c0310df5739b945f4b0ddd..8e03805e5acf15c2c84f215fd0c562fdfd3a7a44 100644 (file)
@@ -58,6 +58,9 @@
         case ZoomBoth:
                 w = area.w;
                 h = area.h; break;
+
+        case NoZoom:
+          ; // ?
         }
         drawTVMedia(info,0.f,0.f,w,h,TopLeft);