aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2014-11-22 14:23:22 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2014-11-22 14:23:22 +0100
commit84116d49db9d485e468e6902df801c7be8ed2ffe (patch)
tree941621ef4c0e86860d634907a269bc1d5cc005d0 /tools
parentcf646d855395a9d0c40613098debbbd895c4eef8 (diff)
downloadcompcert-kvx-84116d49db9d485e468e6902df801c7be8ed2ffe.tar.gz
compcert-kvx-84116d49db9d485e468e6902df801c7be8ed2ffe.zip
Use String.map instead of reimplementing it ourselves.
Avoids warnings with 4.02.
Diffstat (limited to 'tools')
-rw-r--r--tools/ndfun.ml23
1 files changed, 18 insertions, 5 deletions
diff --git a/tools/ndfun.ml b/tools/ndfun.ml
index 78fb03d5..4ee07e54 100644
--- a/tools/ndfun.ml
+++ b/tools/ndfun.ml
@@ -1,3 +1,20 @@
+(* *********************************************************************)
+(* *)
+(* The Compcert verified compiler *)
+(* *)
+(* Xavier Leroy, INRIA Paris-Rocquencourt *)
+(* *)
+(* Copyright Institut National de Recherche en Informatique et en *)
+(* Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the GNU General Public License as published by *)
+(* the Free Software Foundation, either version 2 of the License, or *)
+(* (at your option) any later version. This file is also distributed *)
+(* under the terms of the INRIA Non-Commercial License Agreement. *)
+(* *)
+(* *********************************************************************)
+
+(* Preprocessor for .vp files *)
+
open Printf
(* Error reporting *)
@@ -9,11 +26,7 @@ let error file line msg =
(* Replace newlines with spaces *)
let oneline s =
- let t = String.create (String.length s) in
- for i = 0 to String.length s - 1 do
- t.[i] <- (match s.[i] with '\n' -> ' ' | c -> c)
- done;
- t
+ String.map (function '\n' -> ' ' | c -> c) s
(* Trim leading and terminating spaces, and compress multiple spaces *)