[libbluray-devel] Define function pointers for have_file and file_open functions

tourettes git at videolan.org
Sun Feb 1 13:08:38 CET 2015


libbluray | branch: master | tourettes <tourettes at team-mediaportal.com> | Fri Jan 30 19:14:17 2015 +0200| [ec992eee27a77ea3428f2ac30bfc05e28823ab95] | committer: npzacs

Define function pointers for have_file and file_open functions

Fixes compilation issue with older Visual Studio C++ compilers

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

 src/libbluray/disc/dec.h  |   13 ++++++++-----
 src/libbluray/disc/disc.c |    2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/libbluray/disc/dec.h b/src/libbluray/disc/dec.h
index 87e8f6c..3b32ed3 100644
--- a/src/libbluray/disc/dec.h
+++ b/src/libbluray/disc/dec.h
@@ -31,13 +31,16 @@
 struct bd_file_s;
 struct bd_enc_info;
 
+typedef struct bd_file_s * (*file_openFp)(void *, const char *);
+typedef int (*have_fileFp)(void *, const char *, const char *);
+
 /* device to use */
 struct dec_dev {
-    void                *file_open_handle;
-    int                (*have_file)(void *, const char *, const char *);
-    struct bd_file_s * (*file_open)(void *, const char *);
-    const char          *root;   /* may be NULL if disc is not mounted */
-    const char          *device; /* may be null if not reading from real device */
+    void          *file_open_handle;
+    have_fileFp   have_file;
+    file_openFp   file_open;
+    const char    *root;   /* may be NULL if disc is not mounted */
+    const char    *device; /* may be null if not reading from real device */
 };
 
 typedef struct bd_dec BD_DEC;
diff --git a/src/libbluray/disc/disc.c b/src/libbluray/disc/disc.c
index 8b87669..ac6b550 100644
--- a/src/libbluray/disc/disc.c
+++ b/src/libbluray/disc/disc.c
@@ -81,7 +81,7 @@ BD_DISC *disc_open(const char *device_path,
             X_FREE(disc_root);
         }
 
-        struct dec_dev dev = { p, (void *)_disc_have_file, (void*)disc_open_path, p->disc_root, p->disc_device };
+        struct dec_dev dev = { p, (have_fileFp)_disc_have_file, (file_openFp)disc_open_path, p->disc_root, p->disc_device };
         p->dec = dec_init(&dev, enc_info, keyfile_path, regs, psr_read, psr_write);
     }
 



More information about the libbluray-devel mailing list