File: Fix-build-with-OCaml-4.06.patch

package info (click to toggle)
plplot 5.15.0%2Bdfsg2-19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,484 kB
  • sloc: ansic: 79,703; xml: 28,583; cpp: 20,033; ada: 19,456; tcl: 12,081; f90: 11,431; ml: 7,276; java: 6,863; python: 6,792; sh: 3,274; perl: 828; lisp: 75; makefile: 74; sed: 34; fortran: 6
file content (31 lines) | stat: -rw-r--r-- 1,065 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: Orion Poplawski <orion@nwra.com>
Date: Mon, 20 Nov 2017 09:02:01 -0700
Subject: Fix build with OCaml 4.06

Fedora patch to fix build with OCaml 4.0.6.
---
 examples/ocaml/x20.ml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/ocaml/x20.ml b/examples/ocaml/x20.ml
index ff7e447..047229a 100644
--- a/examples/ocaml/x20.ml
+++ b/examples/ocaml/x20.ml
@@ -59,7 +59,7 @@ let read_img fname =
   let w, h = Scanf.sscanf w_h_line "%d %d" (fun w h -> w, h) in
   let num_col = Scanf.sscanf num_col_line "%d" (fun n -> n) in
 
-  let img = String.make (w * h) ' ' in
+  let img = Bytes.make (w * h) ' ' in
   let imf = Array.make_matrix w h 0.0 in
 
   (* Note that under 32bit OCaml, this will only work when reading strings up
@@ -72,7 +72,7 @@ let read_img fname =
     for j = 0 to h - 1 do
       imf.(i).(j) <-
         (* flip image up-down *)
-        float_of_int (int_of_char (img.[(h - 1 - j ) * w + i]));
+        float_of_int (int_of_char (Bytes.get img ((h - 1 - j ) * w + i)));
     done
   done;
   imf, w, h, num_col