Mailing List archive

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

[vdr] minor code clean-up / suggestion for more



Hi,

this patch clean a few tidbits (extra ";" and "," and an explicit type casting) of vdr and is against vanilla 1.3.13.

Whiel I am at it. I tried to compile VDR using -pedantic and saw that vdr usus a lot of gnu c++ features. Wouldn't it be preferable to try to clean up the source to use strict iso c++ conformance? GCC with each version gets stricter to iso, so I guess this would be the right direction to go.

What do you think Klaus? If you think it is a good idea, I could start working on it, as currently I am a bit bored. ;-)

Another thing: What about incorporating the new gcc visibility stuff?

See: http://www.nedprod.com/programs/gccvisibility.html

Using it (properly) wouldn't break anything but take advantage of newer compilers. Gentoo's gcc 3.4.2 already uses the visibility patch and gcc 4 will have it by default.

Cheers,

Prakash



The patch:

diff -Nurd vdr-1.3.13.o/genfontfile.c vdr-1.3.13/genfontfile.c
--- vdr-1.3.13.o/genfontfile.c 2003-05-29 14:28:27.000000000 +0200
+++ vdr-1.3.13/genfontfile.c 2004-10-23 11:57:43.459265400 +0200
@@ -179,7 +179,7 @@
charHeight = charinfo->ascent + charinfo->descent;
spanLength = (charWidth + 7) / 8;
}
- bitmapData = calloc(height * spanLength, sizeof(char));
+ bitmapData = (unsigned char*) calloc(height * spanLength, sizeof(char));
if (!bitmapData)
goto FreeFontAndReturn;
DEBUG_GLYPH4("index %d, glyph %d (%d by %d)\n",
diff -Nurd vdr-1.3.13.o/libsi/util.h vdr-1.3.13/libsi/util.h
--- vdr-1.3.13.o/libsi/util.h 2004-10-16 11:59:48.000000000 +0200
+++ vdr-1.3.13/libsi/util.h 2004-10-23 12:24:31.898745432 +0200
@@ -140,7 +140,7 @@
time_t getTime(unsigned char date_hi, unsigned char date_lo, unsigned char timehr, unsigned char timemi, unsigned char timese);
time_t getDuration(unsigned char timehr, unsigned char timemi, unsigned char timese);
inline unsigned char bcdToDec(unsigned char b) { return ((b >> 4) & 0x0F) * 10 + (b & 0x0F); }
-};
+}

//taken and adapted from libdtv, (c) Rolf Hakenes
class CRC32 {
diff -Nurd vdr-1.3.13.o/sources.h vdr-1.3.13/sources.h
--- vdr-1.3.13.o/sources.h 2004-01-11 11:35:36.000000000 +0100
+++ vdr-1.3.13/sources.h 2004-10-23 12:26:01.277157848 +0200
@@ -21,7 +21,7 @@
stTerr = 0xC000,
st_Mask = 0xC000,
st_Neg = 0x0800,
- st_Pos = 0x07FF,
+ st_Pos = 0x07FF
};
private:
int code;


diff -Nurd vdr-1.3.13.o/genfontfile.c vdr-1.3.13/genfontfile.c
--- vdr-1.3.13.o/genfontfile.c	2003-05-29 14:28:27.000000000 +0200
+++ vdr-1.3.13/genfontfile.c	2004-10-23 11:57:43.459265400 +0200
@@ -179,7 +179,7 @@
           charHeight = charinfo->ascent + charinfo->descent;
           spanLength = (charWidth + 7) / 8;
         }
-        bitmapData = calloc(height * spanLength, sizeof(char));
+        bitmapData = (unsigned char*) calloc(height * spanLength, sizeof(char));
         if (!bitmapData)
           goto FreeFontAndReturn;
         DEBUG_GLYPH4("index %d, glyph %d (%d by %d)\n",
diff -Nurd vdr-1.3.13.o/libsi/util.h vdr-1.3.13/libsi/util.h
--- vdr-1.3.13.o/libsi/util.h	2004-10-16 11:59:48.000000000 +0200
+++ vdr-1.3.13/libsi/util.h	2004-10-23 12:24:31.898745432 +0200
@@ -140,7 +140,7 @@
 time_t getTime(unsigned char date_hi, unsigned char date_lo, unsigned char timehr, unsigned char timemi, unsigned char timese);
 time_t getDuration(unsigned char timehr, unsigned char timemi, unsigned char timese);
 inline unsigned char bcdToDec(unsigned char b) { return ((b >> 4) & 0x0F) * 10 + (b & 0x0F); }
-};
+}
 
 //taken and adapted from libdtv, (c) Rolf Hakenes
 class CRC32 {
diff -Nurd vdr-1.3.13.o/sources.h vdr-1.3.13/sources.h
--- vdr-1.3.13.o/sources.h	2004-01-11 11:35:36.000000000 +0100
+++ vdr-1.3.13/sources.h	2004-10-23 12:26:01.277157848 +0200
@@ -21,7 +21,7 @@
     stTerr  = 0xC000,
     st_Mask = 0xC000,
     st_Neg  = 0x0800,
-    st_Pos  = 0x07FF,
+    st_Pos  = 0x07FF
     };
 private:
   int code;

Attachment: signature.asc
Description: OpenPGP digital signature


Home | Main Index | Thread Index