]> git.sesse.net Git - vlc/blobdiff - modules/access/directory.c
mmap: default enable the module on Darwin
[vlc] / modules / access / directory.c
index 71263b1ac5426ff5e46bf98bdf23d3145c319592..73f65dbafe76ae6f2054ddcabacd3a831a5427e9 100644 (file)
 #ifdef HAVE_DIRENT_H
 #   include <dirent.h>
 #endif
+#ifdef __sun__
+static inline int dirfd (DIR *dir)
+{
+    return dir->dd_fd;
+}
+#endif
 
 #include <vlc_charset.h>
 #include <vlc_url.h>
@@ -233,6 +239,7 @@ static bool has_inode_loop (const directory_t *dir)
             return true;
 #else
 # define fstat( fd, st ) (0)
+    VLC_UNUSED( dir );
 #endif
     return false;
 }
@@ -467,28 +474,22 @@ fatal:
  *****************************************************************************/
 static int Control( access_t *p_access, int i_query, va_list args )
 {
-    bool    *pb_bool;
-    int64_t *pi_64;
-
     switch( i_query )
     {
         /* */
         case ACCESS_CAN_SEEK:
         case ACCESS_CAN_FASTSEEK:
-            pb_bool = (bool*)va_arg( args, bool* );
-            *pb_bool = false;
+            *va_arg( args, bool* ) = false;
             break;
 
         case ACCESS_CAN_PAUSE:
         case ACCESS_CAN_CONTROL_PACE:
-            pb_bool = (bool*)va_arg( args, bool* );
-            *pb_bool = true;
+            *va_arg( args, bool* ) = true;
             break;
 
         /* */
         case ACCESS_GET_PTS_DELAY:
-            pi_64 = (int64_t*)va_arg( args, int64_t * );
-            *pi_64 = DEFAULT_PTS_DELAY * 1000;
+            *va_arg( args, int64_t * ) = DEFAULT_PTS_DELAY * 1000;
             break;
 
         /* */