diff -Nru ocaml-num-1.3/Changelog ocaml-num-1.4/Changelog --- ocaml-num-1.3/Changelog 2019-11-20 08:24:08.000000000 +0000 +++ ocaml-num-1.4/Changelog 2020-11-09 16:22:09.000000000 +0000 @@ -1,3 +1,8 @@ +Release 1.4 (2020-11-09) + +- Pull request #20: fix bug caused by unsafe string/bytes conversions, + and remove all uses of `Bytes.unsafe_of_string` + Release 1.3 (2019-11-20) - Pull request #16: use Sys.word_size and Sys.int_size more consistently diff -Nru ocaml-num-1.3/debian/changelog ocaml-num-1.4/debian/changelog --- ocaml-num-1.3/debian/changelog 2020-11-02 13:08:58.000000000 +0000 +++ ocaml-num-1.4/debian/changelog 2020-11-24 09:35:39.000000000 +0000 @@ -1,8 +1,10 @@ -ocaml-num (1.3-1build1) hirsute; urgency=medium +ocaml-num (1.4-1) unstable; urgency=medium - * No-change rebuild for ocaml abi changes. + * New upstream release + * Bump debhelper compat level to 13 + * Bump Standards-Version to 4.5.1 - -- Matthias Klose Mon, 02 Nov 2020 14:08:58 +0100 + -- Stéphane Glondu Tue, 24 Nov 2020 10:35:39 +0100 ocaml-num (1.3-1) unstable; urgency=medium diff -Nru ocaml-num-1.3/debian/control ocaml-num-1.4/debian/control --- ocaml-num-1.3/debian/control 2019-12-02 10:29:25.000000000 +0000 +++ ocaml-num-1.4/debian/control 2020-11-24 09:35:39.000000000 +0000 @@ -4,12 +4,12 @@ Uploaders: Stéphane Glondu Build-Depends: - debhelper-compat (= 12), + debhelper-compat (= 13), dh-ocaml, ocaml-nox (>= 4.08), ocaml-findlib Rules-Requires-Root: no -Standards-Version: 4.4.1 +Standards-Version: 4.5.1 Section: ocaml Homepage: https://github.com/ocaml/num Vcs-Git: https://salsa.debian.org/ocaml-team/ocaml-num.git diff -Nru ocaml-num-1.3/debian/rules ocaml-num-1.4/debian/rules --- ocaml-num-1.3/debian/rules 2019-12-02 10:29:25.000000000 +0000 +++ ocaml-num-1.4/debian/rules 2020-11-24 09:35:39.000000000 +0000 @@ -8,8 +8,3 @@ %: dh $@ --with ocaml - -override_dh_missing: - dh_missing --fail-missing - -override_dh_dwz: diff -Nru ocaml-num-1.3/num.opam ocaml-num-1.4/num.opam --- ocaml-num-1.3/num.opam 2019-11-20 08:24:08.000000000 +0000 +++ ocaml-num-1.4/num.opam 2020-11-09 16:22:09.000000000 +0000 @@ -1,5 +1,5 @@ opam-version: "2.0" -version: "1.3" +version: "1.4" maintainer: "Xavier Leroy " authors: [ "Valérie Ménissier-Morain" diff -Nru ocaml-num-1.3/src/big_int.ml ocaml-num-1.4/src/big_int.ml --- ocaml-num-1.3/src/big_int.ml 2019-11-20 08:24:08.000000000 +0000 +++ ocaml-num-1.4/src/big_int.ml 2020-11-09 16:22:09.000000000 +0000 @@ -674,7 +674,7 @@ (big_int_of_string "963295986")) (big_int_of_string "100000000")))) in let s = - Bytes.unsafe_of_string + Bytes.of_string (string_of_big_int (div_big_int bi (power_int_positive_int 10 n))) in let (sign, off) = diff -Nru ocaml-num-1.3/src/ratio.ml ocaml-num-1.4/src/ratio.ml --- ocaml-num-1.3/src/ratio.ml 2019-11-20 08:24:08.000000000 +0000 +++ ocaml-num-1.4/src/ratio.ml 2020-11-09 16:22:09.000000000 +0000 @@ -438,13 +438,13 @@ (base_power_big_int 10 (succ n) (abs_big_int r.numerator)) r.denominator)) in + let s1 = Bytes.of_string s1 in (* Round up and add 1 in front if needed *) let s2 = - if round_futur_last_digit (Bytes.unsafe_of_string s1) 0 - (String.length s1) - then "1" ^ s1 + if round_futur_last_digit s1 0 (Bytes.length s1) + then Bytes.cat (Bytes.of_string "1") s1 else s1 in - let l2 = String.length s2 - 1 in + let l2 = Bytes.length s2 - 1 in (* if s2 without last digit is xxxxyyy with n 'yyy' digits: xxxx . yyy if s2 without last digit is yy with <= n digits: @@ -452,15 +452,15 @@ if l2 > n then begin let s = Bytes.make (l2 + 2) '0' in Bytes.set s 0 (if sign_r = -1 then '-' else '+'); - String.blit s2 0 s 1 (l2 - n); + Bytes.blit s2 0 s 1 (l2 - n); Bytes.set s (l2 - n + 1) '.'; - String.blit s2 (l2 - n) s (l2 - n + 2) n; + Bytes.blit s2 (l2 - n) s (l2 - n + 2) n; Bytes.unsafe_to_string s end else begin let s = Bytes.make (n + 3) '0' in Bytes.set s 0 (if sign_r = -1 then '-' else '+'); Bytes.set s 2 '.'; - String.blit s2 0 s (n + 3 - l2) l2; + Bytes.blit s2 0 s (n + 3 - l2) l2; Bytes.unsafe_to_string s end end else begin @@ -508,8 +508,8 @@ 10 k (abs_big_int r.numerator)) r.denominator) in string_of_nat nat) in - if round_futur_last_digit (Bytes.unsafe_of_string s) 0 - (String.length s) + let s = Bytes.of_string s in + if round_futur_last_digit s 0 (Bytes.length s) then let m = num_decimal_digits_int (succ msd) in let str = Bytes.make (n + m + 4) '0' in @@ -525,7 +525,7 @@ and p = n + 3 in let str = Bytes.make (succ (m + p)) '0' in (String.blit (if sign_r = -1 then "-0." else "+0.") 0 str 0 3); - (String.blit s 0 str 3 n); + (Bytes.blit s 0 str 3 n); Bytes.set str p 'e'; (if m = 0 then Bytes.set str (succ p) '0'