summaryrefslogtreecommitdiff
path: root/devel/omake/files/patch-src_libmojave-external_cutil_lm__printf.c
blob: 429c61f21ff8f56f1ba788f0d0cc620539fba4ed (plain) (blame)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
$NetBSD: patch-al,v 1.1 2010/12/17 09:40:14 wiz Exp $

From upstream SVN.

--- src/libmojave-external/cutil/lm_printf.c.orig	2009-02-06 16:41:21.000000000 +0000
+++ src/libmojave-external/cutil/lm_printf.c
@@ -61,12 +61,12 @@ value ml_print_char(value v_fmt, value v
     char c = (char) Int_val(v_char);
 #ifdef HAVE_SNPRINTF
     if(snprintf(buffer, sizeof(buffer), fmt, c) < 0)
-        failwith("ml_print_char");
+        caml_failwith("ml_print_char");
 #else
     if(sprintf(buffer, fmt, c) < 0)
-        failwith("ml_print_char");
+        caml_failwith("ml_print_char");
 #endif
-    return copy_string(buffer);
+    return caml_copy_string(buffer);
 }
 
 /*
@@ -79,12 +79,12 @@ value ml_print_int(value v_fmt, value v_
     int i = Int_val(v_int);
 #ifdef HAVE_SNPRINTF
     if(snprintf(buffer, sizeof(buffer), fmt, i) < 0)
-        failwith("ml_print_int");
+        caml_failwith("ml_print_int");
 #else
     if(sprintf(buffer, fmt, i) < 0)
-        failwith("ml_print_int");
+        caml_failwith("ml_print_int");
 #endif
-    return copy_string(buffer);
+    return caml_copy_string(buffer);
 }
 
 
@@ -98,12 +98,12 @@ value ml_print_float(value v_fmt, value 
     double x = Double_val(v_float);
 #ifdef HAVE_SNPRINTF
     if(snprintf(buffer, sizeof(buffer), fmt, x) < 0)
-        failwith("ml_print_float");
+        caml_failwith("ml_print_float");
 #else
     if(sprintf(buffer, fmt, x) < 0)
-        failwith("ml_print_float");
+        caml_failwith("ml_print_float");
 #endif
-    return copy_string(buffer);
+    return caml_copy_string(buffer);
 }
 
 /*
@@ -132,7 +132,7 @@ value ml_print_string(value v_fmt, value
         size = len * 2;
         bufp = malloc(size);
         if(bufp == 0)
-            failwith("ml_print_string");
+            caml_failwith("ml_print_string");
     }
 
 #ifdef HAVE_SNPRINTF
@@ -143,9 +143,9 @@ value ml_print_string(value v_fmt, value
     if(code < 0) {
         if(bufp != buffer)
             free(bufp);
-        failwith("ml_print_string");
+        caml_failwith("ml_print_string");
     }
-    v_result = copy_string(bufp);
+    v_result = caml_copy_string(bufp);
     if(bufp != buffer)
         free(bufp);
     return v_result;
@@ -180,7 +180,7 @@ value ml_print_string2(value v_width, va
         size = len * 2;
         bufp = malloc(size);
         if(bufp == 0)
-            failwith("ml_print_string");
+            caml_failwith("ml_print_string");
     }
 
 #ifdef HAVE_SNPRINTF
@@ -191,9 +191,9 @@ value ml_print_string2(value v_width, va
     if(code < 0) {
         if(bufp != buffer)
             free(bufp);
-        failwith("ml_print_string");
+        caml_failwith("ml_print_string");
     }
-    v_result = copy_string(bufp);
+    v_result = caml_copy_string(bufp);
     if(bufp != buffer)
         free(bufp);
     return v_result;