[libbluray-devel] Add some explicit typecasting to make strict C99 compilers happy.

Erik Van Grunderbeeck git at videolan.org
Tue Mar 29 15:17:40 CEST 2011


libbluray | branch: master | Erik Van Grunderbeeck <erik at arawix.com> | Tue Mar 22 11:16:40 2011 +0100| [c738c2d5e75c85b19b79fdcf6bbc8f6f55c582c3] | committer: hpi1

Add some explicit typecasting to make strict C99 compilers happy.

Signed-off-by: Erik Van Grunderbeeck <erik at arawix.com>

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

 src/libbluray/bdj/bdj.c |    2 +-
 src/libbluray/bluray.c  |   14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index fdf59e5..1299748 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -70,7 +70,7 @@ BDJAVA* bdj_open(const char *path, const char* start, void* bd, void* registers)
     args.options = option;
     args.ignoreUnrecognized = JNI_FALSE; // don't ignore unrecognized options
 
-    fptr_JNI_CreateJavaVM JNI_CreateJavaVM_fp = dl_dlsym(jvm_lib,
+    fptr_JNI_CreateJavaVM JNI_CreateJavaVM_fp = (fptr_JNI_CreateJavaVM)dl_dlsym(jvm_lib,
             "JNI_CreateJavaVM");
 
     if (JNI_CreateJavaVM_fp == NULL) {
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index f1b55fe..baeae86 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -149,7 +149,7 @@ struct bluray {
 #ifdef DLOPEN_CRYPTO_LIBS
 #    define DL_CALL(lib,func,param,...)             \
      do {                                           \
-          fptr_p_void fptr = dl_dlsym(lib, #func);  \
+          fptr_p_void fptr = (fptr_p_void)dl_dlsym(lib, #func);  \
           if (fptr) {                               \
               fptr(param, ##__VA_ARGS__);           \
           }                                         \
@@ -471,8 +471,8 @@ static int _libaacs_load(BLURAY *bd)
 
         DEBUG(DBG_BLURAY, "Loading libaacs (%p)\n", bd->h_libaacs);
 
-        bd->libaacs_open         = dl_dlsym(bd->h_libaacs, "aacs_open");
-        bd->libaacs_decrypt_unit = dl_dlsym(bd->h_libaacs, "aacs_decrypt_unit");
+        bd->libaacs_open         = (fptr_p_void)dl_dlsym(bd->h_libaacs, "aacs_open");
+        bd->libaacs_decrypt_unit = (fptr_int)dl_dlsym(bd->h_libaacs, "aacs_decrypt_unit");
 
         if (bd->libaacs_open && bd->libaacs_decrypt_unit) {
             DEBUG(DBG_BLURAY, "Loaded libaacs (%p)\n", bd->h_libaacs);
@@ -535,7 +535,7 @@ static uint8_t *_libaacs_get_vid(BLURAY *bd)
 {
     if (bd->aacs) {
 #ifdef DLOPEN_CRYPTO_LIBS
-        fptr_p_void fptr = dl_dlsym(bd->h_libaacs, "aacs_get_vid");
+        fptr_p_void fptr = (fptr_p_void)dl_dlsym(bd->h_libaacs, "aacs_get_vid");
         if (fptr) {
             return (uint8_t*)fptr(bd->aacs);
         }
@@ -610,9 +610,9 @@ static int _libbdplus_load(BLURAY *bd)
 
         DEBUG(DBG_BLURAY, "Loading libbdplus (%p)\n", bd->h_libbdplus);
 
-        bd->bdplus_init  = dl_dlsym(bd->h_libbdplus, "bdplus_init");
-        bd->bdplus_seek  = dl_dlsym(bd->h_libbdplus, "bdplus_seek");
-        bd->bdplus_fixup = dl_dlsym(bd->h_libbdplus, "bdplus_fixup");
+        bd->bdplus_init  = (fptr_p_void)dl_dlsym(bd->h_libbdplus, "bdplus_init");
+        bd->bdplus_seek  = (fptr_int32)dl_dlsym(bd->h_libbdplus, "bdplus_seek");
+        bd->bdplus_fixup = (fptr_int32)dl_dlsym(bd->h_libbdplus, "bdplus_fixup");
 
         if (bd->bdplus_init && bd->bdplus_seek && bd->bdplus_fixup) {
             DEBUG(DBG_BLURAY, "Loaded libbdplus (%p)\n", bd->h_libbdplus);



More information about the libbluray-devel mailing list