[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Mldonkey-commits] Changes to mldonkey/src/daemon/common/commonMultimedi
From: |
mldonkey-commits |
Subject: |
[Mldonkey-commits] Changes to mldonkey/src/daemon/common/commonMultimedia.ml |
Date: |
Sun, 16 Oct 2005 16:42:59 -0400 |
Index: mldonkey/src/daemon/common/commonMultimedia.ml
diff -u mldonkey/src/daemon/common/commonMultimedia.ml:1.9
mldonkey/src/daemon/common/commonMultimedia.ml:1.10
--- mldonkey/src/daemon/common/commonMultimedia.ml:1.9 Fri Jul 22 10:58:55 2005
+++ mldonkey/src/daemon/common/commonMultimedia.ml Sun Oct 16 20:42:50 2005
@@ -17,6 +17,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)
+open Int64ops
open Printf2
open CommonTypes
@@ -26,21 +27,19 @@
let input_int16 ic =
let i0 = input_int8 ic in
let i1 = input_int8 ic in
- i0 + 256 * i1
+ i0 lor (i1 lsl 8)
-let int32_65536 = Int64.of_int 65536
-
let input_int32 ic =
let i0 = input_int16 ic in
let i1 = input_int16 ic in
let i0 = Int64.of_int i0 in
let i1 = Int64.of_int i1 in
- Int64.add i0 (Int64.mul i1 int32_65536)
+ or64 i0 (left64 i1 16)
let input_int ic =
let i0 = input_int16 ic in
let i1 = input_int16 ic in
- i0 + i1 * 65536
+ i0 lor (i1 lsl 16)
let input_string4 ic =
let s = String.create 4 in
@@ -52,7 +51,7 @@
for i = 0 to 3 do
let c = s.[i] in
let int = int_of_char c in
- if int > 31 && int <127 then
+ if int > 31 && int < 127 then
lprint_char c
else lprintf "[%d]" int
done;
@@ -563,12 +562,12 @@
print_int32 "dwHeight" dwHeight;
*)
- seek_in ic ((Int64.to_int pos) + main_header_len +20);
+ seek_in ic ((Int64.to_int pos) + main_header_len + 20);
let s = input_string4 ic in
(* lprint_string4 "LIST:" s; *)
- let pos_in = Int64.add pos (Int64.of_int (
- main_header_len +24)) in
- let last_pos = Int64.add pos_in size2 in
+ let pos_in =
+ pos ++ Int64.of_int (main_header_len + 24) in
+ let last_pos = pos_in ++ size2 in
iter_list pos_in last_pos
@@ -579,9 +578,9 @@
| "strl" ->
(* lprintf "STREAM DESCRIPTION\n"; *)
- let offset = Int64.of_int 4 in
- let pos0 = Int64.add pos offset in
- let end_pos0 = Int64.add pos size2 in
+ let offset = 4L in
+ let pos0 = pos ++ offset in
+ let end_pos0 = pos ++ size2 in
iter_list pos0 end_pos0
| "strh" ->
@@ -639,12 +638,12 @@
| _ -> ()
end;
- iter_list (Int64.add pos (Int64.add size2 (Int64.of_int 8))) end_pos
+ iter_list (pos ++ size2 ++ 8L) end_pos
end
in
- let pos0 = Int64.of_int 16 in
- iter_list pos0 (Int64.add pos0 size);
+ let pos0 = 16L in
+ iter_list pos0 (pos0 ++ size);
(* lprintf "DONE\n"; *)
()
with
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Mldonkey-commits] Changes to mldonkey/src/daemon/common/commonMultimedia.ml,
mldonkey-commits <=