[bTSstream-devel] fixed warnings and cast errors for c++ using headers_set

Ruslan Mullakhmetov git at videolan.org
Sun Apr 5 22:36:20 CEST 2015


bitstream | branch: master | Ruslan Mullakhmetov <theambient at me.com> | Sun Apr  5 13:15:42 2015 +0300| [60612d23dfc3d273d4e758545fade072de232e23] | committer: Christophe Massiot

fixed warnings and cast errors for c++ using headers_set

> http://git.videolan.org/gitweb.cgi/bitstream.git/?a=commit;h=60612d23dfc3d273d4e758545fade072de232e23
---

 dvb/si/desc_40.h       |    2 ++
 dvb/si/desc_42.h       |    2 ++
 dvb/si/desc_45.h       |    2 +-
 dvb/si/desc_46.h       |    2 +-
 dvb/si/desc_51.h       |    4 ++--
 dvb/si/desc_67.h       |    2 ++
 dvb/si/dit_print.h     |    3 +++
 dvb/si/eit_print.h     |    2 +-
 dvb/si/rst_print.h     |    3 +++
 dvb/si/strings.h       |    4 ++--
 dvb/si/tdt_print.h     |    3 +++
 dvb/sub.h              |    2 ++
 mpeg/psi/cat_print.h   |    2 +-
 mpeg/psi/descriptors.h |    2 ++
 mpeg/psi/psi.h         |    2 ++
 15 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/dvb/si/desc_40.h b/dvb/si/desc_40.h
index ed9c8cd..9dfd5d3 100644
--- a/dvb/si/desc_40.h
+++ b/dvb/si/desc_40.h
@@ -70,6 +70,8 @@ static inline const uint8_t *desc40_get_networkname(const uint8_t *p_desc,
 
 static inline bool desc40_validate(const uint8_t *p_desc)
 {
+    (void) p_desc;
+
     return true;
 }
 
diff --git a/dvb/si/desc_42.h b/dvb/si/desc_42.h
index 813b4fe..dc3b167 100644
--- a/dvb/si/desc_42.h
+++ b/dvb/si/desc_42.h
@@ -53,6 +53,8 @@ static inline void desc42_init(uint8_t *p_desc)
 
 static inline bool desc42_validate(const uint8_t *p_desc)
 {
+    (void) p_desc;
+
     return true;
 }
 
diff --git a/dvb/si/desc_45.h b/dvb/si/desc_45.h
index 9655d93..9c11db9 100644
--- a/dvb/si/desc_45.h
+++ b/dvb/si/desc_45.h
@@ -72,7 +72,7 @@ static inline uint8_t desc45n_get_data_length(const uint8_t *p_desc_n)
     return p_desc_n[1];
 }
 
-static inline char *desc45_get_service_id_txt(uint8_t i_service_id)
+static inline const char *desc45_get_service_id_txt(uint8_t i_service_id)
 {
     return i_service_id == 0x00 ? "reserved" :
            i_service_id == 0x01 ? "EBU teletext" :
diff --git a/dvb/si/desc_46.h b/dvb/si/desc_46.h
index af1f7d6..240b129 100644
--- a/dvb/si/desc_46.h
+++ b/dvb/si/desc_46.h
@@ -83,7 +83,7 @@ static inline uint8_t desc46n_get_teletexttype(const uint8_t *p_desc_n)
     return p_desc_n[3] >> 3;
 }
 
-static inline char *desc46_get_teletexttype_txt(uint8_t i_type)
+static inline const char *desc46_get_teletexttype_txt(uint8_t i_type)
 {
     return i_type == 0x00 ? "Reserved" :
            i_type == 0x01 ? "Initial teletext page" :
diff --git a/dvb/si/desc_51.h b/dvb/si/desc_51.h
index 4be501d..fd812bb 100644
--- a/dvb/si/desc_51.h
+++ b/dvb/si/desc_51.h
@@ -105,7 +105,7 @@ static inline void desc51n_set_logical_cell_presentation_info(uint8_t *p_desc_n,
     p_desc_n[1] = (i_lc_presentation_info & 0x07) | 0xf8;
 }
 
-static inline char *desc51_get_logical_cell_presentation_info_txt(uint8_t i_lcp_info)
+static inline const char *desc51_get_logical_cell_presentation_info_txt(uint8_t i_lcp_info)
 {
     return i_lcp_info == 0x00 ? "undefined" :
            i_lcp_info == 0x01 ? "video" :
@@ -143,7 +143,7 @@ static inline void desc51n_set_cell_linkage_info(uint8_t *p_desc_n, uint8_t i_ce
     p_desc_n[3 + desc51n_get_elementary_cell_field_length(p_desc_n)] = i_cell_linkage_info;
 }
 
-static inline char *desc51_get_cell_linkage_info_txt(uint8_t i_icl_info)
+static inline const char *desc51_get_cell_linkage_info_txt(uint8_t i_icl_info)
 {
     return i_icl_info == 0x00 ? "undefined" :
            i_icl_info == 0x01 ? "bouquet related" :
diff --git a/dvb/si/desc_67.h b/dvb/si/desc_67.h
index 319faf3..831e2e3 100644
--- a/dvb/si/desc_67.h
+++ b/dvb/si/desc_67.h
@@ -71,6 +71,8 @@ static inline void desc67_set_bytes(uint8_t *p_desc, const uint8_t *p_bytes, uin
 
 static inline bool desc67_validate(const uint8_t *p_desc)
 {
+  (void) p_desc;
+
     return true;
 }
 
diff --git a/dvb/si/dit_print.h b/dvb/si/dit_print.h
index 6a54883..f6991cd 100644
--- a/dvb/si/dit_print.h
+++ b/dvb/si/dit_print.h
@@ -44,6 +44,9 @@ static inline void dit_print(uint8_t *p_dit,
                              f_iconv pf_iconv, void *iconv_opaque,
                              print_type_t i_print_type)
 {
+    (void) pf_iconv;
+    (void) iconv_opaque;
+
     switch (i_print_type) {
     case PRINT_XML:
         pf_print(print_opaque, "<DIT transition_flag=\"%u\"/>",
diff --git a/dvb/si/eit_print.h b/dvb/si/eit_print.h
index a08b591..45dbed3 100644
--- a/dvb/si/eit_print.h
+++ b/dvb/si/eit_print.h
@@ -50,7 +50,7 @@ static inline void eit_print(uint8_t *p_eit,
     uint8_t *p_event;
     uint8_t j = 0;
     uint8_t i_tid = psi_get_tableid(p_eit);
-    char *psz_tid = "unknown";
+    const char *psz_tid = "unknown";
 
     if (i_tid == EIT_TABLE_ID_PF_ACTUAL)
         psz_tid = "actual_pf";
diff --git a/dvb/si/rst_print.h b/dvb/si/rst_print.h
index 7eed4dd..2dd482a 100644
--- a/dvb/si/rst_print.h
+++ b/dvb/si/rst_print.h
@@ -44,6 +44,9 @@ static inline void rst_print(uint8_t *p_rst,
                              f_iconv pf_iconv, void *iconv_opaque,
                              print_type_t i_print_type)
 {
+    (void) pf_iconv;
+    (void) iconv_opaque;
+
     uint8_t j = 0;
     uint8_t *p_rst_n;
 
diff --git a/dvb/si/strings.h b/dvb/si/strings.h
index 9a035bc..c61f477 100644
--- a/dvb/si/strings.h
+++ b/dvb/si/strings.h
@@ -142,7 +142,7 @@ static inline char *dvb_string_get(const uint8_t *p_string, size_t i_length,
                                                            &i_length);
         if (psz_encoding == NULL || !i_length) {
             /* try one-byte charset */
-            char *psz_string = (uint8_t *)malloc(i_length + 1);
+            char *psz_string = (char *)malloc(i_length + 1);
             memcpy(psz_string, p_string, i_length);
             psz_string[i_length] = '\0';
             return psz_string;
@@ -180,7 +180,7 @@ static inline char *dvb_string_xml_escape(char *psz_input)
         psz1++;
     }
 
-    psz2 = psz_output = (uint8_t *)malloc(i_output_size + 1);
+    psz2 = psz_output = (char *)malloc(i_output_size + 1);
     psz1 = psz_input;
     while (*psz1) {
         switch (*psz1) {
diff --git a/dvb/si/tdt_print.h b/dvb/si/tdt_print.h
index 87b0c72..040b7cb 100644
--- a/dvb/si/tdt_print.h
+++ b/dvb/si/tdt_print.h
@@ -45,6 +45,9 @@ static inline void tdt_print(uint8_t *p_tdt,
                              f_iconv pf_iconv, void *iconv_opaque,
                              print_type_t i_print_type)
 {
+    (void) pf_iconv;
+    (void) iconv_opaque;
+
     time_t ts;
     char ts_str[24];
 
diff --git a/dvb/sub.h b/dvb/sub.h
index 228dde8..0759649 100644
--- a/dvb/sub.h
+++ b/dvb/sub.h
@@ -33,6 +33,8 @@
 #ifndef __BITSTREAM_DVB_SUB_H__
 #define __BITSTREAM_DVB_SUB_H__
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C"
 {
diff --git a/mpeg/psi/cat_print.h b/mpeg/psi/cat_print.h
index e2e381b..c220da2 100644
--- a/mpeg/psi/cat_print.h
+++ b/mpeg/psi/cat_print.h
@@ -45,7 +45,7 @@ static inline void cat_table_print(uint8_t **pp_sections, f_print pf_print,
 {
     uint8_t i_last_section = psi_table_get_lastsection(pp_sections);
     uint8_t i;
-    char *psz_table_name = "CAT";
+    const char *psz_table_name = "CAT";
 
     if (psi_get_tableid(psi_table_get_section(pp_sections, 0)) == TSDT_TABLE_ID)
         psz_table_name = "TSDT";
diff --git a/mpeg/psi/descriptors.h b/mpeg/psi/descriptors.h
index 688d86a..bb1d4fb 100644
--- a/mpeg/psi/descriptors.h
+++ b/mpeg/psi/descriptors.h
@@ -93,6 +93,8 @@ static inline void desc_print_begin(const uint8_t *p_desc, f_print pf_print,
 static inline void desc_print_end(const uint8_t *p_desc, f_print pf_print,
                                   void *opaque, print_type_t i_print_type)
 {
+    (void) p_desc;
+
     switch (i_print_type) {
     case PRINT_XML:
         pf_print(opaque, "</DESC>");
diff --git a/mpeg/psi/psi.h b/mpeg/psi/psi.h
index 02e7558..9866c7b 100644
--- a/mpeg/psi/psi.h
+++ b/mpeg/psi/psi.h
@@ -330,6 +330,8 @@ static inline void psi_assemble_reset(uint8_t **pp_psi_buffer,
 static inline bool psi_assemble_empty(uint8_t **pp_psi_buffer,
                                       uint16_t *pi_psi_buffer_used)
 {
+    (void) pi_psi_buffer_used;
+
     return *pp_psi_buffer == NULL;
 }
 



More information about the biTStream-devel mailing list