Commit 975d2fe6 authored by Gerd Stolpmann's avatar Gerd Stolpmann

porting to OCaml-4.02. Using -safe-string

parent 55007fbe
......@@ -31,8 +31,8 @@ dtd.ml: presentation.dtd
# general rules:
OPTIONS =
OCAMLC = ocamlfind ocamlc -g $(OPTIONS) -package "$(REQUIRES)"
OCAMLOPT = ocamlfind ocamlopt -p $(OPTIONS) -package "$(REQUIRES)"
OCAMLC = ocamlfind ocamlc -g -safe-string $(OPTIONS) -package "$(REQUIRES)"
OCAMLOPT = ocamlfind ocamlopt -p -safe-string $(OPTIONS) -package "$(REQUIRES)"
OCAMLDEP = ocamldep $(OPTIONS)
OCAMLFIND = ocamlfind
......
......@@ -31,7 +31,7 @@ let escape_html s =
| _ -> assert false)
s
in
Netconversion.recode_string
Netconversion.convert
~in_enc:`Enc_utf8
~out_enc:`Enc_usascii
~subst:(fun k -> "&#" ^ string_of_int k ^ ";")
......@@ -252,7 +252,7 @@ class store remove_this_url_prefix : store_type =
method url s =
let p = String.length remove_url_prefix in
let l = String.length s in
if p < l & String.sub s 0 p = remove_url_prefix then
if p < l && String.sub s 0 p = remove_url_prefix then
String.sub s p (l-p)
else
s
......
......@@ -49,7 +49,7 @@ let escape_latex ?(tt = false) s =
| _ -> "\\symbol{" ^ string_of_int(Char.code s.[0]) ^ "}")
s'
in
Netconversion.recode_string
Netconversion.convert
~in_enc:`Enc_utf8
~out_enc:`Enc_usascii
~subst:(fun k ->
......@@ -323,13 +323,13 @@ let escape_quotes s =
let latexref s =
let u = String.create (String.length s * 2) in
let u = Bytes.create (String.length s * 2) in
for k = 0 to String.length s - 1 do
let hex = Printf.sprintf "%02x" (Char.code s.[k]) in
u.[k*2] <- hex.[0];
u.[k*2+1] <- hex.[1];
Bytes.set u (k*2) hex.[0];
Bytes.set u (k*2+1) hex.[1];
done;
u
Bytes.to_string u
;;
......@@ -908,7 +908,7 @@ class a =
inherit shared
method to_latex ~lang idx =
let langref =
let _langref =
match self # node # optional_string_attribute "langref" with
| None -> lang
| Some l -> (`Lang l)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment