summaryrefslogtreecommitdiff
path: root/patches/mpfr/3.1.2/140-printf-alt0.patch
blob: 2451f36027e056d7826891131c3f8d70bd5cc866 (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
diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
--- mpfr-3.1.2-a/PATCHES	2013-11-15 00:51:49.211333830 +0000
+++ mpfr-3.1.2-b/PATCHES	2013-11-15 00:51:49.323334999 +0000
@@ -0,0 +1 @@
+printf-alt0
diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
--- mpfr-3.1.2-a/VERSION	2013-11-15 00:51:49.211333830 +0000
+++ mpfr-3.1.2-b/VERSION	2013-11-15 00:51:49.323334999 +0000
@@ -1 +1 @@
-3.1.2-p3
+3.1.2-p4
diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
--- mpfr-3.1.2-a/src/mpfr.h	2013-11-15 00:51:49.211333830 +0000
+++ mpfr-3.1.2-b/src/mpfr.h	2013-11-15 00:51:49.323334999 +0000
@@ -27,7 +27,7 @@
 #define MPFR_VERSION_MAJOR 3
 #define MPFR_VERSION_MINOR 1
 #define MPFR_VERSION_PATCHLEVEL 2
-#define MPFR_VERSION_STRING "3.1.2-p3"
+#define MPFR_VERSION_STRING "3.1.2-p4"
 
 /* Macros dealing with MPFR VERSION */
 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
diff -Naurd mpfr-3.1.2-a/src/vasprintf.c mpfr-3.1.2-b/src/vasprintf.c
--- mpfr-3.1.2-a/src/vasprintf.c	2013-03-13 15:37:37.000000000 +0000
+++ mpfr-3.1.2-b/src/vasprintf.c	2013-11-15 00:51:49.267334408 +0000
@@ -1040,7 +1040,7 @@
 }
 
 /* Determine the different parts of the string representation of the regular
-   number P when SPEC.SPEC is 'e', 'E', 'g', or 'G'.
+   number P when spec.spec is 'e', 'E', 'g', or 'G'.
    DEC_INFO contains the previously computed exponent and string or is NULL.
 
    return -1 if some field > INT_MAX */
@@ -1167,7 +1167,7 @@
 }
 
 /* Determine the different parts of the string representation of the regular
-   number P when SPEC.SPEC is 'f', 'F', 'g', or 'G'.
+   number P when spec.spec is 'f', 'F', 'g', or 'G'.
    DEC_INFO contains the previously computed exponent and string or is NULL.
 
    return -1 if some field of number_parts is greater than INT_MAX */
@@ -1559,7 +1559,7 @@
             /* fractional part */
             {
               np->point = MPFR_DECIMAL_POINT;
-              np->fp_trailing_zeros = (spec.spec == 'g' && spec.spec == 'G') ?
+              np->fp_trailing_zeros = (spec.spec == 'g' || spec.spec == 'G') ?
                 spec.prec - 1 : spec.prec;
             }
           else if (spec.alt)
diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
--- mpfr-3.1.2-a/src/version.c	2013-11-15 00:51:49.211333830 +0000
+++ mpfr-3.1.2-b/src/version.c	2013-11-15 00:51:49.323334999 +0000
@@ -25,5 +25,5 @@
 const char *
 mpfr_get_version (void)
 {
-  return "3.1.2-p3";
+  return "3.1.2-p4";
 }
diff -Naurd mpfr-3.1.2-a/tests/tsprintf.c mpfr-3.1.2-b/tests/tsprintf.c
--- mpfr-3.1.2-a/tests/tsprintf.c	2013-03-13 15:37:44.000000000 +0000
+++ mpfr-3.1.2-b/tests/tsprintf.c	2013-11-15 00:51:49.267334408 +0000
@@ -456,10 +456,16 @@
   check_sprintf ("1.999900  ", "%-#10.7RG", x);
   check_sprintf ("1.9999    ", "%-10.7RG", x);
   mpfr_set_ui (x, 1, MPFR_RNDN);
+  check_sprintf ("1.", "%#.1Rg", x);
+  check_sprintf ("1.   ", "%-#5.1Rg", x);
+  check_sprintf ("  1.0", "%#5.2Rg", x);
   check_sprintf ("1.00000000000000000000000000000", "%#.30Rg", x);
   check_sprintf ("1", "%.30Rg", x);
   mpfr_set_ui (x, 0, MPFR_RNDN);
-  check_sprintf ("0.000000000000000000000000000000", "%#.30Rg", x);
+  check_sprintf ("0.", "%#.1Rg", x);
+  check_sprintf ("0.   ", "%-#5.1Rg", x);
+  check_sprintf ("  0.0", "%#5.2Rg", x);
+  check_sprintf ("0.00000000000000000000000000000", "%#.30Rg", x);
   check_sprintf ("0", "%.30Rg", x);
 
   /* following tests with precision 53 bits */