[DVDnav-discuss] Resolve minor compiler warnings

gnosygnu git at videolan.org
Fri Aug 15 04:24:18 CEST 2014


libdvdnav | branch: master | gnosygnu <gnosygnu at gmail.com> | Thu Aug 14 22:21:11 2014 -0400| [03cb72be09295686cf1af0af5d8661ab8d35b537] | committer: gnosygnu

Resolve minor compiler warnings

> http://git.videolan.org/gitweb.cgi/libdvdnav.git/?a=commit;h=03cb72be09295686cf1af0af5d8661ab8d35b537
---

 src/searching.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/searching.c b/src/searching.c
index 5a63da6..1fd3807 100644
--- a/src/searching.c
+++ b/src/searching.c
@@ -753,7 +753,6 @@ static vobu_admap_t* dvdnav_admap_get(dvdnav_t *this, dvd_state_t *state,
 /* Get a tmap, tmap_len and tmap_interval */
 static vts_tmap_t* dvdnav_tmap_get(dvdnav_t *this, dvd_state_t *state,
             int32_t *tmap_len, int32_t *tmap_interval) {
-  int32_t vts_idx = 0;
   int32_t domain;
   ifo_handle_t *ifo = NULL;
   vts_tmapt_t *tmapt = NULL;
@@ -762,7 +761,6 @@ static vts_tmap_t* dvdnav_tmap_get(dvdnav_t *this, dvd_state_t *state,
   vts_tmap_t *tmap = NULL;
   int32_t result = 0;
 
-  vts_idx = state->vtsN;
   domain = state->domain;
   switch(domain) {
   case DVD_DOMAIN_FirstPlay:
@@ -870,8 +868,10 @@ static int32_t dvdnav_admap_search(vobu_admap_t *admap, uint32_t admap_len,
     /* need to add 1 when prv_len == 3 (cur_len shoud go to 2, not 1) */
     if (prv_len % 2 == 1) ++cur_len;
     cur_idx = prv_pos + (cur_len * adj);
-    if       (cur_idx < 0)           cur_idx = 0;
-    else if  (cur_idx >= admap_len)  cur_idx = admap_len - 1;
+    if       (cur_idx < 0)
+      cur_idx = 0;
+    else if  (cur_idx >= (int32_t)admap_len)
+      cur_idx = admap_len - 1;
 
     cur_sector = admap->vobu_start_sectors[cur_idx];
     if      (find_sector <  cur_sector) adj = -1;
@@ -908,8 +908,10 @@ static int32_t dvdnav_tmap_search(vts_tmap_t *tmap, uint32_t tmap_len,
     /* need to add 1 when prv_len == 3 (cur_len shoud go to 2, not 1) */
     if (prv_len % 2 == 1) ++cur_len;
     cur_idx = prv_pos + (cur_len * adj);
-    if      (cur_idx < 0)         cur_idx = 0;
-    else if (cur_idx >= tmap_len) cur_idx = tmap_len - 1;
+    if      (cur_idx < 0)
+      cur_idx = 0;
+    else if (cur_idx >= (int32_t)tmap_len)
+      cur_idx = tmap_len - 1;
     cur_sector = 0;
     result = dvdnav_tmap_get_entry(tmap, tmap_len, cur_idx, &cur_sector);
     if (!result) return 0;
@@ -1039,7 +1041,7 @@ static int32_t dvdnav_admap_interpolate_vobu(dvdnav_jump_args_t *args,
   /* HACK: need to add +1, or else will land too soon (not sure why) */
   vobu_adj++;
   vobu_idx = bgn->vobu_idx + vobu_adj;
-  if (vobu_idx >= args->admap_len) {
+  if ((int32_t)vobu_idx >= args->admap_len) {
     fprintf(MSG_OUT, "admap_interpolate: vobu_idx >= admap_len");
     return 0;
   }



More information about the DVDnav-discuss mailing list