summaryrefslogtreecommitdiffstats
path: root/34.patch
blob: d883be81f89df518a0e12e445c6d3388ce156a7b (plain)
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
From e71f1488b666e30e4f0121a10fee3eeab22bd327 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Tue, 4 Feb 2020 08:23:05 +0100
Subject: [PATCH 1/3] fix harcoded path in test

---
 tests/Number/methods/pow.phpt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/Number/methods/pow.phpt b/tests/Number/methods/pow.phpt
index 5ce6582..2c78f16 100644
--- a/tests/Number/methods/pow.phpt
+++ b/tests/Number/methods/pow.phpt
@@ -87,7 +87,7 @@ Number Object
 )
 Number::pow
 
-Warning: Decimal arithmetic operand truncated to integer in /Users/rtheunissen/dev/decimal/ext-decimal/tests/Number/helpers/Number.php on line 63
+Warning: Decimal arithmetic operand truncated to integer in %sNumber.php on line 63
 Number Object
 (
     [value:protected] => Decimal\Rational Object
@@ -99,7 +99,7 @@ Number Object
 )
 Number::pow
 
-Warning: Decimal arithmetic operand truncated to integer in /Users/rtheunissen/dev/decimal/ext-decimal/tests/Number/helpers/Number.php on line 63
+Warning: Decimal arithmetic operand truncated to integer in %sNumber.php on line 63
 Number Object
 (
     [value:protected] => Decimal\Rational Object
@@ -123,7 +123,7 @@ Decimal\Decimal Object
 )
 Number::toRational
 
-Warning: Decimal arithmetic operand truncated to integer in /Users/rtheunissen/dev/decimal/ext-decimal/tests/Number/methods/pow.php on line 38
+Warning: Decimal arithmetic operand truncated to integer in %spow.php on line 38
 Decimal\Rational Object
 (
     [num] => 16
@@ -131,7 +131,7 @@ Decimal\Rational Object
 )
 Number::toRational
 
-Warning: Decimal arithmetic operand truncated to integer in /Users/rtheunissen/dev/decimal/ext-decimal/tests/Number/methods/pow.php on line 41
+Warning: Decimal arithmetic operand truncated to integer in %spow.php on line 41
 Decimal\Rational Object
 (
     [num] => 16

From d983b8f76f59996339a434c40d1f57703fadbd42 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Tue, 4 Feb 2020 08:25:35 +0100
Subject: [PATCH 3/3] fix #33 remomve unused function

---
 src/convert.c | 15 +--------------
 src/convert.h |  2 --
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/src/convert.c b/src/convert.c
index 4136a35..77581e3 100644
--- a/src/convert.c
+++ b/src/convert.c
@@ -444,19 +444,6 @@ zend_string *php_decimal_rational_to_sci(const php_rational_t *obj, zend_long pr
     return str;
 }
 
-zend_string *php_decimal_rational_to_eng(const php_rational_t *obj, zend_long prec)
-{
-    zend_string *str;
-
-    PHP_DECIMAL_TEMP_MPD(tmp);
-    php_decimal_rational_evaluate(&tmp, obj, prec);
-
-    str = php_decimal_mpd_to_eng(&tmp);
-    mpd_del(&tmp);
-
-    return str;
-}
-
 zend_string *php_decimal_rational_to_fixed(const php_rational_t *obj, zend_long places, zend_bool commas, php_decimal_rounding_t mode)
 {
     PHP_DECIMAL_TEMP_MPD(tmp);
@@ -597,4 +584,4 @@ void php_decimal_number_to_num_den(mpd_t *num, mpd_t *den, const zval *obj)
 
     assert(status == 0);
     zval_ptr_dtor(&result);
-}
\ No newline at end of file
+}
diff --git a/src/convert.h b/src/convert.h
index cb5e031..a3924e3 100644
--- a/src/convert.h
+++ b/src/convert.h
@@ -56,7 +56,6 @@ php_decimal_success_t php_decimal_mpd_set_string(mpd_t *mpd, const zend_string *
 php_decimal_success_t php_decimal_mpd_set_charptr(mpd_t *mpd, const char *str);
 
 zend_string *php_decimal_mpd_to_serialized(const mpd_t *mpd);
-zend_string *php_decimal_mpd_to_eng(const mpd_t *mpd);
 zend_string *php_decimal_mpd_to_sci(const mpd_t *mpd);
 zend_string *php_decimal_mpd_to_string(const mpd_t *mpd);
 zend_string *php_decimal_mpd_to_fixed(const mpd_t *mpd, zend_long places, zend_bool commas, php_decimal_rounding_t mode);
@@ -69,7 +68,6 @@ void      php_decimal_rational_set_nan(php_rational_t *obj);
 void      php_decimal_rational_set_zero(php_rational_t *obj);
 
 zend_string *php_decimal_rational_to_sci(const php_rational_t *obj, zend_long prec);
-zend_string *php_decimal_rational_to_eng(const php_rational_t *obj, zend_long prec);
 zend_string *php_decimal_rational_to_string(const php_rational_t *obj);
 zend_string *php_decimal_rational_to_fixed(const php_rational_t *obj, zend_long places, zend_bool commas, php_decimal_rounding_t mode);
 zend_long    php_decimal_rational_to_long(const php_rational_t *obj);