Index: src/config/mingw/os_stubs_c.c
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/config/mingw/os_stubs_c.c,v
retrieving revision 1.6
diff -u -w -r1.6 os_stubs_c.c
--- src/config/mingw/os_stubs_c.c	7 Aug 2005 17:39:30 -0000	1.6
+++ src/config/mingw/os_stubs_c.c	24 Aug 2005 18:39:40 -0000
@@ -20,7 +20,7 @@
 extern void enter_blocking_section(); 
 extern void leave_blocking_section();
 
-extern int os_read(OS_FD fd, char *buf, int len)
+extern ssize_t os_read(OS_FD fd, char *buf, size_t len)
 {
   DWORD numread;
   BOOL ret;
@@ -37,7 +37,7 @@
   return numread;
 }
 
-void os_ftruncate(OS_FD fd, int64 size)
+void os_ftruncate(OS_FD fd, OFF_T size)
 {
   uint curpos;
   long ofs_low = (long) size;
@@ -90,7 +90,7 @@
   }
 }
 
-int64 os_lseek(OS_FD fd, int64 ofs, int cmd)
+OFF_T os_lseek(OS_FD fd, OFF_T ofs, int cmd)
 {
   long ret;
   long ofs_low = ofs;
@@ -105,7 +105,7 @@
       uerror("os_lseek", Nothing);
     }
   }
-  return ((int64) ofs_high << 32 | ret);
+  return ((OFF_T) ofs_high << 32 | ret);
 }
 
 #include <winsock2.h>
Index: src/config/unix/os_stubs_c.c
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/config/unix/os_stubs_c.c,v
retrieving revision 1.8
diff -u -w -r1.8 os_stubs_c.c
--- src/config/unix/os_stubs_c.c	7 Aug 2005 17:39:30 -0000	1.8
+++ src/config/unix/os_stubs_c.c	24 Aug 2005 18:39:40 -0000
@@ -44,25 +44,25 @@
 #include "../../../config/config.h"
 #include "../../utils/lib/os_stubs.h"
 
-int64 os_lseek(OS_FD fd, off_t pos, int dir)
+OFF_T os_lseek(OS_FD fd, OFF_T pos, int dir)
 {
-  off_t result =  lseek(fd, pos, dir);
+  OFF_T result =  lseek(fd, pos, dir);
 
   if(result < 0) unix_error(errno, "os_lseek", Nothing);
 
   return result;
 }
 
-int os_read(OS_FD fd, char *buf, int len)
+ssize_t os_read(OS_FD fd, char *buf, size_t len)
 {
-  int result = read(fd, buf, len);
+  ssize_t result = read(fd, buf, len);
 
   if(result < 0) unix_error(errno, "os_read", Nothing);
 
   return result;
 }
  
-void os_ftruncate(OS_FD fd, off_t len)
+void os_ftruncate(OS_FD fd, OFF_T len)
 {
   int64 cursize;
   if(!fd) failwith("ftruncate32: file is closed");
@@ -70,7 +70,7 @@
   cursize = os_getfdsize(fd);
   if(cursize < len){
     int zero = 0;
-    off_t result = lseek(fd, len-1, SEEK_SET);
+    OFF_T result = lseek(fd, len-1, SEEK_SET);
     if(result < 0) unix_error(errno, "os_ftruncate", Nothing);
 
     write(fd, &zero, 1);
Index: src/utils/lib/os_stubs.h
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/utils/lib/os_stubs.h,v
retrieving revision 1.5
diff -u -w -r1.5 os_stubs.h
--- src/utils/lib/os_stubs.h	16 Apr 2004 17:14:56 -0000	1.5
+++ src/utils/lib/os_stubs.h	24 Aug 2005 18:39:40 -0000
@@ -52,6 +52,14 @@
 #endif
 
 #include <sys/types.h>
+
+// off_t is long on mingw, long long everywhere else
+#ifdef _OFF64_T_
+typedef off64_t OFF_T;
+#else
+typedef off_t OFF_T;
+#endif
+
 #include <sys/time.h>
 
 #ifdef HAS_SYS_SELECT_H
@@ -88,14 +96,9 @@
   SEEK_SET, SEEK_CUR, SEEK_END
 };
 
-#if !defined(__MINGW32__)
-extern int64 os_lseek(OS_FD fd, off_t pos, int dir);
-extern void os_ftruncate(OS_FD fd, off_t len);
-#else
-extern int64 os_lseek(OS_FD fd, int64 pos, int dir);
-extern void os_ftruncate(OS_FD fd, int64 len);
-#endif
-extern int os_read(OS_FD fd, char *buf, int len);
+extern OFF_T os_lseek(OS_FD fd, OFF_T pos, int dir);
+extern void os_ftruncate(OS_FD fd, OFF_T len);
+extern ssize_t os_read(OS_FD fd, char *buf, size_t len);
 extern int os_getdtablesize();
 extern int64 os_getfdsize(OS_FD fd);
 extern int64 os_getfilesize(char *path);
Index: src/utils/lib/stubs_c.c
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/utils/lib/stubs_c.c,v
retrieving revision 1.16
diff -u -w -r1.16 stubs_c.c
--- src/utils/lib/stubs_c.c	18 Aug 2005 12:56:33 -0000	1.16
+++ src/utils/lib/stubs_c.c	24 Aug 2005 18:39:44 -0000
@@ -126,8 +126,7 @@
 /*        printf("SETTING %d TO %d\n", fd, nfds); */
         pfds[nfds] = v;
         nfds++;
-      } else
-        ;
+      } // else ;
     }
   }
 /*  printf("POLL: %d/%d\n", nfds, ufds_size); */
@@ -351,7 +350,7 @@
 
 value ml_sizeofoff_t(value unit)
 {
-  return Val_int(sizeof(off_t));
+  return Val_int(sizeof(OFF_T));
 }
 
 /*******************************************************************
@@ -395,7 +394,7 @@
 #define ZEROS_LEN 1024
 value mld_ftruncate_64(value fd_v, value len_v)
 {
-  off_t len = Int64_val(len_v);
+  OFF_T len = Int64_val(len_v);
   OS_FD fd = Fd_val(fd_v);  
 
   os_ftruncate(fd, len);
@@ -500,17 +499,17 @@
 value HASH_NAME##_unsafe64_fd (value digest_v, value fd_v, value pos_v, value len_v) \
 { \
   OS_FD fd = Fd_val(fd_v); \
-  off_t pos = Int64_val(pos_v); \
-  off_t len = Int64_val(len_v); \
+  OFF_T pos = Int64_val(pos_v); \
+  OFF_T len = Int64_val(len_v); \
   unsigned char *digest = String_val(digest_v); \
   HASH_CONTEXT context; \
-  int nread; \
+  ssize_t nread; \
  \
   HASH_INIT (&context); \
   os_lseek(fd, pos, SEEK_SET); \
  \
   while (len!=0){ \
-    int max_nread = HASH_BUFFER_LEN > len ? len : HASH_BUFFER_LEN; \
+    size_t max_nread = HASH_BUFFER_LEN > len ? len : HASH_BUFFER_LEN; \
  \
     nread = os_read (fd, hash_buffer, max_nread); \
  \
@@ -552,7 +551,7 @@
   unsigned char *digest = String_val(digest_v); \
   FILE *file; \
   HASH_CONTEXT context; \
-  int len; \
+  size_t len; \
  \
   if ((file = fopen (filename, "rb")) == NULL) \
     raise_not_found(); \
@@ -586,19 +585,19 @@
 *******************************************************************/
 #include "tiger.h"
 
-static void tiger_tree_fd(OS_FD fd, int len, int pos, int block_size, char *digest)
+static void tiger_tree_fd(OS_FD fd, size_t len, size_t pos, size_t block_size, char *digest)
 {
   static char tiger_buffer[BLOCK_SIZE+1];
   if(block_size == BLOCK_SIZE){
-    int length = (len - pos > BLOCK_SIZE) ? BLOCK_SIZE : len - pos;
+    size_t length = (len - pos > BLOCK_SIZE) ? BLOCK_SIZE : len - pos;
     char *s = tiger_buffer+1;
-    int toread = length;
+    size_t toread = length;
     char *curs = s;
       while (toread!=0){
       int max_nread = toread;
 /* HASH_BUFFER_LEN > toread ? toread : HASH_BUFFER_LEN; */
 
-      int nread = os_read (fd, curs, max_nread);
+      ssize_t nread = os_read (fd, curs, max_nread);
 
         if(nread <= 0) {
         unix_error(errno, "tiger_safe_fd: Read", Nothing);
@@ -624,8 +623,8 @@
 value tigertree_unsafe64_fd (value digest_v, value fd_v, value pos_v, value len_v)
 {
   OS_FD fd = Fd_val(fd_v);
-  off_t pos = Int64_val(pos_v);
-  off_t len = Int64_val(len_v);
+  OFF_T pos = Int64_val(pos_v);
+  OFF_T len = Int64_val(len_v);
   unsigned char *digest = String_val(digest_v);
 /*  int nread; */
 
@@ -676,7 +675,7 @@
 
 // #include "socketaddr.h"
 #ifndef _WIN32
-#include <sys/types.h>
+// #include <sys/types.h>
 #include <netdb.h>
 #endif
 
Index: src/utils/lib/tiger.c
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/utils/lib/tiger.c,v
retrieving revision 1.6
diff -u -w -r1.6 tiger.c
--- src/utils/lib/tiger.c	16 Apr 2004 17:14:56 -0000	1.6
+++ src/utils/lib/tiger.c	24 Aug 2005 18:39:44 -0000
@@ -779,7 +779,7 @@
 #define MAX_TIGER_CHUNK_SIZE 1024
 static word64 tiger_buffer[MAX_TIGER_CHUNK_SIZE];
 
-void tiger_hash(char prefix, char *s, int len, unsigned char *digest)
+void tiger_hash(char prefix, char *s, long len, unsigned char *digest)
 {
   char *buffer = (char*) tiger_buffer;
   word64 ndigest[3];
@@ -794,10 +794,10 @@
   swap_digest(digest);
 }
 
-void tiger_tree_string(char *s, int len, int pos, int block_size, char *digest)
+void tiger_tree_string(char *s, size_t len, size_t pos, size_t block_size, char *digest)
 {
   if(block_size == BLOCK_SIZE){
-    int length = (len - pos > BLOCK_SIZE) ? BLOCK_SIZE : len - pos;
+    size_t length = (len - pos > BLOCK_SIZE) ? BLOCK_SIZE : len - pos;
     tiger_hash(0, s+pos, length, digest);
   } else {    
     if(pos+block_size/2 >=len){
@@ -827,9 +827,9 @@
 #include "caml/fail.h"
 #include "caml/alloc.h"
 
-int tiger_block_size(int len)
+long tiger_block_size(long len)
 {
-  int block_size = BLOCK_SIZE;
+  long block_size = BLOCK_SIZE;
   while(block_size < len) block_size *= 2;
   return block_size;
 }
Index: src/utils/lib/tiger.h
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/utils/lib/tiger.h,v
retrieving revision 1.1
diff -u -w -r1.1 tiger.h
--- src/utils/lib/tiger.h	22 Apr 2003 22:33:40 -0000	1.1
+++ src/utils/lib/tiger.h	24 Aug 2005 18:39:44 -0000
@@ -20,7 +20,6 @@
 #ifndef _TIGER_H
 #define _TIGER_H
 
-
 typedef unsigned long long int word64;
 typedef unsigned long word32;
 typedef unsigned char byte;
@@ -31,6 +30,6 @@
 #define TREE_DEPTH 10
 
 
-void tiger_hash(char prefix, char *s, int len, unsigned char *digest);
-int tiger_block_size(int len);
+void tiger_hash(char prefix, char *s, long len, unsigned char *digest);
+long tiger_block_size(long len);
 #endif
