Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: VDR developer version 1.3.0



Klaus Schmidinger schrieb:
Robert Schiele wrote:

On Mon, Jan 05, 2004 at 12:51:10AM +0200, Lauri Tischler wrote:

Nice patch, cleans up all cruft, just one warning remains

g++ -O2 -g -Wall -Woverloaded-virtual -c   si.c
si.c: In member function `void SI::String::decodeText(char*)':
si.c:222: warning: comparison is always true due to limited range of data
type
You can fix this by doing the following:

--- ./libsi/si.c~       2004-01-05 01:17:11.000000000 +0100
+++ ./libsi/si.c        2004-01-05 01:12:22.000000000 +0100
@@ -11,6 +11,7 @@
 ***************************************************************************/

#include <string.h>
+#include <limits.h>
#include "si.h"
#include "descriptor.h"

@@ -219,7 +220,11 @@
         break;
      if (    ((' ' <= *from) && (*from <= '~'))
           || (*from == '\n')
-           || ((0xA0 <= *from) && (*from <= 0xFF))
+           || ((0xA0 <= *from)
+#if (defined CHAR_BIT) && (CHAR_BIT > 8)
+              && (*from <= 0xFF)
+#endif
+              )
         )
         *to++ = *from;
      else if (*from == 0x8A)

Hmmm, I wonder why the check against 0xFF was introduced in the first place?
It wasn't there in the original 'libdvt' code written by Rolf Hakenes,
and I'd say it isn't necessary, anyway, since 'char' is assumed to be 8 bit.

I guess I'll just remove the (*from <= 0xFF) check.
(Sorry, Robert, this is the second fix in a row that you have suggested
but I have done differently - no offense ;-)
This was introduced because of warnings from gcc-3.3.1

---------------- schnipp -------------------
Hallo Klaus,

ich weiß nicht, ob es bekannt ist, aber bei der Kompilation von vdr 1.2.2 mit dem neuen gcc 3.3.1 gibt es folgende Warnungen:


[...]

make[2]: Wechsel in das Verzeichnis Verzeichnis »/usr/src/vdr-1.2.2/libdtv/libsi«
cleaning workspace...
compiling si_parser.c...
si_parser.c: In function `siGetDescriptorTextHandler':
si_parser.c:1243: Warnung: comparison is always true due to limited range of data type
compiling si_debug_services.c...
updating library...

[...]

g++ -g -O2 -Wall -Woverloaded-virtual -c -DREMOTE_KBD -DREMOTE_LIRC -D_GNU_SOURCE -DVIDEODIR=\"/video\" -DPLUGINDIR=\"./PLUGINS/lib\" -I../DVB/include osdbase.c
osdbase.c: In member function `void cBitmap::SetBitmap(int, int, const
cBitmap&)':
osdbase.c:218: Warnung: array subscript has type `char'

[...]



mfg
Alfred



--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index