Some fixes to avoid compiler warnings in gcc 4.0

This commit is contained in:
Klaus Schmidinger 2005-03-20 10:10:38 +01:00
parent 86a9d179bd
commit e760b14f64
6 changed files with 19 additions and 9 deletions

View File

@ -1299,3 +1299,6 @@ Mikko Salo <mikko.salo@ppe.inet.fi>
Roman Krenický <free-rtk@gmx.de> Roman Krenický <free-rtk@gmx.de>
for a patch that was used a a basis for changing a timer's day handling to full date for a patch that was used a a basis for changing a timer's day handling to full date
Ville Skyttä <ville.skytta@iki.fi>
for reporting several compiler warnings in gcc 4.0

View File

@ -3464,3 +3464,5 @@ Video Disk Recorder Revision History
- The day of a timer is now stored as a full date in ISO notation ("YYYY-MM-DD") in - The day of a timer is now stored as a full date in ISO notation ("YYYY-MM-DD") in
'timers.conf' and for the result of the SVDRP command LSTT (based in parts on a 'timers.conf' and for the result of the SVDRP command LSTT (based in parts on a
patch by Roman Krenický). patch by Roman Krenický).
- Some fixes to avoid compiler warnings in gcc 4.0 (thanks to Ville Skyttä for reporting
these).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: channels.c 1.35 2005/02/06 09:44:53 kls Exp $ * $Id: channels.c 1.36 2005/03/19 15:56:38 kls Exp $
*/ */
#include "channels.h" #include "channels.h"
@ -694,9 +694,12 @@ bool cChannel::Parse(const char *s, bool AllowNonUniqueID)
char *p = strchr(vpidbuf, '+'); char *p = strchr(vpidbuf, '+');
if (p) if (p)
*p++ = 0; *p++ = 0;
sscanf(vpidbuf, "%d", &vpid); if (sscanf(vpidbuf, "%d", &vpid) != 1)
if (p) return false;
sscanf(p, "%d", &ppid); if (p) {
if (sscanf(p, "%d", &ppid) != 1)
return false;
}
else else
ppid = vpid; ppid = vpid;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: dvbdevice.c 1.126 2005/03/13 12:34:00 kls Exp $ * $Id: dvbdevice.c 1.127 2005/03/20 10:10:38 kls Exp $
*/ */
#include "dvbdevice.h" #include "dvbdevice.h"
@ -577,7 +577,7 @@ bool cDvbDevice::GrabImage(const char *FileName, bool Jpeg, int Quality, int Siz
else { else {
// write PNM file: // write PNM file:
if (fprintf(f, "P6\n%d\n%d\n255\n", vm.width, vm.height) < 0 || if (fprintf(f, "P6\n%d\n%d\n255\n", vm.width, vm.height) < 0 ||
fwrite(mem, vm.width * vm.height * 3, 1, f) < 0) { fwrite(mem, vm.width * vm.height * 3, 1, f) != 1) {
LOG_ERROR_STR(FileName); LOG_ERROR_STR(FileName);
result |= 1; result |= 1;
} }

3
font.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: font.h 1.10 2005/01/14 13:25:35 kls Exp $ * $Id: font.h 1.11 2005/03/19 15:51:19 kls Exp $
*/ */
#ifndef __FONT_H #ifndef __FONT_H
@ -44,6 +44,7 @@ private:
int height; int height;
public: public:
cFont(void *Data); cFont(void *Data);
virtual ~cFont() {}
void SetData(void *Data); void SetData(void *Data);
virtual int Width(unsigned char c) const { return data[c]->width; } virtual int Width(unsigned char c) const { return data[c]->width; }
///< Returns the width of the given character. ///< Returns the width of the given character.

View File

@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured * and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection. * graphical interface that sits on top of an SVDRP connection.
* *
* $Id: svdrp.c 1.67 2004/12/26 12:23:55 kls Exp $ * $Id: svdrp.c 1.68 2005/03/19 16:05:33 kls Exp $
*/ */
#include "svdrp.h" #include "svdrp.h"
@ -111,7 +111,8 @@ int cSocket::Accept(void)
bool accepted = SVDRPhosts.Acceptable(clientname.sin_addr.s_addr); bool accepted = SVDRPhosts.Acceptable(clientname.sin_addr.s_addr);
if (!accepted) { if (!accepted) {
const char *s = "Access denied!\n"; const char *s = "Access denied!\n";
write(newsock, s, strlen(s)); if (write(newsock, s, strlen(s)) < 0)
LOG_ERROR;
close(newsock); close(newsock);
newsock = -1; newsock = -1;
} }