/[mldonkey]/mldonkey/src/networks/opennap/opennapProtocol.ml
ViewVC logotype

Diff of /mldonkey/src/networks/opennap/opennapProtocol.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by spiralvoice, Tue Sep 6 11:25:00 2005 UTC revision 1.4 by spiralvoice, Sun Oct 16 20:42:54 2005 UTC
# Line 103  let get_int8 s pos = Line 103  let get_int8 s pos =
103  let get_int16 s pos =  let get_int16 s pos =
104    let c1 = int_of_char s.[pos] in    let c1 = int_of_char s.[pos] in
105    let c2 = int_of_char s.[pos+1] in    let c2 = int_of_char s.[pos+1] in
106    c1 + c2 * 256    c1 lor (c2 lsl 8)
107    
108  let buf_int8 buf i =  let buf_int8 buf i =
109    Buffer.add_char buf (char_of_int (i land 255))    Buffer.add_char buf (char_of_int (i land 0xff))
110        
111  let buf_int16 buf i =  let buf_int16 buf i =
112    let i = i land 65535 in    let i = i land 0xffff in
113    Buffer.add_char buf (char_of_int (i mod 256));    Buffer.add_char buf (char_of_int (i land 0xff));
114    Buffer.add_char buf (char_of_int (i / 256))    Buffer.add_char buf (char_of_int (i lsr 8))
115        
116  let dump s =  let dump s =
117    let len = String.length s in    let len = String.length s in

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26