changeset 229:8b5edf44e384 src

Remove all occurances to off64_t and lseek64 It is not needed because we define _FILE_OFFSET_BITS=64. Integrate patch from Derk-Jan Hartman <hartman@videolan.org> with some minor changes.
author jcdutton
date Wed, 21 Jan 2004 23:11:05 +0000
parents eef7478ffd45
children 065a2835ba90
files vm/vm.c
diffstat 1 files changed, 7 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/vm/vm.c	Wed Jan 21 22:51:49 2004 +0000
+++ b/vm/vm.c	Wed Jan 21 23:11:05 2004 +0000
@@ -44,14 +44,8 @@
 
 #ifdef _MSC_VER
 #include <io.h>   /* read() */
-#define lseek64 lseek
 #endif /* _MSC_VER */
 
-#ifdef __CYGWIN__
-# define off64_t off_t
-# define lseek64 lseek
-#endif
-
 /*
 #define STRICT
 */
@@ -132,22 +126,21 @@
 #endif
 
 static void dvd_read_name(char *name, const char *device) {
+    /* Because we are compiling with _FILE_OFFSET_BITS=64
+     * all off_t are 64bit.
+     */
+    off_t off;
     int fd, i;
-#if !defined(__FreeBSD__) && !defined(WIN32)
-    off64_t off;
-#else
-    off_t off;
-#endif
     uint8_t data[DVD_VIDEO_LB_LEN];
 
     /* Read DVD name */
     fd = open(device, O_RDONLY | O_EXCL);
     if (fd > 0) { 
-      off = lseek64( fd, 32 * (int64_t) DVD_VIDEO_LB_LEN, SEEK_SET );
-      if( off == ( 32 * (int64_t) DVD_VIDEO_LB_LEN ) ) {
+      off = lseek( fd, 32 * (off_t) DVD_VIDEO_LB_LEN, SEEK_SET );
+      if( off == ( 32 * (off_t) DVD_VIDEO_LB_LEN ) ) {
         off = read( fd, data, DVD_VIDEO_LB_LEN ); 
         close(fd);
-        if (off == ( (int64_t) DVD_VIDEO_LB_LEN )) {
+        if (off == ( (off_t) DVD_VIDEO_LB_LEN )) {
           fprintf(MSG_OUT, "libdvdnav: DVD Title: ");
           for(i=25; i < 73; i++ ) {
             if((data[i] == 0)) break;