libdvbv5/descriptors.c: fix two warnings
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 27 Nov 2013 11:29:46 +0000 (09:29 -0200)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 27 Nov 2013 11:30:10 +0000 (09:30 -0200)
descriptors.c:134:4: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Wformat=]
    dvb_logwarn("descriptor type 0x%02x is truncated: desc len %ld, section len %zd",
    ^
descriptors/desc_frequency_list.c: In function 'dvb_desc_frequency_list_init':
descriptors/desc_frequency_list.c:31:12: warning: initialization discards 'const' qualifier from pointer target type [enabled by default]
  char *p = buf;

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
lib/libdvbv5/descriptors.c
lib/libdvbv5/descriptors/desc_frequency_list.c

index a95652b..e8c32ed 100644 (file)
@@ -131,7 +131,7 @@ void dvb_parse_descriptors(struct dvb_v5_fe_parms *parms, const uint8_t *buf,
                        size = 4096;
                }
                if (ptr + 2 >=  buf + section_length) {
-                       dvb_logwarn("descriptor type 0x%02x is truncated: desc len %ld, section len %zd",
+                       dvb_logwarn("descriptor type 0x%02x is truncated: desc len %d, section len %zd",
                                   desc_type, desc_len, section_length - (ptr - buf));
                        return;
                }
index 19c6f25..824b172 100644 (file)
@@ -28,7 +28,7 @@ void dvb_desc_frequency_list_init(struct dvb_v5_fe_parms *parms, const uint8_t *
        struct dvb_desc_frequency_list *d = (struct dvb_desc_frequency_list *) desc;
        size_t len;
        int i;
-       char *p = buf;
+       const uint8_t *p = buf;
 
        len = sizeof(*d) - offsetof(struct dvb_desc_frequency_list, bitfield);
        memcpy(&d->bitfield, p, len);