From 12fde09aba4539ec726e94f45e48d2171801f3f1 Mon Sep 17 00:00:00 2001 From: scop Date: Fri, 18 Mar 2005 22:31:55 +0000 Subject: Eliminate compiler warnings. --- HISTORY | 1 + dxr3device.c | 4 +++- dxr3interface_spu_encoder.c | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/HISTORY b/HISTORY index fa597ed..3933b8d 100644 --- a/HISTORY +++ b/HISTORY @@ -267,3 +267,4 @@ NOTE: I havent found time to include all of the languages, will be done in pre2 - borrow better OSD scaling routines from the Xine plugin (Luca Olivetti) - improve original OSD scaler for small resolutions (#1014339, Luca Olivetti) - fix compilation with -fPIC, kudos to ffmpeg (Ville Skyttä) +- eliminate some compiler warnings (Ville Skyttä) diff --git a/dxr3device.c b/dxr3device.c index 1a5822a..2e2cb3b 100644 --- a/dxr3device.c +++ b/dxr3device.c @@ -457,7 +457,9 @@ bool cDxr3Device::GrabImage(const char *FileName, bool Jpeg, int Quality, int Si else { ///< write PNM file: - if (fprintf(f, "P6\n%d\n%d\n255\n", w, h) < 0 || fwrite(Data, w * h * 3, 1, f) < 0) + size_t n = 1; + if (fprintf(f, "P6\n%d\n%d\n255\n", w, h) < 0 || + fwrite(Data, w * h * 3, n, f) < n) { LOG_ERROR_STR(FileName); } diff --git a/dxr3interface_spu_encoder.c b/dxr3interface_spu_encoder.c index 9553f07..df28713 100644 --- a/dxr3interface_spu_encoder.c +++ b/dxr3interface_spu_encoder.c @@ -396,19 +396,19 @@ int cSPUEncoder::Cmd(OSD_Command cmd, int color, int x0, int y0, int x1, int y1, if ((col = (eDvbColor*)m_windows[m_lastwindow].colors) != NULL) #endif { - for (int i = 0; i < m_windows[m_lastwindow].NumColors; ++i) + for (size_t i = 0; i < m_windows[m_lastwindow].NumColors; ++i) { m_palManager.RemoveColor((int)(col[i]) & 0xFFFFFF); } } // clear osd - for (int i = m_windows[m_lastwindow].y0; i <= m_windows[m_lastwindow].y1; ++i) + for (size_t i = m_windows[m_lastwindow].y0; i <= m_windows[m_lastwindow].y1; ++i) { cp = &OSD_Screen[i*OSDWIDTH + m_windows[m_lastwindow].x0]; if ((cp+m_windows[m_lastwindow].x1-m_windows[m_lastwindow].x0+1) < &OSD_Screen[OSDWIDTH * OSDHEIGHT-1]) { - for (int xx=0; xx <= (m_windows[m_lastwindow].x1-m_windows[m_lastwindow].x0); xx++) + for (size_t xx=0; xx <= (m_windows[m_lastwindow].x1-m_windows[m_lastwindow].x0); xx++) { *(cp+xx) = 0x00; } -- cgit v1.2.3