[vlc-commits] access: dvb: scan: fix signedness

Francois Cartegnie git at videolan.org
Sun Apr 10 13:56:13 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Apr  9 11:46:51 2016 +0200| [275fc8638879861aa1dd939931e0a843973848e2] | committer: Francois Cartegnie

access: dvb: scan: fix signedness

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=275fc8638879861aa1dd939931e0a843973848e2
---

 modules/access/dvb/scan.c |    6 +++---
 modules/access/dvb/scan.h |   19 +++++--------------
 2 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/modules/access/dvb/scan.c b/modules/access/dvb/scan.c
index f29974e..354561d 100644
--- a/modules/access/dvb/scan.c
+++ b/modules/access/dvb/scan.c
@@ -438,12 +438,12 @@ static int ScanDvbTNextFast( scan_t *p_scan, scan_configuration_t *p_cfg, double
             continue;
         }
 
-        const int i_frequency_min = band[i].i_min*i_mhz + i_bandwidth*i_mhz/2;
-        const int i_frequency_base = i_fi*i_mhz;
+        const unsigned i_frequency_min = band[i].i_min*i_mhz + i_bandwidth*i_mhz/2;
+        const unsigned i_frequency_base = i_fi*i_mhz;
 
         if( i_frequency_base >= i_frequency_min && ( i_frequency_base - i_frequency_min ) % ( i_bandwidth*i_mhz ) == 0 )
         {
-            const int i_frequency = i_frequency_base + ( i_oi - i_offset_count/2 ) * p_scan->parameter.frequency.i_step;
+            const unsigned i_frequency = i_frequency_base + ( i_oi - i_offset_count/2 ) * p_scan->parameter.frequency.i_step;
 
             if( i_frequency < p_scan->parameter.frequency.i_min ||
                 i_frequency > p_scan->parameter.frequency.i_max )
diff --git a/modules/access/dvb/scan.h b/modules/access/dvb/scan.h
index 0470c71..b7a06b2 100644
--- a/modules/access/dvb/scan.h
+++ b/modules/access/dvb/scan.h
@@ -42,22 +42,13 @@ typedef struct scan_parameter_t
     int i_symbolrate;
     struct
     {
-        int i_min;
-        int i_max;
-        int i_step;
+        unsigned i_min;
+        unsigned i_max;
+        unsigned i_step;
 
         unsigned i_count;    /* Number of frequency test to do */
-    } frequency;
-
-    struct
-    {
-        /* Bandwidth should be 6, 7 or 8 */
-        int i_min;
-        int i_max;
-        int i_step;
-
-        unsigned i_count;
-    } bandwidth;
+    } frequency,
+      bandwidth; /* Bandwidth should be 6, 7 or 8 */
 
     char *psz_scanlist_file;
     enum



More information about the vlc-commits mailing list