~ubuntu-branches/ubuntu/oneiric/haxe/oneiric

« back to all changes in this revision

Viewing changes to ocaml/extlib-dev/IO.ml

  • Committer: Bazaar Package Importer
  • Author(s): Jens Peter Secher
  • Date: 2008-06-15 11:04:09 UTC
  • mfrom: (2.1.6 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080615110409-7pyykgwmk5v0cues
Tags: 1:1.19-3
* Remove bashism in script.
  (Closes: #484390)
* Upgrade to Policy 3.8.0 by including a README.source explaining how to
  use dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
        if p + l' > sl || p < 0 || l' < 0 then invalid_arg "IO.really_output";
84
84
        let l = ref l' in
85
85
        let p = ref p in
86
 
        while !l > 0 do 
 
86
        while !l > 0 do
87
87
                let w = o.out_output s !p !l in
88
88
                if w = 0 then raise Sys_blocked_io;
89
89
                p := !p + w;
116
116
        if n < 0 then invalid_arg "IO.really_nread";
117
117
        if n = 0 then ""
118
118
        else
119
 
        let s = String.create n 
 
119
        let s = String.create n
120
120
        in
121
121
        ignore(really_input i s 0 n);
122
122
        s
485
485
        write_byte ch (n lsr 8)
486
486
 
487
487
let write_i16 ch n =
488
 
        if n < -0x7FFF || n > 0x7FFF then raise (Overflow "write_i16");
 
488
        if n < -0x8000 || n > 0x7FFF then raise (Overflow "write_i16");
489
489
        if n < 0 then
490
490
                write_ui16 ch (65536 + n)
491
491
        else
571
571
        write_byte ch n
572
572
 
573
573
let write_i16 ch n =
574
 
        if n < -0x7FFF || n > 0x7FFF then raise (Overflow "write_i16");
 
574
        if n < -0x8000 || n > 0x7FFF then raise (Overflow "write_i16");
575
575
        if n < 0 then
576
576
                write_ui16 ch (65536 + n)
577
577
        else
644
644
                        b.bits <- k;
645
645
                        b.nbits <- c;
646
646
                        d
647
 
                end else begin                  
 
647
                end else begin
648
648
                        b.bits <- (b.bits lsl 8) lor k;
649
649
                        b.nbits <- b.nbits + 8;
650
650
                        read_bits b n;