]> git.vomp.tv Git - vompclient.git/commitdiff
Compiler warning fixes for MVP
authorChris Tallon <chris@vomp.tv>
Thu, 9 Feb 2017 17:10:58 +0000 (17:10 +0000)
committerChris Tallon <chris@vomp.tv>
Thu, 9 Feb 2017 17:10:58 +0000 (17:10 +0000)
15 files changed:
boxx.cc
remotemvp.cc
remotemvp.h
surface.cc
surfacevector.cc
vdr.cc
vepglistadvanced.cc
vepgsummary.cc
vrecordinglistadvanced.cc
vvideolivetv.cc
vvideomedia.cc
vvideorec.cc
wpictureview.cc
wselectlist.cc
wtabbar.cc

diff --git a/boxx.cc b/boxx.cc
index e6d7a6152a8fa938bd520b0a9eb395b81b9d0204..278747aeed2f66da6d78117facad6265d585d050 100644 (file)
--- a/boxx.cc
+++ b/boxx.cc
@@ -513,7 +513,7 @@ void Boxx::drawTVMedia(TVMediaInfo & tvmedia,float x, float y, float  width, flo
        else if (surface) {
                SurfaceVector * surfacevector=dynamic_cast<SurfaceVector*>(surface);
                if (surfacevector) surfacevector->drawTVMedia(tvmedia,x, y,width, height, corner);
-               else surface->fillblt(x, y, width, height, DrawStyle::RED); // Signal that something went wrong
+               else surface->fillblt((int)x, (int)y, (int)width, (int)height, DrawStyle::RED); // Signal that something went wrong
        }
 
 }
index 2b5abdc6bf358d1988902f5fbbeaa2f1db71d019..63d44e67cb2c317922d3ce26141dbb1e4692cdcf 100644 (file)
@@ -35,7 +35,7 @@ RemoteMVP::~RemoteMVP()
 {
 }
 
-int RemoteMVP::init(char* devName)
+int RemoteMVP::init(const char* devName)
 {
   if (initted) return 0;
   initted = 1;
index ac510b604ed2568052b31b5496b1126020c825d9..ee667d0d12d9e6775bc6932f95bf6b0ce6a3107b 100644 (file)
@@ -34,7 +34,7 @@ class RemoteMVP : public Remote
     RemoteMVP();
     ~RemoteMVP();
 
-    int init(char *devName);
+    int init(const char *devName);
     int shutdown();
     int getDevice();
     UCHAR getButtonPress(int how);
index bf49f0a32f9ad57e2b1bde3910f92e14c6ef82d1..94647deec1fa71f5ddbb40f6327fd950ec1692e1 100644 (file)
@@ -64,10 +64,10 @@ void initpol_tables(){
             interpol_upbit[px]= (min((int)ceil(fposx),11));
             interpol_lowbit[px]= (max((int)floor(fposx),0));
 
-            interpol_table_fac1[px][py]=xweight*yweight*256.;
-            interpol_table_fac2[px][py]=xinvweight*yweight*256.;
-            interpol_table_fac3[px][py]=xweight*yinvweight*256.;
-            interpol_table_fac4[px][py]=xinvweight*yinvweight*256.;
+            interpol_table_fac1[px][py]=(unsigned int)(xweight*yweight*256.);
+            interpol_table_fac2[px][py]=(unsigned int)(xinvweight*yweight*256.);
+            interpol_table_fac3[px][py]=(unsigned int)(xweight*yinvweight*256.);
+            interpol_table_fac4[px][py]=(unsigned int)(xinvweight*yinvweight*256.);
 
         }
     }
@@ -112,9 +112,9 @@ int Surface::drawText(const char* text, int x, int y, int width, const DrawStyle
   startFastDraw();
   for (i=0; i<n; i++)
   {
-    unsigned char c = text[i];
-    unsigned long *character = &font->content[font->offset[c]];
-    int w = font->width[c];
+    unsigned char ch = text[i];
+    unsigned long *character = &font->content[font->offset[ch]];
+    int w = font->width[ch];
     int pixels = 0;
 
     for (X=0; (X<w) && (X + cx < width); X++)
index 720e99446d60e0513acab6a5fe83c9f0bacb0a92..d21e03ceb9c8cd26b4aafb4f7b82ab692429b7cc 100644 (file)
@@ -52,7 +52,7 @@ SurfaceVector::~SurfaceVector()
 
 int SurfaceVector::getFontHeight()
 {
-       return osd->getFontHeight();
+       return (int)osd->getFontHeight();
 }
 
 float SurfaceVector::getCharWidth(wchar_t c)
@@ -151,7 +151,7 @@ int SurfaceVector::drawTextRJ(const char* text, int x, int y, const DrawStyle& c
        }
        delete[] temptext;
 #endif
-       return drawText(text, x-shift,  y, c);
+       return drawText(text, (int)(x-shift), y, c);
 }
 
 int SurfaceVector::drawTextCentre(const char* text, int x, int y, const DrawStyle& c)
@@ -183,7 +183,7 @@ int SurfaceVector::drawTextCentre(const char* text, int x, int y, const DrawStyl
        delete[] temptext;
 #endif
 
-       return drawText(text, x-shift/2.,  y, c);
+       return drawText(text, (int)(x-shift/2.),  y, c);
 }
 
 void SurfaceVector::drawJpeg(const char *fileName,int x, int y,int *width, int *height)
@@ -192,7 +192,7 @@ void SurfaceVector::drawJpeg(const char *fileName,int x, int y,int *width, int *
        if (strcmp(fileName,"/vdr.jpg")==0) {
                index=sa_vdrlogo;
                *height=100; // this is faked so that the system does use the old coordinate system
-               *width=ceil(190.f*osd->getPixelAspect());
+               *width=(int)ceil(190.f*osd->getPixelAspect());
        } else if (strcmp(fileName,"/wallpaperPAL.jpg")==0) {
                index=sa_wallpaper;
                *width=720; // this is faked so that the system does use the old coordinate system
diff --git a/vdr.cc b/vdr.cc
index 46f37b8063d1510c495d1f0472e77c7fe40333f3..f39f29ae28da4f47f281179fbac7018d723bb0c0 100644 (file)
--- a/vdr.cc
+++ b/vdr.cc
@@ -1831,7 +1831,7 @@ SeriesInfo *VDR::getScraperSeriesInfo(int seriesID, int episodeID)
 
 ULONG VDR::loadTVMedia(TVMediaInfo& tvmedia)
 {
-
+#warning VDR::loadTVMedia returns unsigned long but error return tries to return -1
        VDR_RequestPacket vrp;
 
        if (!vrp.init(VDR_LOADTVMEDIA, false, 0)) return -1;
index e7f3d4e15d10c8039671082b427f071791cd3150..e65e9ac9c665c2e0d6906c39a224574eaa438509 100644 (file)
@@ -79,7 +79,7 @@ VEpgListAdvanced::VEpgListAdvanced(VVideoLiveTV *tvideolive, ChannelList* tchanL
        epg.setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND);
 
        epgTVmedia.setPosition(epg.getRegionR().w-100-10,10);
-       epgTVmedia.setSize(100,150/Osd::getInstance()->getPixelAspect());
+       epgTVmedia.setSize(100,(UINT)(150/Osd::getInstance()->getPixelAspect()));
        epg.add(&epgTVmedia);
 
        boxRed.setBackgroundColour(DrawStyle::RED);
index 188dede1ddef9595e32865509fcf6f03b037d9c1..ac67c4ee96767a11164e0bd60e5d2949680316d5 100644 (file)
@@ -128,7 +128,7 @@ VEpgSummary::VEpgSummary(Event *tevent, Channel* tchannel)
   }
 
   epgTVmedia.setPosition(summary->getRegionR().w-130-10,0);
-  epgTVmedia.setSize(130,195/Osd::getInstance()->getPixelAspect());
+  epgTVmedia.setSize(130,(UINT)(195/Osd::getInstance()->getPixelAspect()));
   summary->add(&epgTVmedia);
   if (movieview) movieview->add(&epgTVmedia);
   if (seriesview) seriesview->add(&epgTVmedia);
index bed9504ab91d5d184a0e8d61a3c36753d330c475..bfbf1661b724aa5e2918cee444e2bf97df07ba05 100644 (file)
@@ -73,7 +73,7 @@ VRecordingListAdvanced::VRecordingListAdvanced()
        epg.setBackgroundColour(DrawStyle::VIEWBACKGROUND);
 
        epgTVmedia.setPosition(epg.getRegionR().w-100-10,10);
-       epgTVmedia.setSize(100,150/Osd::getInstance()->getPixelAspect());
+       epgTVmedia.setSize(100,(UINT)(150/Osd::getInstance()->getPixelAspect()));
        epg.add(&epgTVmedia);
 
 }
index 0901d0d15695f03fad241bd27035b3431a6fc9f5..32dda9b0e0b8b9975c9098a818508ef331d899cb 100644 (file)
@@ -1386,10 +1386,10 @@ void VVideoLiveTV::clearOSDArea(UINT posX, UINT posY, UINT width, UINT height, c
   //now convert to our display
   float scalex=720.f/((float) (region.framewidth+1));
   float scaley=576.f/((float) (region.frameheight+1));
-  r.x=floor(scalex*((float)r.x));
-  r.y=floor(scaley*((float)r.y));
-  r.w=ceil(scalex*((float)r.w))+1.f;
-  r.h=ceil(scaley*((float)r.h))+1.f;
+  r.x = (UINT)floor(scalex*((float)r.x));
+  r.y = (UINT)floor(scaley*((float)r.y));
+  r.w = (UINT)(ceil(scalex*((float)r.w))+1.f);
+  r.h = (UINT)(ceil(scaley*((float)r.h))+1.f);
   rectangle(r, DrawStyle(0,0,0,0));
   boxstack->update(this, &r);
 }
index 5ec78829dbaee49b1808f7e25ddc3d1d4dd3055f..2f7a10891b043e39826cb0cd6490dc356882d247 100644 (file)
@@ -766,15 +766,15 @@ char * VVideoMedia::shortendedText(const char * title, const char * title2,const
     intext="";
   }
   UINT twidth=0;
-  for (const char *p=title;*p!=0;p++) twidth+=charWidth(*p);
-  for (const char *p=title2;*p!=0;p++) twidth+=charWidth(*p);
+  for (const char *p=title;*p!=0;p++) twidth+=(UINT)charWidth(*p);
+  for (const char *p=title2;*p!=0;p++) twidth+=(UINT)charWidth(*p);
   const char *prfx="...";
-  UINT prfwidth=3*charWidth('.');
+  UINT prfwidth=(UINT)(3*charWidth('.'));
   const char *istart=intext+strlen(intext);
   UINT iwidth=0;
   while (twidth+iwidth+prfwidth < width-2*paraMargin && istart> intext) {
     istart--;
-    iwidth+=charWidth(*istart);
+    iwidth+=(UINT)charWidth(*istart);
   }
   if (twidth+iwidth+prfwidth >= width-2*paraMargin && istart < intext+strlen(intext)) istart++;
   if (istart == intext) prfx="";
index 3b0c879fefc8f846ff04263ded9628ec01b96a83..1a0af09026bc30ad25da2b0cda9cd837f4755db5 100644 (file)
@@ -325,7 +325,7 @@ int VVideoRec::handleCommand(int command)
         // skip to previous mark
         Log* logger = Log::getInstance();
         int currentFrame = (player->getCurrentFrameNum()); // get current Frame
-        currentFrame -= 5. * myRec->recInfo->fps; // subtrack 5 seconds, else you cannot skip more than once back ..
+        currentFrame -= (int)(5. * myRec->recInfo->fps); // subtrack 5 seconds, else you cannot skip more than once back ..
 
         int prevMark = myRec->getPrevMark(currentFrame); // find previous Frame
         if (prevMark)
@@ -1140,10 +1140,10 @@ void VVideoRec::clearOSDArea(UINT posX, UINT posY, UINT width, UINT height, cons
   //now convert to our display
   float scalex=720.f/((float) (region.framewidth+1));
   float scaley=576.f/((float) (region.frameheight+1));
-  r.x=floor(scalex*((float)r.x));
-  r.y=floor(scaley*((float)r.y));
-  r.w=ceil(scalex*((float)r.w))+1.f;
-  r.h=ceil(scaley*((float)r.h))+1.f;
+  r.x=(UINT)floor(scalex*((float)r.x));
+  r.y=(UINT)floor(scaley*((float)r.y));
+  r.w=(UINT)(ceil(scalex*((float)r.w))+1.f);
+  r.h=(UINT)(ceil(scaley*((float)r.h))+1.f);
 
   rectangle(r, transparent);
   boxstack->update(this, &r);
index 9922318a814114d2c2f8fdddd8162af3207501b9..fd1a6bfe3c37aaed2cc0d2e881cac7cb67c276f5 100644 (file)
@@ -113,12 +113,12 @@ void WPictureView::draw()
          {
                  if (!(*citty)->caption.empty())
                  {
-                         drawTextCentre((*citty)->caption.c_str(), xpos + (*citty)->w*0.5f, ypos, foreColour);
+                         drawTextCentre((*citty)->caption.c_str(), (int)(xpos + (*citty)->w*0.5f), (int)ypos, foreColour);
                          caption1 = true;
                  }
                  if (!(*citty)->caption2.empty())
                  {
-                         drawTextCentre((*citty)->caption2.c_str(), xpos + (*citty)->w*0.5f, ypos + fontHeight*1.f, foreColour);
+                         drawTextCentre((*citty)->caption2.c_str(), (int)(xpos + (*citty)->w*0.5f), (int)(ypos + fontHeight*1.f), foreColour);
                          caption2 = true;
                  }
                  xpos += (*citty)->w + 10.f;
@@ -136,7 +136,7 @@ void WPictureView::draw()
          height += fontHeight*1.f;
 
   }
-  rem_scroll_line = ceil((height - area.h  -cur_scroll_line * fontHeight*8.f)/fontHeight/8.f);
+  rem_scroll_line = (UINT)ceil((height - area.h  -cur_scroll_line * fontHeight*8.f)/fontHeight/8.f);
  // Log::getInstance()->log("WActorGallery", Log::DEBUG, "TVMedia rml %d",rem_scroll_line);
   drawClippingRectangle(0,0,0,0);
 
index 5d41ea028415691c24a85a1e288eff68f5674ae7..d6e50fa38691eb612740d1e5f8a7d8e05c5e2750 100644 (file)
@@ -100,7 +100,7 @@ int WSelectList::addOption(const char* text, ULONG data, int selected, TVMediaIn
 void WSelectList::draw()
 {
   int fontHeight = getFontHeight();
-  int ySeperation = fontHeight * linesPerOption + gap;
+  int ySeperation = (int) (fontHeight * linesPerOption + gap);
 
   numOptionsDisplayable = (area.h - 5) / ySeperation;
 
@@ -126,13 +126,13 @@ void WSelectList::draw()
     if (i == selectedOption && showseloption)
     {
 
-      rectangle(0, ypos, area.w, fontHeight * linesPerOption-1, darkseloption ? DrawStyle::SELECTDARKHIGHLIGHT: DrawStyle::SELECTHIGHLIGHT);
+      rectangle(0, ypos, area.w, (UINT)(fontHeight * linesPerOption-1), darkseloption ? DrawStyle::SELECTDARKHIGHLIGHT: DrawStyle::SELECTHIGHLIGHT);
 
       drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::DARKTEXT, options[i].pict);
     }
     else
     {
-       rectangle(0, ypos, area.w, fontHeight * linesPerOption-1, DrawStyle::SELECTBACKGROUND);
+       rectangle(0, ypos, area.w, (UINT)(fontHeight * linesPerOption-1), DrawStyle::SELECTBACKGROUND);
 
         drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::LIGHTTEXT, options[i].pict);
     }
@@ -186,7 +186,7 @@ void WSelectList::drawOptionLine(char* text, int xpos, int ypos, int width, cons
     pointer = STRTOKR(buffer, "\t\n", &savepointer);
     while(pointer)
     {
-      drawText(pointer, xposmod + columns[currentColumn], ypos_mod + curline * fontHeight, width - columns[currentColumn], colour);
+      drawText(pointer, xposmod + columns[currentColumn], (int)(ypos_mod + curline * fontHeight), width - columns[currentColumn], colour);
 
       pointer = STRTOKR(NULL, "\t\n", &savepointer);
       if (pointer) {
@@ -320,7 +320,7 @@ bool WSelectList::mouseLBDOWN(int x, int y)
 int WSelectList::getMouseLine(int x,int y)
 {
   int fontHeight = getFontHeight();
-  int ySeperation = fontHeight * linesPerOption + gap;
+  int ySeperation = (int)(fontHeight * linesPerOption + gap);
 
   if (y<0) return -1;
   if (x<0 || x>(int)area.w) return -1;
index 7cb7a46d0518d6b4405a7a48d2a70d88bbcfac3b..c161ce88f1967aef4220d7c1bd5a8246bf8153b0 100644 (file)
@@ -58,7 +58,7 @@ void WTabBar::addTab(const char* name, Boxx* boxx)
   
   for(UINT i = 0; i < strlen(name); i++)
   {
-    td.nameWidth += charWidth(name[i]);
+    td.nameWidth += (UINT)charWidth(name[i]);
   }
 
   UINT newButtonX = 22;