File: 0005-Fix-compilation-with-OCaml-4.08.0.patch

package info (click to toggle)
ocaml-gnuplot 0.8.3-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 440 kB
  • sloc: ml: 2,148; makefile: 185
file content (38 lines) | stat: -rw-r--r-- 1,377 bytes parent folder | download | duplicates (2)
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
32
33
34
35
36
37
38
From: Stephane Glondu <steph@glondu.net>
Date: Wed, 4 Sep 2019 14:14:27 +0200
Subject: Fix compilation with OCaml 4.08.0

---
 gnuplot_common_.ml | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/gnuplot_common_.ml b/gnuplot_common_.ml
index af9a672..5d5e2f3 100644
--- a/gnuplot_common_.ml
+++ b/gnuplot_common_.ml
@@ -115,9 +115,9 @@ let ouput_texts gp q =
    REMARK: the linetype "-2" has the color of the background. *)
 let show_or_hide_plot_queue s_of_q plot gp q=
   if Queue.is_empty q.plots then force_show gp else begin
-    let cmd = s_of_q plot q in
-    cmd.[String.length cmd - 1] <- '\n';
-    output_string gp cmd;
+    let cmd = Bytes.of_string (s_of_q plot q) in
+    cmd.[Bytes.length cmd - 1] <- '\n';
+    output_bytes gp cmd;
     (* Inline data *)
     Queue.iter (function
                 | (_, _, _, _, Inlined d) -> output_string gp d
@@ -156,9 +156,10 @@ let show_plots_all_tags =
       force_show gp (* FIXME: does not work if ranges are not set
                        (see update_show) *)
     else begin
-      cmd.[String.length cmd - 1] <- '\n';
+      let cmd = Bytes.of_string cmd in
+      cmd.[Bytes.length cmd - 1] <- '\n';
       output_string gp plot;
-      output_string gp cmd;
+      output_bytes gp cmd;
       (* Inline data *)
       Tags.iter (fun _ q ->
                    Queue.iter (function