MLDonkey Forum Index
Homepage •  Bugs •  Tasks •  Patches •  SF.net Project Page •  ChangeLog •  German forum •  Links •  Wiki •  Downloads
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Patch for compile on Slackware 14.2 with OCaml 4.03

 
Post new topic   Reply to topic    MLDonkey Forum Index -> Problems with MLDonkey Client (in general, and ed2k, kad, overnet)
View previous topic :: View next topic  
Author Message
xxj
neophyte


Joined: 17 Oct 2016
Posts: 4

PostPosted: Mon Oct 17, 2016 8:17 pm    Post subject: Patch for compile on Slackware 14.2 with OCaml 4.03 Reply with quote

Hi,

I've made ugly patch that allow compile this stuff. I could resolve some warrnings .. but first I want to check if there any develper alive here, who can push my changes to the official repo Very Happy Well, are you alive ?

Code:
diff -ur mldonkey-3.1.5/src/config/unix/os_stubs_c.c mldonkey-3.1.5.old/src/config/unix/os_stubs_c.c
--- mldonkey-3.1.5/src/config/unix/os_stubs_c.c   2010-07-16 15:56:35.000000000 +0200
+++ mldonkey-3.1.5.old/src/config/unix/os_stubs_c.c   2016-10-17 18:27:20.997915718 +0200
@@ -66,7 +66,7 @@
 
 void os_ftruncate(OS_FD fd, OFF_T len, /* bool */ int sparse)
 {
-  int64 cursize;
+  int64_t cursize;
   if(!fd) failwith("ftruncate32: file is closed");
   
   cursize = os_getfdsize(fd);
@@ -109,7 +109,7 @@
 
 *******************************************************************/
 
-int64 os_getfdsize(OS_FD fd)
+int64_t os_getfdsize(OS_FD fd)
 {
   struct stat buf;
 
@@ -127,7 +127,7 @@
 
 *******************************************************************/
 
-int64 os_getfilesize(char *path)
+int64_t os_getfilesize(char *path)
 {
   struct stat buf;
 
diff -ur mldonkey-3.1.5/src/networks/donkey/donkeyGlobals.ml mldonkey-3.1.5.old/src/networks/donkey/donkeyGlobals.ml
--- mldonkey-3.1.5/src/networks/donkey/donkeyGlobals.ml   2011-10-25 19:33:21.000000000 +0200
+++ mldonkey-3.1.5.old/src/networks/donkey/donkeyGlobals.ml   2016-10-17 18:44:42.179442809 +0200
@@ -781,14 +781,14 @@
       c.client_md4 <md4>
-        if c.client_name = name then raise (ClientFound c)
+        if c.client_name = name then raise (ClientFound2 c)
     ) clients_by_kind;
     raise Not_found
-  with ClientFound c -> c
+  with ClientFound2 c -> c
 
 let local_mem_stats level buf =
   let client_counter = ref 0 in
diff -ur mldonkey-3.1.5/src/utils/cdk/zip.ml mldonkey-3.1.5.old/src/utils/cdk/zip.ml
--- mldonkey-3.1.5/src/utils/cdk/zip.ml   2007-02-06 23:26:59.000000000 +0100
+++ mldonkey-3.1.5.old/src/utils/cdk/zip.ml   2016-10-17 18:23:24.787569271 +0200
@@ -72,7 +72,7 @@
     mutable of_entries: entry list;
     of_comment: string }
 
-exception Error of string * string * string
+(* exception Error of string * string * string *)
 
 (* Return the position of the last occurrence of s1 in s2, or -1 if not
    found. *)
diff -ur mldonkey-3.1.5/src/utils/cdk/zlibstubs.c mldonkey-3.1.5.old/src/utils/cdk/zlibstubs.c
--- mldonkey-3.1.5/src/utils/cdk/zlibstubs.c   2009-02-24 19:34:31.000000000 +0100
+++ mldonkey-3.1.5.old/src/utils/cdk/zlibstubs.c   2016-10-17 18:25:33.177757579 +0200
@@ -191,7 +191,7 @@
 
 value camlzip_update_crc32(value crc, value buf, value pos, value len)
 {
-  return copy_int32(crc32((uint32) Int32_val(crc),
+  return copy_int32(crc32((uint32_t) Int32_val(crc),
                           &Byte_u(buf, Long_val(pos)),
                           Long_val(len)));
 }
diff -ur mldonkey-3.1.5/src/utils/lib/fst_hash.c mldonkey-3.1.5.old/src/utils/lib/fst_hash.c
--- mldonkey-3.1.5/src/utils/lib/fst_hash.c   2005-12-10 20:44:28.000000000 +0100
+++ mldonkey-3.1.5.old/src/utils/lib/fst_hash.c   2016-10-17 18:31:21.748268825 +0200
@@ -197,7 +197,7 @@
 /*****************************************************************************/
 
 // hash file
-int fst_hash_file (unsigned char *fth, char *file, int64 filesize)
+int fst_hash_file (unsigned char *fth, char *file, int64_t filesize)
 {
   FILE *fp;
   unsigned char *buf;
@@ -271,7 +271,7 @@
 }
 
 
-void fst_hash_string (unsigned char *fth, unsigned char *file, int64 filesize)
+void fst_hash_string (unsigned char *fth, unsigned char *file, int64_t filesize)
 {
   unsigned char * buf = file;
   size_t len = filesize;
diff -ur mldonkey-3.1.5/src/utils/lib/options.ml4 mldonkey-3.1.5.old/src/utils/lib/options.ml4
--- mldonkey-3.1.5/src/utils/lib/options.ml4   2013-07-07 12:56:43.000000000 +0200
+++ mldonkey-3.1.5.old/src/utils/lib/options.ml4   2016-10-17 19:06:44.741382598 +0200
@@ -330,45 +330,6 @@
 
 let exit_exn = Exit
 
-
-let unsafe_get = String.unsafe_get
-external is_printable : char -> bool = "caml_is_printable"
-let unsafe_set = String.unsafe_set

-let escaped s =
-  let n = ref 0 in
-  for i = 0 to String.length s - 1 do
-    n :=
-      !n +
-        (match unsafe_get s i with
-           '"' | '\\' -> 2
-         | '\n' | '\t' -> 1
-         | c -> if is_printable c then 1 else 4)
-  done;
-  if !n = String.length s then s
-  else
-    let s' = String.create !n in
-    n := 0;
-    for i = 0 to String.length s - 1 do
-      begin match unsafe_get s i with
-        '"' | '\\' as c -> unsafe_set s' !n '\\'; incr n; unsafe_set s' !n c
-      | '\n' | '\t' as c -> unsafe_set s' !n c
-      | c ->
-          if is_printable c then unsafe_set s' !n c
-          else
-            let a = int_of_char c in
-            unsafe_set s' !n '\\';
-            incr n;
-            unsafe_set s' !n (char_of_int (48 + a / 100));
-            incr n;
-            unsafe_set s' !n (char_of_int (48 + a / 10 mod 10));
-            incr n;
-            unsafe_set s' !n (char_of_int (48 + a mod 10))
-      end;
-      incr n
-    done;
-    s'
-   
 let safe_string s =
   if s = "" then "\"\""
   else
@@ -388,7 +349,7 @@
             s
           else raise exit_exn
     with
-      _ -> Printf.sprintf "\"%s\"" (escaped s)
+      _ -> Printf.sprintf "\"%s\"" (String.escaped s)
 
 let with_help = ref false
 let save_private = ref false
diff -ur mldonkey-3.1.5/src/utils/lib/os_stubs.h mldonkey-3.1.5.old/src/utils/lib/os_stubs.h
--- mldonkey-3.1.5/src/utils/lib/os_stubs.h   2010-08-01 16:05:29.000000000 +0200
+++ mldonkey-3.1.5.old/src/utils/lib/os_stubs.h   2016-10-17 18:26:35.957849658 +0200
@@ -155,8 +155,8 @@
 extern void os_ftruncate(OS_FD fd, OFF_T len, int sparse);
 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);
+extern int64_t os_getfdsize(OS_FD fd);
+extern int64_t os_getfilesize(char *path);
 extern void os_set_nonblock(OS_SOCKET fd);
 extern void os_uname(char buf[]);
 extern int os_os_supported();
diff -ur mldonkey-3.1.5/src/utils/net/terminal.ml mldonkey-3.1.5.old/src/utils/net/terminal.ml
--- mldonkey-3.1.5/src/utils/net/terminal.ml   2005-11-19 18:19:45.000000000 +0100
+++ mldonkey-3.1.5.old/src/utils/net/terminal.ml   2016-10-17 18:41:20.769147403 +0200
@@ -185,7 +185,7 @@
   let canal = List.assoc chan !chanmap in
   etat.chan <Some> (* pas encore de recepteur pour ce canal *)
   try (* on en cree un *)
     let serveur = nsrecord.get_loc chan in


Last edited by xxj on Wed Nov 16, 2016 10:33 am; edited 1 time in total
Back to top
View user's profile Send private message
ygrek
professional


Joined: 20 Mar 2010
Posts: 610

PostPosted: Mon Nov 07, 2016 7:11 am    Post subject: Reply with quote

afaics all of these are fixed in git
_________________
Download | Report bugs | git mirror
Back to top
View user's profile Send private message Visit poster's website
xxj
neophyte


Joined: 17 Oct 2016
Posts: 4

PostPosted: Wed Nov 16, 2016 10:40 am    Post subject: Reply with quote

ygrek wrote:
afaics all of these are fixed in git


Right. I found git repo after I made all this fixes ( including learn OCaml a little Wink
There is not much info about GIT. CVS is mentioned few times on the site.
Please "stick" some thread on this formum about moving development to GIT.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MLDonkey Forum Index -> Problems with MLDonkey Client (in general, and ed2k, kad, overnet) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Sourceforge.net Logo