[libdvbpsi-devel] ATSC descriptors: fix compilation

Jean-Paul Saman git at videolan.org
Wed May 30 16:17:55 CEST 2012


libdvbpsi | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Wed May 30 15:11:13 2012 +0200| [8ab35810e7964d034d4ca2a298c8a036214009fc] | committer: Jean-Paul Saman

ATSC descriptors: fix compilation

> http://git.videolan.org/gitweb.cgi/libdvbpsi.git/?a=commit;h=8ab35810e7964d034d4ca2a298c8a036214009fc
---

 src/descriptors/dr_13.c |   14 ++++++++++----
 src/descriptors/dr_14.c |   12 +++++++++---
 src/descriptors/dr_62.c |   11 ++++++++---
 src/descriptors/dr_66.c |   12 +++++++++---
 src/descriptors/dr_73.c |   10 ++++++++--
 src/descriptors/dr_76.c |   10 ++++++++--
 src/descriptors/dr_83.c |   10 ++++++++--
 7 files changed, 60 insertions(+), 19 deletions(-)

diff --git a/src/descriptors/dr_13.c b/src/descriptors/dr_13.c
index cd9b9e5..c2a7c87 100644
--- a/src/descriptors/dr_13.c
+++ b/src/descriptors/dr_13.c
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2010  Adam Charrett
+Copyright (C) 2010-2012  Adam Charrett
 
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
@@ -24,12 +24,18 @@ Decode Carousel Id Descriptor.
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <string.h>
+
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
 #include <stdint.h>
+#endif
 
-#include "dvbpsi.h"
+#include "../dvbpsi.h"
 #include "../dvbpsi_private.h"
-#include "descriptor.h"
+#include "../descriptor.h"
 
 #include "dr_13.h"
 
@@ -42,7 +48,7 @@ static dvbpsi_carousel_id_dr_t *NewCarouselDr(const size_t i_private)
                     calloc(1, sizeof(dvbpsi_carousel_id_dr_t) + i_private);
     if (p_carousel)
     {
-        p_carousel->p_private_data = p_carousel + sizeof(dvbpsi_carousel_id_dr_t);
+        p_carousel->p_private_data = ((uint8_t *)p_carousel + sizeof(dvbpsi_carousel_id_dr_t));
         p_carousel->i_private_data_len = i_private;
     }
     return p_carousel;
diff --git a/src/descriptors/dr_14.c b/src/descriptors/dr_14.c
index b171e37..da5fc20 100644
--- a/src/descriptors/dr_14.c
+++ b/src/descriptors/dr_14.c
@@ -24,12 +24,18 @@ Decode Assocation Tag Descriptor.
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <string.h>
+
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
 #include <stdint.h>
+#endif
 
-#include "dvbpsi.h"
+#include "../dvbpsi.h"
 #include "../dvbpsi_private.h"
-#include "descriptor.h"
+#include "../descriptor.h"
 
 #include "dr_14.h"
 
@@ -44,7 +50,7 @@ static dvbpsi_association_tag_dr_t *NewAssociationTagDr(const size_t i_selector,
     p_tag = (dvbpsi_association_tag_dr_t*) calloc(1, i_size);
     if (p_tag)
     {
-        p_tag->p_selector = p_tag + sizeof(dvbpsi_association_tag_dr_t);
+        p_tag->p_selector = ((uint8_t*)p_tag + sizeof(dvbpsi_association_tag_dr_t));
         p_tag->i_selector_len = i_selector;
 
         p_tag->p_private_data = p_tag->p_selector + i_selector;
diff --git a/src/descriptors/dr_62.c b/src/descriptors/dr_62.c
index 01f22ff..bde5481 100644
--- a/src/descriptors/dr_62.c
+++ b/src/descriptors/dr_62.c
@@ -24,16 +24,21 @@ Decode Frequency List Descriptor.
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <string.h>
+
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
 #include <stdint.h>
+#endif
 
-#include "dvbpsi.h"
+#include "../dvbpsi.h"
 #include "../dvbpsi_private.h"
-#include "descriptor.h"
+#include "../descriptor.h"
 
 #include "dr_62.h"
 
-
 /*****************************************************************************
  * dvbpsi_DecodeFrequencyListDr
  *****************************************************************************/
diff --git a/src/descriptors/dr_66.c b/src/descriptors/dr_66.c
index dff00b1..593dbb3 100644
--- a/src/descriptors/dr_66.c
+++ b/src/descriptors/dr_66.c
@@ -24,12 +24,18 @@ Decode Data Broadcast Id Descriptor.
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <string.h>
+
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
 #include <stdint.h>
+#endif
 
-#include "dvbpsi.h"
+#include "../dvbpsi.h"
 #include "../dvbpsi_private.h"
-#include "descriptor.h"
+#include "../descriptor.h"
 
 #include "dr_66.h"
 
@@ -44,7 +50,7 @@ static dvbpsi_data_broadcast_id_dr_t *NewDataBroadcastDr(const size_t i_private)
                 calloc(1, sizeof(dvbpsi_data_broadcast_id_dr_t) + i_private);
     if (p_bcast)
     {
-        p_bcast->p_id_selector = p_bcast + sizeof(dvbpsi_data_broadcast_id_dr_t);
+        p_bcast->p_id_selector = ((uint8_t *)p_bcast + sizeof(dvbpsi_data_broadcast_id_dr_t));
         p_bcast->i_id_selector_len = i_private;
     }
     return p_bcast;
diff --git a/src/descriptors/dr_73.c b/src/descriptors/dr_73.c
index 9d22c78..1e2299f 100644
--- a/src/descriptors/dr_73.c
+++ b/src/descriptors/dr_73.c
@@ -24,12 +24,18 @@ Decode Default Authority Descriptor.
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <string.h>
+
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
 #include <stdint.h>
+#endif
 
-#include "dvbpsi.h"
+#include "../dvbpsi.h"
 #include "../dvbpsi_private.h"
-#include "descriptor.h"
+#include "../descriptor.h"
 
 #include "dr_73.h"
 
diff --git a/src/descriptors/dr_76.c b/src/descriptors/dr_76.c
index cd2ec2e..eec0ddc 100644
--- a/src/descriptors/dr_76.c
+++ b/src/descriptors/dr_76.c
@@ -24,12 +24,18 @@ Decode Content Identifier Descriptor.
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <string.h>
+
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
 #include <stdint.h>
+#endif
 
-#include "dvbpsi.h"
+#include "../dvbpsi.h"
 #include "../dvbpsi_private.h"
-#include "descriptor.h"
+#include "../descriptor.h"
 
 #include "dr_76.h"
 
diff --git a/src/descriptors/dr_83.c b/src/descriptors/dr_83.c
index 93f1fcf..ce7bc27 100644
--- a/src/descriptors/dr_83.c
+++ b/src/descriptors/dr_83.c
@@ -24,12 +24,18 @@ Decode Logical Channel Number Descriptor.
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <string.h>
+
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
 #include <stdint.h>
+#endif
 
-#include "dvbpsi.h"
+#include "../dvbpsi.h"
 #include "../dvbpsi_private.h"
-#include "descriptor.h"
+#include "../descriptor.h"
 
 #include "dr_83.h"
 



More information about the libdvbpsi-devel mailing list