Commit a041a344 authored by Georgi Chorbadzhiyski's avatar Georgi Chorbadzhiyski

Fix compiler warnings.

The fixed warnings are:
  bitstream/dvb/sim.h: In function "tlv_find_data":
  bitstream/dvb/sim.h:216:5: warning: return discards qualifiers from pointer target type

  bitstream/dvb/sim.h: In function "ecmg_validate":
  bitstream/dvb/sim.h:389:5: warning: excess elements in scalar initializer
  bitstream/dvb/sim.h:389:5: warning: (near initialization for "p_param")
  bitstream/dvb/sim.h:389:5: warning: excess elements in scalar initializer
  bitstream/dvb/sim.h:389:5: warning: (near initialization for "p_param")

  bitstream/dvb/si.h: In function "dvb_string_set":
  bitstream/dvb/si.h:174:9: warning: pointer targets in passing argument 1 of "strlen" differ in signedness
  /usr/include/string.h:399:15: note: expected "const char *" but argument is of type "const uint8_t *"

  bitstream/dvb/si.h:174:9: warning: pointer targets in passing argument 1 of "__strdup" differ in signedness
  /usr/include/bits/string2.h:1303:14: note: expected "const char *" but argument is of type "const uint8_t *"
  bitstream/dvb/si.h:174:9: warning: pointer targets in return differ in signedness

  bitstream/dvb/si.h: In function "dvb_string_get":
  bitstream/dvb/si.h:219:25: warning: passing argument 3 of "pf_iconv" discards qualifiers from pointer target type
  bitstream/dvb/si.h:219:25: note: expected "char *" but argument is of type "const uint8_t *"

  bitstream/dvb/si.h: In function "desc48_get_service":
  bitstream/dvb/si.h:742:5: warning: return discards qualifiers from pointer target type
parent c73bef15
......@@ -184,7 +184,7 @@ static inline uint8_t *dvb_string_set(const uint8_t *p_string, size_t i_length,
if (!strcmp(psz_encoding, "ISO_8859-9")) {
*pi_out_length = i_length;
return strdup(p_string);
return (uint8_t *)strdup((const char *)p_string);
}
for (i = 0; ppsz_dvb_encodings[i] != NULL; i++) {
......@@ -229,7 +229,7 @@ static inline char *dvb_string_get(const uint8_t *p_string, size_t i_length,
}
return pf_iconv(iconv_opaque, psz_encoding,
p_string, i_length);
(char *)p_string, i_length);
}
return strdup("");
......@@ -750,7 +750,7 @@ static inline void desc48_set_service(uint8_t *p_desc,
static inline uint8_t *desc48_get_service(const uint8_t *p_desc,
uint8_t *pi_length)
{
const uint8_t *p = p_desc + DESC48_HEADER_SIZE + 1 + p_desc[3];
uint8_t *p = (uint8_t *)p_desc + DESC48_HEADER_SIZE + 1 + p_desc[3];
*pi_length = p[0];
return p + 1;
}
......
......@@ -225,7 +225,7 @@ static inline bool tlv_append_data(uint8_t *p_tlv, uint16_t i_type,
static inline uint8_t *tlv_find_data(uint8_t *p_tlv, uint16_t i_type,
uint16_t n, uint16_t *pi_length)
{
const uint8_t *p_tlv_n = tlv_find_param(p_tlv, i_type, n);
uint8_t *p_tlv_n = tlv_find_param(p_tlv, i_type, n);
*pi_length = tlv_get_length(p_tlv_n);
return p_tlv_n + 4;
}
......@@ -400,7 +400,8 @@ static inline bool ecmg_validate(uint8_t *p_tlv)
{ECMG_PARAM_CPNUMBER, 1, 1}, {ECMG_PARAM_ECM, 1, 1}, {0, 0, 0}
};
const tlv_param_count_t *p_param = {0, 0, 0};
const tlv_param_count_t null_param = {0, 0, 0};
const tlv_param_count_t *p_param = &null_param;
uint8_t *p_tlv_n;
int j = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment