Skip to content

Commit

Permalink
another fixes for 4.03
Browse files Browse the repository at this point in the history
  • Loading branch information
ygrek committed Jan 23, 2017
1 parent 30e77e2 commit c0b8ff3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
31 changes: 13 additions & 18 deletions src/networks/donkey/donkeyOvernet.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1446,25 +1446,20 @@ let compute_to_ping () =

(* start max three searches for sources *)
let start_max_source_searches () =
let current_files2 = ref [] in
while (List.length !overnet_searches) < 3 && !current_files <> [] do
match !current_files with
| [] -> assert false
| (file, start, last) :: tl ->
current_files := tl;
if file_state file = FileDownloading && (last + 900) < last_time () then
begin
let current_files2 = ref [] in
(try
while (List.length !overnet_searches) < 3 && !current_files <> [] do
let (file, start, last) = List.hd !current_files in
current_files := List.tl !current_files;
if file_state file = FileDownloading &&
(last + 900) < last_time () then begin
ignore (create_search (FileSearch file) file.file_md4);
current_files2 := (file, start, last_time ()) :: !current_files2;
end else
current_files2 := (file, start, last) :: !current_files2;
done;
with Failure "hd" -> ()
| Failure "tl" -> (); );
List.iter (fun (file, start, last) ->
current_files := (file, start, last) :: !current_files
) !current_files2;
end
ignore (create_search (FileSearch file) file.file_md4);
current_files2 := (file, start, last_time ()) :: !current_files2;
end else
current_files2 := (file, start, last) :: !current_files2;
done;
List.iter (fun (file, start, last) -> current_files := (file, start, last) :: !current_files) !current_files2

let enable () =
if !!enable_overnet && not !is_enabled then begin
Expand Down
3 changes: 2 additions & 1 deletion src/utils/cdk/gdstubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

#include <caml/mlvalues.h>
#include <caml/custom.h>
Expand Down Expand Up @@ -489,7 +490,7 @@ int ml_image_pngversion(void)
CAMLlocal1 (v);
#ifdef HAVE_PNGVERSION
#include <png.h>
v = copy_int32 ((int32)png_access_version_number());
v = copy_int32 ((int32_t)png_access_version_number());
CAMLreturn (v);
#else
raise_constant(*(value *)caml_named_value("gd type not supported"));
Expand Down

0 comments on commit c0b8ff3

Please sign in to comment.