Commit 736c7a82 authored by gerd's avatar gerd

fix for newer ocaml


git-svn-id: https://godirepo.camlcity.org/svn/app-wtimer/trunk@19 f6fe576d-e0d0-0310-b8e7-f4ac0f1a5269
parent c7cc5b05
......@@ -140,10 +140,10 @@ module Time = struct
if n = String.length s then
(hr,mi)
else
if s.[n-1] = ':' then
if s.[n] = ':' then
(hr,mi) (* ignore rest after ':' *)
else
failwith "too many characters"
failwith ("too many characters: " ^ s)
)
in
create { hour = hr; minute = mi }
......@@ -194,21 +194,21 @@ module Interval = struct
if n = String.length s then
(hr,mi)
else
if s.[n-1] = ':' then
if s.[n] = ':' then
(hr,mi) (* ignore rest after ':' *)
else
failwith "too many characters"
failwith ("too many characters: " ^ s)
)
in
let mi' = if hr < 0 then -mi else mi in
create { delta_hours = hr; delta_minutes = mi' }
with
Scanf.Scan_failure msg ->
failwith ("Db.Time.from_string: Scan failure: " ^ msg)
failwith ("Db.Interval.from_string: Scan failure: " ^ msg)
| Failure msg ->
failwith ("Db.Time.from_string: " ^ msg)
failwith ("Db.Interval.from_string: " ^ msg)
| End_of_file ->
failwith ("Db.Time.from_string: too few characters")
failwith ("Db.Interval.from_string: too few characters")
let cmp iv1 iv2 =
if iv1.delta_hours <> iv2.delta_hours then
......
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