[libbluray-devel] hdmv: use unsigned types

hpi1 git at videolan.org
Sat Mar 8 10:34:56 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Mar  6 15:16:14 2014 +0200| [04e0409c8102e5ae356378ff4bf2a9ace8172d2d] | committer: hpi1

hdmv: use unsigned types

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=04e0409c8102e5ae356378ff4bf2a9ace8172d2d
---

 src/libbluray/hdmv/hdmv_vm.c |   32 ++++++++++++++++----------------
 src/libbluray/hdmv/hdmv_vm.h |    2 +-
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/libbluray/hdmv/hdmv_vm.c b/src/libbluray/hdmv/hdmv_vm.c
index 9e34dcd..59ad55d 100644
--- a/src/libbluray/hdmv/hdmv_vm.c
+++ b/src/libbluray/hdmv/hdmv_vm.c
@@ -58,11 +58,11 @@ struct hdmv_vm_s {
 
     /* object currently playing playlist */
     MOBJ_OBJECT *playing_object;
-    int          playing_pc;
+    uint32_t     playing_pc;
 
     /* suspended object */
     MOBJ_OBJECT *suspended_object;
-    int          suspended_pc;
+    uint32_t     suspended_pc;
 
     /* disc index (used to verify CALL_TITLE/JUMP_TITLE) */
     INDX_ROOT   *indx;
@@ -424,7 +424,7 @@ static int _resume_object(HDMV_VM *p, int psr_restore)
  * branching
  */
 
-static int _is_valid_title(HDMV_VM *p, int title)
+static int _is_valid_title(HDMV_VM *p, uint32_t title)
 {
     if (title == 0 || title == 0xffff) {
         INDX_PLAY_ITEM *pi = (!title) ? &p->indx->top_menu : &p->indx->first_play;
@@ -439,14 +439,14 @@ static int _is_valid_title(HDMV_VM *p, int title)
     return title > 0 && title <= p->indx->num_titles;
 }
 
-static int _jump_object(HDMV_VM *p, int object)
+static int _jump_object(HDMV_VM *p, uint32_t object)
 {
-    if (object < 0 || object >= p->movie_objects->num_objects) {
-        BD_DEBUG(DBG_HDMV|DBG_CRIT, "_jump_object(): invalid object %d\n", object);
+    if (object >= p->movie_objects->num_objects) {
+        BD_DEBUG(DBG_HDMV|DBG_CRIT, "_jump_object(): invalid object %u\n", object);
         return -1;
     }
 
-    BD_DEBUG(DBG_HDMV, "_jump_object(): jumping to object %d\n", object);
+    BD_DEBUG(DBG_HDMV, "_jump_object(): jumping to object %u\n", object);
 
     _queue_event(p, HDMV_EVENT_PLAY_STOP, 0);
 
@@ -462,10 +462,10 @@ static int _jump_object(HDMV_VM *p, int object)
     return 0;
 }
 
-static int _jump_title(HDMV_VM *p, int title)
+static int _jump_title(HDMV_VM *p, uint32_t title)
 {
     if (_is_valid_title(p, title)) {
-        BD_DEBUG(DBG_HDMV, "_jump_title(%d)\n", title);
+        BD_DEBUG(DBG_HDMV, "_jump_title(%u)\n", title);
 
         /* discard suspended object */
         p->suspended_object = NULL;
@@ -476,14 +476,14 @@ static int _jump_title(HDMV_VM *p, int title)
         return 0;
     }
 
-    BD_DEBUG(DBG_HDMV|DBG_CRIT, "_jump_title(%d): invalid title number\n", title);
+    BD_DEBUG(DBG_HDMV|DBG_CRIT, "_jump_title(%u): invalid title number\n", title);
 
     return -1;
 }
 
-static int _call_object(HDMV_VM *p, int object)
+static int _call_object(HDMV_VM *p, uint32_t object)
 {
-    BD_DEBUG(DBG_HDMV, "_call_object(%d)\n", object);
+    BD_DEBUG(DBG_HDMV, "_call_object(%u)\n", object);
 
     _queue_event(p, HDMV_EVENT_PLAY_STOP, 0);
     _suspend_object(p, 1);
@@ -491,10 +491,10 @@ static int _call_object(HDMV_VM *p, int object)
     return _jump_object(p, object);
 }
 
-static int _call_title(HDMV_VM *p, int title)
+static int _call_title(HDMV_VM *p, uint32_t title)
 {
     if (_is_valid_title(p, title)) {
-        BD_DEBUG(DBG_HDMV, "_call_title(%d)\n", title);
+        BD_DEBUG(DBG_HDMV, "_call_title(%u)\n", title);
 
         _suspend_object(p, 1);
 
@@ -503,7 +503,7 @@ static int _call_title(HDMV_VM *p, int title)
         return 0;
     }
 
-    BD_DEBUG(DBG_HDMV|DBG_CRIT, "_call_title(%d): invalid title number\n", title);
+    BD_DEBUG(DBG_HDMV|DBG_CRIT, "_call_title(%u): invalid title number\n", title);
 
     return -1;
 }
@@ -1082,7 +1082,7 @@ static int _hdmv_step(HDMV_VM *p)
  * interface
  */
 
-int hdmv_vm_select_object(HDMV_VM *p, int object)
+int hdmv_vm_select_object(HDMV_VM *p, uint32_t object)
 {
     int result;
 
diff --git a/src/libbluray/hdmv/hdmv_vm.h b/src/libbluray/hdmv/hdmv_vm.h
index 102a22e..fea28ac 100644
--- a/src/libbluray/hdmv/hdmv_vm.h
+++ b/src/libbluray/hdmv/hdmv_vm.h
@@ -76,7 +76,7 @@ typedef struct hdmv_vm_s HDMV_VM;
 BD_PRIVATE HDMV_VM *hdmv_vm_init(const char *disc_root, struct bd_registers_s *regs, struct indx_root_s *indx);
 BD_PRIVATE void     hdmv_vm_free(HDMV_VM **p);
 
-BD_PRIVATE int      hdmv_vm_select_object(HDMV_VM *p, int object);
+BD_PRIVATE int      hdmv_vm_select_object(HDMV_VM *p, uint32_t object);
 BD_PRIVATE int      hdmv_vm_set_object(HDMV_VM *p, int num_nav_cmds, void *nav_cmds);
 BD_PRIVATE int      hdmv_vm_run(HDMV_VM *p, HDMV_EVENT *ev);
 BD_PRIVATE int      hdmv_vm_get_event(HDMV_VM *p, HDMV_EVENT *ev);



More information about the libbluray-devel mailing list