[libbluray-devel] Remove (almost) unused return value defines

hpi1 git at videolan.org
Tue Sep 30 13:10:17 CEST 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Sep 30 13:20:29 2014 +0300| [1731b00ed7077ef6f3574de40142ff84975ade01] | committer: hpi1

Remove (almost) unused return value defines

Those were used only in incorrect place (BDJ_SUCCESS was impossible return value for the function)

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

 src/libbluray/bdj/bdjo_parser.c |    5 ++---
 src/libbluray/bdj/common.h      |    3 ---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/libbluray/bdj/bdjo_parser.c b/src/libbluray/bdj/bdjo_parser.c
index 3807662..65969c5 100644
--- a/src/libbluray/bdj/bdjo_parser.c
+++ b/src/libbluray/bdj/bdjo_parser.c
@@ -18,7 +18,6 @@
  */
 
 #include "bdjo_parser.h"
-#include "common.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -48,7 +47,7 @@ static int _get_version(const uint8_t* str)
     else if (strcmp((const char*) str, "0200") != 0)
         return 200;
     else
-        return BDJ_ERROR;
+        return 0;
 }
 
 // use when string is already allocated, out should be length + 1
@@ -371,7 +370,7 @@ static jobject _parse_bdjo(JNIEnv* env, BITBUFFER* buf)
     // get version string
     uint8_t version[4];
     bb_read_bytes(buf, version, 4);
-    if (_get_version(version) == BDJ_ERROR) {
+    if (!_get_version(version)) {
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "Invalid version of BDJO.\n");
         return NULL;
     }
diff --git a/src/libbluray/bdj/common.h b/src/libbluray/bdj/common.h
index f3db5c5..9bd9695 100644
--- a/src/libbluray/bdj/common.h
+++ b/src/libbluray/bdj/common.h
@@ -31,9 +31,6 @@
 #define BDJ_BDJO_PATH "/BDMV/BDJO"
 #define BDJ_JAR_PATH "/BDMV/JAR"
 
-#define BDJ_ERROR 0
-#define BDJ_SUCCESS 1
-
 // input events
 #define BDJ_KEY_PRESSED 401
 #define BDJ_KEY_RELEASED 402



More information about the libbluray-devel mailing list