1 |
commit: b47c3a358310c904284bc6fd8d6bdc87114093f9 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Feb 9 17:56:54 2017 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Feb 9 17:58:04 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b47c3a35 |
7 |
|
8 |
dev-libs/mpfr: version bump to 3.1.5_p2 #608770 |
9 |
|
10 |
dev-libs/mpfr/files/3.1.5/patch01 | 82 +++++++++++++++++++ |
11 |
dev-libs/mpfr/files/3.1.5/patch02 | 92 ++++++++++++++++++++++ |
12 |
.../{mpfr-3.1.5.ebuild => mpfr-3.1.5_p2.ebuild} | 0 |
13 |
3 files changed, 174 insertions(+) |
14 |
|
15 |
diff --git a/dev-libs/mpfr/files/3.1.5/patch01 b/dev-libs/mpfr/files/3.1.5/patch01 |
16 |
new file mode 100644 |
17 |
index 0000000000..e1576d5976 |
18 |
--- /dev/null |
19 |
+++ b/dev-libs/mpfr/files/3.1.5/patch01 |
20 |
@@ -0,0 +1,82 @@ |
21 |
+diff -Naurd mpfr-3.1.5-a/PATCHES mpfr-3.1.5-b/PATCHES |
22 |
+--- mpfr-3.1.5-a/PATCHES 2016-12-15 08:35:46.476430238 +0000 |
23 |
++++ mpfr-3.1.5-b/PATCHES 2016-12-15 08:35:46.544430346 +0000 |
24 |
+@@ -0,0 +1 @@ |
25 |
++vasprintf |
26 |
+diff -Naurd mpfr-3.1.5-a/VERSION mpfr-3.1.5-b/VERSION |
27 |
+--- mpfr-3.1.5-a/VERSION 2016-09-27 07:58:14.000000000 +0000 |
28 |
++++ mpfr-3.1.5-b/VERSION 2016-12-15 08:35:46.544430346 +0000 |
29 |
+@@ -1 +1 @@ |
30 |
+-3.1.5 |
31 |
++3.1.5-p1 |
32 |
+diff -Naurd mpfr-3.1.5-a/src/mpfr.h mpfr-3.1.5-b/src/mpfr.h |
33 |
+--- mpfr-3.1.5-a/src/mpfr.h 2016-09-27 07:58:15.000000000 +0000 |
34 |
++++ mpfr-3.1.5-b/src/mpfr.h 2016-12-15 08:35:46.540430340 +0000 |
35 |
+@@ -27,7 +27,7 @@ |
36 |
+ #define MPFR_VERSION_MAJOR 3 |
37 |
+ #define MPFR_VERSION_MINOR 1 |
38 |
+ #define MPFR_VERSION_PATCHLEVEL 5 |
39 |
+-#define MPFR_VERSION_STRING "3.1.5" |
40 |
++#define MPFR_VERSION_STRING "3.1.5-p1" |
41 |
+ |
42 |
+ /* Macros dealing with MPFR VERSION */ |
43 |
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c)) |
44 |
+diff -Naurd mpfr-3.1.5-a/src/vasprintf.c mpfr-3.1.5-b/src/vasprintf.c |
45 |
+--- mpfr-3.1.5-a/src/vasprintf.c 2016-09-27 07:58:15.000000000 +0000 |
46 |
++++ mpfr-3.1.5-b/src/vasprintf.c 2016-12-15 08:35:46.520430308 +0000 |
47 |
+@@ -1593,7 +1593,7 @@ |
48 |
+ } |
49 |
+ else if (spec.spec == 'f' || spec.spec == 'F') |
50 |
+ { |
51 |
+- if (spec.prec == -1) |
52 |
++ if (spec.prec < 0) |
53 |
+ spec.prec = 6; |
54 |
+ if (regular_fg (np, p, spec, NULL) == -1) |
55 |
+ goto error; |
56 |
+diff -Naurd mpfr-3.1.5-a/src/version.c mpfr-3.1.5-b/src/version.c |
57 |
+--- mpfr-3.1.5-a/src/version.c 2016-09-27 07:58:15.000000000 +0000 |
58 |
++++ mpfr-3.1.5-b/src/version.c 2016-12-15 08:35:46.544430346 +0000 |
59 |
+@@ -25,5 +25,5 @@ |
60 |
+ const char * |
61 |
+ mpfr_get_version (void) |
62 |
+ { |
63 |
+- return "3.1.5"; |
64 |
++ return "3.1.5-p1"; |
65 |
+ } |
66 |
+diff -Naurd mpfr-3.1.5-a/tests/tsprintf.c mpfr-3.1.5-b/tests/tsprintf.c |
67 |
+--- mpfr-3.1.5-a/tests/tsprintf.c 2016-09-27 07:58:14.000000000 +0000 |
68 |
++++ mpfr-3.1.5-b/tests/tsprintf.c 2016-12-15 08:35:46.520430308 +0000 |
69 |
+@@ -1251,6 +1251,25 @@ |
70 |
+ check_emin_aux (MPFR_EMIN_MIN); |
71 |
+ } |
72 |
+ |
73 |
++static void |
74 |
++test20161214 (void) |
75 |
++{ |
76 |
++ mpfr_t x; |
77 |
++ char buf[32]; |
78 |
++ const char s[] = "0x0.fffffffffffff8p+1024"; |
79 |
++ int r; |
80 |
++ |
81 |
++ mpfr_init2 (x, 64); |
82 |
++ mpfr_set_str (x, s, 16, MPFR_RNDN); |
83 |
++ r = mpfr_snprintf (buf, 32, "%.*RDf", -2, x); |
84 |
++ MPFR_ASSERTN(r == 316); |
85 |
++ r = mpfr_snprintf (buf, 32, "%.*RDf", INT_MIN + 1, x); |
86 |
++ MPFR_ASSERTN(r == 316); |
87 |
++ r = mpfr_snprintf (buf, 32, "%.*RDf", INT_MIN, x); |
88 |
++ MPFR_ASSERTN(r == 316); |
89 |
++ mpfr_clear (x); |
90 |
++} |
91 |
++ |
92 |
+ int |
93 |
+ main (int argc, char **argv) |
94 |
+ { |
95 |
+@@ -1271,6 +1290,7 @@ |
96 |
+ mixed (); |
97 |
+ check_emax (); |
98 |
+ check_emin (); |
99 |
++ test20161214 (); |
100 |
+ |
101 |
+ #if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE) |
102 |
+ #if MPFR_LCONV_DPTS |
103 |
|
104 |
diff --git a/dev-libs/mpfr/files/3.1.5/patch02 b/dev-libs/mpfr/files/3.1.5/patch02 |
105 |
new file mode 100644 |
106 |
index 0000000000..01878bf1b0 |
107 |
--- /dev/null |
108 |
+++ b/dev-libs/mpfr/files/3.1.5/patch02 |
109 |
@@ -0,0 +1,92 @@ |
110 |
+diff -Naurd mpfr-3.1.5-a/PATCHES mpfr-3.1.5-b/PATCHES |
111 |
+--- mpfr-3.1.5-a/PATCHES 2016-12-19 22:11:17.022676737 +0000 |
112 |
++++ mpfr-3.1.5-b/PATCHES 2016-12-19 22:11:17.094676820 +0000 |
113 |
+@@ -0,0 +1 @@ |
114 |
++strtofr |
115 |
+diff -Naurd mpfr-3.1.5-a/VERSION mpfr-3.1.5-b/VERSION |
116 |
+--- mpfr-3.1.5-a/VERSION 2016-12-15 08:35:46.544430346 +0000 |
117 |
++++ mpfr-3.1.5-b/VERSION 2016-12-19 22:11:17.094676820 +0000 |
118 |
+@@ -1 +1 @@ |
119 |
+-3.1.5-p1 |
120 |
++3.1.5-p2 |
121 |
+diff -Naurd mpfr-3.1.5-a/src/mpfr.h mpfr-3.1.5-b/src/mpfr.h |
122 |
+--- mpfr-3.1.5-a/src/mpfr.h 2016-12-15 08:35:46.540430340 +0000 |
123 |
++++ mpfr-3.1.5-b/src/mpfr.h 2016-12-19 22:11:17.090676815 +0000 |
124 |
+@@ -27,7 +27,7 @@ |
125 |
+ #define MPFR_VERSION_MAJOR 3 |
126 |
+ #define MPFR_VERSION_MINOR 1 |
127 |
+ #define MPFR_VERSION_PATCHLEVEL 5 |
128 |
+-#define MPFR_VERSION_STRING "3.1.5-p1" |
129 |
++#define MPFR_VERSION_STRING "3.1.5-p2" |
130 |
+ |
131 |
+ /* Macros dealing with MPFR VERSION */ |
132 |
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c)) |
133 |
+diff -Naurd mpfr-3.1.5-a/src/strtofr.c mpfr-3.1.5-b/src/strtofr.c |
134 |
+--- mpfr-3.1.5-a/src/strtofr.c 2016-09-27 07:58:15.000000000 +0000 |
135 |
++++ mpfr-3.1.5-b/src/strtofr.c 2016-12-19 22:11:17.066676788 +0000 |
136 |
+@@ -743,11 +743,14 @@ |
137 |
+ of the pstr_size most significant digits of pstr->mant, with |
138 |
+ equality in case exact is non-zero. */ |
139 |
+ |
140 |
+- /* test if rounding is possible, and if so exit the loop */ |
141 |
+- if (exact || mpfr_can_round_raw (result, ysize, |
142 |
+- (pstr->negative) ? -1 : 1, |
143 |
+- ysize_bits - err - 1, |
144 |
+- MPFR_RNDN, rnd, MPFR_PREC(x))) |
145 |
++ /* test if rounding is possible, and if so exit the loop. |
146 |
++ Note: we also need to be able to determine the correct ternary value, |
147 |
++ thus we use the MPFR_PREC(x) + (rnd == MPFR_RNDN) trick. |
148 |
++ For example if result = xxx...xxx111...111 and rnd = RNDN, |
149 |
++ then we know the correct rounding is xxx...xx(x+1), but we cannot know |
150 |
++ the correct ternary value. */ |
151 |
++ if (exact || mpfr_round_p (result, ysize, ysize_bits - err - 1, |
152 |
++ MPFR_PREC(x) + (rnd == MPFR_RNDN))) |
153 |
+ break; |
154 |
+ |
155 |
+ next_loop: |
156 |
+diff -Naurd mpfr-3.1.5-a/src/version.c mpfr-3.1.5-b/src/version.c |
157 |
+--- mpfr-3.1.5-a/src/version.c 2016-12-15 08:35:46.544430346 +0000 |
158 |
++++ mpfr-3.1.5-b/src/version.c 2016-12-19 22:11:17.094676820 +0000 |
159 |
+@@ -25,5 +25,5 @@ |
160 |
+ const char * |
161 |
+ mpfr_get_version (void) |
162 |
+ { |
163 |
+- return "3.1.5-p1"; |
164 |
++ return "3.1.5-p2"; |
165 |
+ } |
166 |
+diff -Naurd mpfr-3.1.5-a/tests/tstrtofr.c mpfr-3.1.5-b/tests/tstrtofr.c |
167 |
+--- mpfr-3.1.5-a/tests/tstrtofr.c 2016-09-27 07:58:14.000000000 +0000 |
168 |
++++ mpfr-3.1.5-b/tests/tstrtofr.c 2016-12-19 22:11:17.066676788 +0000 |
169 |
+@@ -1191,6 +1191,24 @@ |
170 |
+ mpfr_clears (e, x1, x2, (mpfr_ptr) 0); |
171 |
+ } |
172 |
+ |
173 |
++/* Note: the number is 5^47/2^9. */ |
174 |
++static void |
175 |
++bug20161217 (void) |
176 |
++{ |
177 |
++ mpfr_t fp, z; |
178 |
++ static const char * num = "0.1387778780781445675529539585113525390625e31"; |
179 |
++ int inex; |
180 |
++ |
181 |
++ mpfr_init2 (fp, 110); |
182 |
++ mpfr_init2 (z, 110); |
183 |
++ inex = mpfr_strtofr (fp, num, NULL, 10, MPFR_RNDN); |
184 |
++ MPFR_ASSERTN(inex == 0); |
185 |
++ mpfr_set_str_binary (z, "10001100001000010011110110011101101001010000001011011110010001010100010100100110111101000010001011001100001101E-9"); |
186 |
++ MPFR_ASSERTN(mpfr_equal_p (fp, z)); |
187 |
++ mpfr_clear (fp); |
188 |
++ mpfr_clear (z); |
189 |
++} |
190 |
++ |
191 |
+ int |
192 |
+ main (int argc, char *argv[]) |
193 |
+ { |
194 |
+@@ -1205,6 +1223,7 @@ |
195 |
+ test20100310 (); |
196 |
+ bug20120814 (); |
197 |
+ bug20120829 (); |
198 |
++ bug20161217 (); |
199 |
+ |
200 |
+ tests_end_mpfr (); |
201 |
+ return 0; |
202 |
|
203 |
diff --git a/dev-libs/mpfr/mpfr-3.1.5.ebuild b/dev-libs/mpfr/mpfr-3.1.5_p2.ebuild |
204 |
similarity index 100% |
205 |
rename from dev-libs/mpfr/mpfr-3.1.5.ebuild |
206 |
rename to dev-libs/mpfr/mpfr-3.1.5_p2.ebuild |