diff options
author | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2016-03-21 10:18:51 +0100 |
---|---|---|
committer | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2016-03-21 10:18:51 +0100 |
commit | 20eef936dce1ef98b5b422c90cc9e072fb0d75ab (patch) | |
tree | 2690be164dc36fad63fc0f42e943d0fcb0735532 /lib/Printlines.ml | |
parent | fdf4cac2439a7168bd005efbde4a1f76a00ada66 (diff) | |
parent | 01e32a075023ce7b037d42d048b1904ba3d9a82b (diff) | |
download | compcert-20eef936dce1ef98b5b422c90cc9e072fb0d75ab.tar.gz compcert-20eef936dce1ef98b5b422c90cc9e072fb0d75ab.zip |
Merge pull request #92 from AbsInt/cleanup
This PR activates more OCaml warnings and turns all warnings into errors. Also some unused functions, variables and types are removed.
Diffstat (limited to 'lib/Printlines.ml')
-rw-r--r-- | lib/Printlines.ml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Printlines.ml b/lib/Printlines.ml index e0805f15..453096bc 100644 --- a/lib/Printlines.ml +++ b/lib/Printlines.ml @@ -48,7 +48,7 @@ let forward b dest = (* Position [b] to the beginning of line [dest], which must be less than the current line. *) -let backward_buf = lazy (String.create 65536) +let backward_buf = lazy (Bytes.create 65536) (* 65536 to match [IO_BUFFER_SIZE] in the OCaml runtime. lazy to allocate on demand. *) @@ -65,13 +65,13 @@ let backward b dest = seek_in b.chan 0; b.lineno <- 1 end else begin - let pos' = max 0 (pos - String.length buf) in + let pos' = max 0 (pos - Bytes.length buf) in let len = pos - pos' in seek_in b.chan pos'; really_input b.chan buf 0 len; backward pos' (pos - pos') end - end else if buf.[idx-1] = '\n' then begin + end else if Bytes.get buf (idx-1) = '\n' then begin (* Reached beginning of current line *) if b.lineno = dest then begin (* Found line number dest *) |