[libbluray-devel] VS build fixes: changed types, added missing headers, ...

hpi1 git at videolan.org
Thu Sep 13 12:34:11 CEST 2012


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Sep 13 13:26:40 2012 +0300| [81eb46031d746eb5f1c0c605aec866898cf94152] | committer: hpi1

VS build fixes: changed types, added missing headers, ...

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

 src/file/dir_posix.c                         |    4 ++--
 src/file/dl_posix.c                          |    4 ++--
 src/libbluray/bdj/bdj.c                      |    1 +
 src/libbluray/bdj/bdjo_parser.c              |    1 +
 src/libbluray/bdnav/clpi_parse.c             |    2 +-
 src/libbluray/bdnav/index_parse.h            |   12 ++++++------
 src/libbluray/bdnav/mpls_parse.c             |    2 +-
 src/libbluray/decoders/graphics_controller.c |    2 +-
 src/util/bits.h                              |    2 +-
 9 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/file/dir_posix.c b/src/file/dir_posix.c
index 51f5143..dd7bbd7 100644
--- a/src/file/dir_posix.c
+++ b/src/file/dir_posix.c
@@ -47,7 +47,7 @@ static void dir_close_posix(BD_DIR_H *dir)
 {
     if (dir) {
 #if defined(_WIN32)
-        dir_data_t *priv = dir->internal;
+        dir_data_t *priv = (dir_data_t*)dir->internal;
         _findclose(priv->handle);
         X_FREE(dir->internal);
 #else
@@ -63,7 +63,7 @@ static void dir_close_posix(BD_DIR_H *dir)
 static int dir_read_posix(BD_DIR_H *dir, BD_DIRENT *entry)
 {
 #if defined(_WIN32)
-    dir_data_t *priv = dir->internal;
+    dir_data_t *priv = (dir_data_t*)dir->internal;
 
     if (!priv->info.name[0]) {
         return 1;
diff --git a/src/file/dl_posix.c b/src/file/dl_posix.c
index 2c5c0a8..0ef99ab 100644
--- a/src/file/dl_posix.c
+++ b/src/file/dl_posix.c
@@ -134,7 +134,7 @@ void   *dl_dlopen  ( const char* path, const char *version )
 void   *dl_dlsym   ( void* handle, const char* symbol )
 {
 #if defined(_WIN32)
-    void *result = (void *)GetProcAddress(handle, symbol);
+    void *result = (void *)GetProcAddress((HMODULE)handle, symbol);
 
     if (!result) {
         char buf[128];
@@ -154,7 +154,7 @@ void   *dl_dlsym   ( void* handle, const char* symbol )
 int     dl_dlclose ( void* handle )
 {
 #if defined(_WIN32)
-    FreeLibrary(handle);
+    FreeLibrary((HMODULE)handle);
     return 0;
 #else
     return dlclose(handle);
diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index 66f64cb..8035104 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -28,6 +28,7 @@
 #include "libbluray/register.h"
 #include "file/dl.h"
 #include "util/strutl.h"
+#include "util/macro.h"
 
 #include <jni.h>
 #include <stdlib.h>
diff --git a/src/libbluray/bdj/bdjo_parser.c b/src/libbluray/bdj/bdjo_parser.c
index 052e9e2..24fcd9c 100644
--- a/src/libbluray/bdj/bdjo_parser.c
+++ b/src/libbluray/bdj/bdjo_parser.c
@@ -26,6 +26,7 @@
 
 #include "file/file.h"
 #include "util/bits.h"
+#include "util/macro.h"
 #include "bdj_util.h"
 
 /* Documentation: HD Cookbook
diff --git a/src/libbluray/bdnav/clpi_parse.c b/src/libbluray/bdnav/clpi_parse.c
index 60ea00f..d8ea279 100644
--- a/src/libbluray/bdnav/clpi_parse.c
+++ b/src/libbluray/bdnav/clpi_parse.c
@@ -567,7 +567,7 @@ _parse_extent_start_points(BITSTREAM *bits, CLPI_EXTENT_START *es)
 
 static int _parse_clpi_extension(BITSTREAM *bits, int id1, int id2, void *handle)
 {
-    CLPI_CL *cl = handle;
+    CLPI_CL *cl = (CLPI_CL*)handle;
 
     if (id1 == 2) {
         if (id2 == 4) {
diff --git a/src/libbluray/bdnav/index_parse.h b/src/libbluray/bdnav/index_parse.h
index 9a49477..e6b706e 100644
--- a/src/libbluray/bdnav/index_parse.h
+++ b/src/libbluray/bdnav/index_parse.h
@@ -64,23 +64,23 @@ typedef enum {
 typedef struct {
     uint8_t           initial_output_mode_preference : 1; /* 0 - 2D, 1 - 3D */
     uint8_t           content_exist_flag : 1;
-    indx_video_format video_format;
-    indx_frame_rate   frame_rate;
+    uint8_t           video_format : 4;
+    uint8_t           frame_rate : 4;
     uint8_t           user_data[32];
 } INDX_APP_INFO;
 
 typedef struct {
-    indx_bdj_playback_type playback_type;
+    uint8_t                playback_type : 2;
     char                   name[6];
 } INDX_BDJ_OBJ;
 
 typedef struct {
-    indx_hdmv_playback_type playback_type;
+    uint8_t                 playback_type : 2;
     uint16_t                id_ref;
 } INDX_HDMV_OBJ;
 
 typedef struct {
-    indx_object_type   object_type;
+    uint8_t            object_type : 2;
     /*union {*/
         INDX_BDJ_OBJ   bdj;
         INDX_HDMV_OBJ  hdmv;
@@ -88,7 +88,7 @@ typedef struct {
 } INDX_PLAY_ITEM;
 
 typedef struct {
-    indx_object_type   object_type;
+    uint8_t            object_type : 2;
     uint8_t            access_type : 2;
     /*union {*/
         INDX_BDJ_OBJ   bdj;
diff --git a/src/libbluray/bdnav/mpls_parse.c b/src/libbluray/bdnav/mpls_parse.c
index 8a78ea5..eb9b442 100644
--- a/src/libbluray/bdnav/mpls_parse.c
+++ b/src/libbluray/bdnav/mpls_parse.c
@@ -771,7 +771,7 @@ _parse_subpath_extension(BITSTREAM *bits, MPLS_PL *pl)
 static int
 _parse_mpls_extension(BITSTREAM *bits, int id1, int id2, void *handle)
 {
-    MPLS_PL *pl = handle;
+    MPLS_PL *pl = (MPLS_PL*)handle;
 
     if (id1 == 2) {
         if (id2 == 2) {
diff --git a/src/libbluray/decoders/graphics_controller.c b/src/libbluray/decoders/graphics_controller.c
index cd8d0fb..9eb122a 100644
--- a/src/libbluray/decoders/graphics_controller.c
+++ b/src/libbluray/decoders/graphics_controller.c
@@ -850,7 +850,7 @@ static int _render_page(GRAPHICS_CONTROLLER *gc,
 #define VK_IS_CURSOR(vk)  (vk >= BD_VK_UP && vk <= BD_VK_RIGHT)
 #define VK_TO_NUMBER(vk)  ((vk) - BD_VK_0)
 
-static int _user_input(GRAPHICS_CONTROLLER *gc, bd_vk_key_e key, GC_NAV_CMDS *cmds)
+static int _user_input(GRAPHICS_CONTROLLER *gc, uint32_t key, GC_NAV_CMDS *cmds)
 {
     PG_DISPLAY_SET *s          = gc->igs;
     BD_IG_PAGE     *page       = NULL;
diff --git a/src/util/bits.h b/src/util/bits.h
index f83d2b2..b9843fa 100644
--- a/src/util/bits.h
+++ b/src/util/bits.h
@@ -52,7 +52,7 @@ typedef struct {
     int        size;
 } BITSTREAM;
 
-static inline void bb_init( BITBUFFER *bb, void *p_data, size_t i_data )
+static inline void bb_init( BITBUFFER *bb, uint8_t *p_data, size_t i_data )
 {
     bb->p_start = p_data;
     bb->p       = bb->p_start;



More information about the libbluray-devel mailing list