[vdr] [PATCH] vdr-1.2.6 gcc4 fix (was: Vdr-1.3.x, AMD64 in 64-bit mode, and working EPG?)

Ludwig Nussel ludwig.nussel at suse.de
Sat Apr 16 21:15:53 CEST 2005


Thomas Schmidt wrote:
> * Ari Huttunen schrieb am 11.04.05, um 17:34 Uhr:
> > I'm still running an old 1.2.x version of VDR, and my EPG is still not 
> > working (empty). There was another guy with a similar problem, but I 
> > didn't notice any replies to his question either. So..
> 
> We (The Debian VDR Team) had a bugreport for this problem recently,
> maybe the patch under http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=300702
> is what you are looking for?

Thanks for the hint, I was missing that too :-) You apparently also
unsuccessfully tried to solve the gcc4 issues, attached the patch I
used. I couldn't test whether a gcc4 compiled vdr actually works
yet though. gcc3.3 compiled with that patch works at least.

Btw, you are using an older version of my switch-user-id patch, I
removed the command line parameters and made the uid switch
mandatory. Otherwise you may end up with files owned by other users
just because someone called vdr --help.

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\   SUSE LINUX Products GmbH, Development
 V_/_  http://www.suse.de/
-------------- next part --------------
Index: vdr-1.2.6/libdtv/libsi/include/libsi.h
===================================================================
--- vdr-1.2.6.orig/libdtv/libsi/include/libsi.h
+++ vdr-1.2.6/libdtv/libsi/include/libsi.h
@@ -380,7 +380,7 @@ struct Iso639LanguageDescriptor {
 #define CreateIso639LanguageDescriptor(descr, lc1, lc2, lc3) \
    do \
    { \
-      xCreateNode (((struct Iso639LanguageDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct Iso639LanguageDescriptor, NULL); \
       ((struct Iso639LanguageDescriptor *)descr)->Tag = DESCR_ISO_639_LANGUAGE; \
       ((struct Iso639LanguageDescriptor *)descr)->LanguageCode[0] = lc1; \
       ((struct Iso639LanguageDescriptor *)descr)->LanguageCode[1] = lc2; \
@@ -411,7 +411,7 @@ struct Ac3Descriptor {
 #define CreateAc3Descriptor(descr) \
    do \
    { \
-      xCreateNode (((struct Ac3Descriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct Ac3Descriptor, NULL); \
       ((struct Ac3Descriptor *)descr)->Tag = DESCR_AC3; \
    } while (0)
 
@@ -458,7 +458,7 @@ struct AncillaryDataDescriptor {
 #define CreateAncillaryDataDescriptor(descr, id) \
    do \
    { \
-      xCreateNode (((struct AncillaryDataDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct AncillaryDataDescriptor, NULL); \
       ((struct AncillaryDataDescriptor *)descr)->Tag = DESCR_ANCILLARY_DATA; \
       ((struct AncillaryDataDescriptor *)descr)->Identifier = id; \
    } while (0)
@@ -478,7 +478,7 @@ struct BouquetNameDescriptor {
 #define CreateBouquetNameDescriptor(descr, text, tag) \
    do \
    { \
-      xCreateNode (((struct BouquetNameDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct BouquetNameDescriptor, NULL); \
       ((struct NODE *)descr)->Name = text; \
       ((struct NODE *)descr)->HashKey = xHashKey (text); \
       ((struct BouquetNameDescriptor *)descr)->Tag = tag; \
@@ -501,7 +501,7 @@ struct CountryAvailabilityDescriptor {
 #define CreateCountryAvailabilityDescriptor(descr, ava) \
    do \
    { \
-      xCreateNode (((struct CountryAvailabilityDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct CountryAvailabilityDescriptor, NULL); \
       ((struct CountryAvailabilityDescriptor *)descr)->Tag = DESCR_COUNTRY_AVAIL; \
       ((struct CountryAvailabilityDescriptor *)descr)->AvailibilityFlag = ava; \
       ((struct CountryAvailabilityDescriptor *)descr)->Amount = 0; \
@@ -539,7 +539,7 @@ struct CaIdentifierDescriptor {
 #define CreateCaIdentifierDescriptor(descr, amo) \
    do \
    { \
-      xCreateNode (((struct CaIdentifierDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct CaIdentifierDescriptor, NULL); \
       ((struct CaIdentifierDescriptor *)descr)->Tag = DESCR_CA_IDENT; \
       ((struct CaIdentifierDescriptor *)descr)->Amount = amo; \
       xMemAlloc (amo*2+2, &((struct CaIdentifierDescriptor *)descr)->SystemID); \
@@ -564,7 +564,7 @@ struct CaDescriptor {
 #define CreateCaDescriptor(descr, typ, capid, len) \
    do \
    { \
-      xCreateNode (((struct CaDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct CaDescriptor, NULL); \
       ((struct CaDescriptor *)descr)->Tag = DESCR_CA; \
       ((struct CaDescriptor *)descr)->CA_type = typ; \
       ((struct CaDescriptor *)descr)->CA_PID = capid; \
@@ -588,7 +588,7 @@ struct StreamIdentifierDescriptor {
 #define CreateStreamIdentifierDescriptor(descr, ctag) \
    do \
    { \
-      xCreateNode (((struct StreamIdentifierDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct StreamIdentifierDescriptor, NULL); \
       ((struct StreamIdentifierDescriptor *)descr)->Tag = DESCR_STREAM_ID; \
       ((struct StreamIdentifierDescriptor *)descr)->ComponentTag = (ctag); \
    } while (0)
@@ -630,7 +630,7 @@ struct NvodReferenceDescriptor {
 #define CreateNvodReferenceDescriptor(descr) \
    do \
    { \
-      xCreateNode (((struct NvodReferenceDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct NvodReferenceDescriptor, NULL); \
       ((struct NvodReferenceDescriptor *)descr)->Tag = DESCR_NVOD_REF; \
       ((struct NvodReferenceDescriptor *)descr)->Items = xNewList (NULL); \
    } while (0)
@@ -677,7 +677,7 @@ struct LinkageDescriptor {
 #define CreateLinkageDescriptor(descr, tpid, onid, svid, ltyp, pdl, pdp) \
    do \
    { \
-      xCreateNode (((struct LinkageDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct LinkageDescriptor, NULL); \
       ((struct LinkageDescriptor *)descr)->Tag = DESCR_LINKAGE; \
       ((struct LinkageDescriptor *)descr)->TransportStreamID = tpid; \
       ((struct LinkageDescriptor *)descr)->OriginalNetworkID = onid; \
@@ -702,7 +702,7 @@ struct ServiceDescriptor {
 #define CreateServiceDescriptor(descr, styp, prov, name) \
    do \
    { \
-      xCreateNode (((struct ServiceDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct ServiceDescriptor, NULL); \
       ((struct NODE *)descr)->Name = name; \
       ((struct NODE *)descr)->HashKey = xHashKey (name); \
       ((struct ServiceDescriptor *)descr)->Tag = DESCR_SERVICE; \
@@ -730,7 +730,7 @@ struct TimeShiftedServiceDescriptor {
 #define CreateTimeShiftedServiceDescriptor(descr, svid) \
    do \
    { \
-      xCreateNode (((struct TimeShiftedServiceDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct TimeShiftedServiceDescriptor, NULL); \
       ((struct TimeShiftedServiceDescriptor *)descr)->Tag = DESCR_TIME_SHIFTED_SERVICE; \
       ((struct TimeShiftedServiceDescriptor *)descr)->ReferenceServiceID = svid; \
    } while (0)
@@ -748,7 +748,7 @@ struct TimeShiftedEventDescriptor {
 #define CreateTimeShiftedEventDescriptor(descr, svid, evid) \
    do \
    { \
-      xCreateNode (((struct TimeShiftedEventDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct TimeShiftedEventDescriptor, NULL); \
       ((struct TimeShiftedEventDescriptor *)descr)->Tag = DESCR_TIME_SHIFTED_EVENT; \
       ((struct TimeShiftedEventDescriptor *)descr)->ReferenceServiceID = svid; \
       ((struct TimeShiftedEventDescriptor *)descr)->ReferenceEventID = evid; \
@@ -769,7 +769,7 @@ struct ComponentDescriptor {
 #define CreateComponentDescriptor(descr, scnt, ctyp, tag, lc1, lc2, lc3, txt) \
    do \
    { \
-      xCreateNode (((struct ComponentDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct ComponentDescriptor, NULL); \
       ((struct NODE *)descr)->Name = txt; \
       ((struct NODE *)descr)->HashKey = xHashKey (txt); \
       ((struct ComponentDescriptor *)descr)->Tag = DESCR_COMPONENT; \
@@ -795,7 +795,7 @@ struct ContentDescriptor {
 #define CreateContentDescriptor(descr, amo) \
    do \
    { \
-      xCreateNode (((struct ContentDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct ContentDescriptor, NULL); \
       ((struct ContentDescriptor *)descr)->Tag = DESCR_CONTENT; \
       ((struct ContentDescriptor *)descr)->Amount = amo; \
       xMemAlloc (amo*2+2, &((struct ContentDescriptor *)descr)->ContentID); \
@@ -828,7 +828,7 @@ struct ExtendedEventDescriptor {
 #define CreateExtendedEventDescriptor(descr, dnum, ldnb, lc1, lc2, lc3, text) \
    do \
    { \
-      xCreateNode (((struct ExtendedEventDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct ExtendedEventDescriptor, NULL); \
       ((struct NODE *)descr)->Name = text; \
       ((struct NODE *)descr)->HashKey = xHashKey (text); \
       ((struct ExtendedEventDescriptor *)descr)->Tag = DESCR_EXTENDED_EVENT; \
@@ -876,7 +876,7 @@ struct ParentalRatingDescriptor {
 #define CreateParentalRatingDescriptor(descr) \
    do \
    { \
-      xCreateNode (((struct ParentalRatingDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct ParentalRatingDescriptor, NULL); \
       ((struct ParentalRatingDescriptor *)descr)->Tag = DESCR_PARENTAL_RATING; \
       ((struct ParentalRatingDescriptor *)descr)->Ratings = xNewList (NULL); \
    } while (0)
@@ -919,7 +919,7 @@ struct ShortEventDescriptor {
 #define CreateShortEventDescriptor(descr, name, lc1, lc2, lc3, text) \
    do \
    { \
-      xCreateNode (((struct ShortEventDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct ShortEventDescriptor, NULL); \
       ((struct NODE *)descr)->Name = name; \
       ((struct NODE *)descr)->HashKey = xHashKey (name); \
       ((struct ShortEventDescriptor *)descr)->Tag = DESCR_SHORT_EVENT; \
@@ -942,7 +942,7 @@ struct TeletextDescriptor {
 #define CreateTeletextDescriptor(descr) \
    do \
    { \
-      xCreateNode (((struct TeletextDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct TeletextDescriptor, NULL); \
       ((struct TeletextDescriptor *)descr)->Tag = DESCR_TELETEXT; \
       ((struct TeletextDescriptor *)descr)->Items = xNewList (NULL); \
    } while (0)
@@ -995,7 +995,7 @@ struct SubtitlingDescriptor {
 #define CreateSubtitlingDescriptor(descr) \
    do \
    { \
-      xCreateNode (((struct SubtitlingDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct SubtitlingDescriptor, NULL); \
       ((struct SubtitlingDescriptor *)descr)->Tag = DESCR_SUBTITLING; \
       ((struct SubtitlingDescriptor *)descr)->Items = xNewList (NULL); \
    } while (0)
@@ -1046,7 +1046,7 @@ struct SatelliteDeliverySystemDescriptor
 #define CreateSatelliteDeliverySystemDescriptor(descr, freq, orb, mod, polar, sr, fec) \
    do \
    { \
-      xCreateNode (((struct SatelliteDeliverySystemDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct SatelliteDeliverySystemDescriptor, NULL); \
       ((struct SatelliteDeliverySystemDescriptor *)descr)->Tag = DESCR_SAT_DEL_SYS; \
       ((struct SatelliteDeliverySystemDescriptor *)descr)->Frequency = freq; \
       ((struct SatelliteDeliverySystemDescriptor *)descr)->OrbitalPosition = orb; \
@@ -1071,7 +1071,7 @@ struct CableDeliverySystemDescriptor {
 #define CreateCableDeliverySystemDescriptor(descr, freq, sr, fec_o, fec_i, mod) \
    do \
    { \
-      xCreateNode (((struct CableDeliverySystemDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct CableDeliverySystemDescriptor, NULL); \
       ((struct CableDeliverySystemDescriptor *)descr)->Tag = DESCR_CABLE_DEL_SYS; \
       ((struct CableDeliverySystemDescriptor *)descr)->Frequency = freq; \
       ((struct CableDeliverySystemDescriptor *)descr)->SymbolRate = sr; \
@@ -1099,7 +1099,7 @@ struct TerrestrialDeliverySystemDescript
 #define CreateTerrestrialDeliverySystemDescriptor(descr, freq, bw, cst, hr, crh, crl, gi, tm, ofm) \
    do \
    { \
-      xCreateNode (((struct CableDeliverySystemDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct CableDeliverySystemDescriptor, NULL); \
       ((struct TerrestrialDeliverySystemDescriptor *)descr)->Tag = DESCR_TERR_DEL_SYS; \
       ((struct TerrestrialDeliverySystemDescriptor *)descr)->Frequency = freq; \
       ((struct TerrestrialDeliverySystemDescriptor *)descr)->Bandwidth = bw; \
@@ -1123,7 +1123,7 @@ struct ServiceListDescriptor {
 #define CreateServiceListDescriptor(descr) \
    do \
    { \
-      xCreateNode (((struct ServiceListDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct ServiceListDescriptor, NULL); \
       ((struct ServiceListDescriptor *)descr)->Tag = DESCR_SERVICE_LIST; \
       ((struct ServiceListDescriptor *)descr)->ServiceList = xNewList(NULL); \
    } while (0)
@@ -1156,7 +1156,7 @@ struct LocalTimeOffsetDescriptor {
 #define CreateLocalTimeOffsetDescriptor(descr) \
    do \
    { \
-      xCreateNode (((struct LocalTimeOffsetDescriptor *)descr), NULL); \
+      descr = xCreateNode2 (struct LocalTimeOffsetDescriptor, NULL); \
       ((struct LocalTimeOffsetDescriptor *)descr)->Tag = DESCR_LOCAL_TIME_OFF; \
       ((struct LocalTimeOffsetDescriptor *)descr)->LocalTimeOffsets = xNewList(NULL); \
    } while (0)
Index: vdr-1.2.6/libdtv/liblx/liblx.h
===================================================================
--- vdr-1.2.6.orig/libdtv/liblx/liblx.h
+++ vdr-1.2.6/libdtv/liblx/liblx.h
@@ -130,6 +130,9 @@ extern unsigned long    xAllocatedMemory
 #define xCreateNode(NodeStruct,Name) \
    (NodeStruct) = (void *) xNewNode(Name, sizeof(*(NodeStruct)))
 
+#define xCreateNode2(type,Name) \
+   xNewNode(Name, sizeof(type))
+
 
 /*---------------------------------------------------------------------*
  |                                                                     |


More information about the vdr mailing list