OBS User unknown 2009-03-17 15:32:52 +00:00 committed by Git OBS Bridge
parent ca7f68c34b
commit 982e153654
6 changed files with 307 additions and 543 deletions

View File

@ -1,535 +0,0 @@
diff -Naurd mpfr-2.4.0-a/PATCHES mpfr-2.4.0-b/PATCHES
--- mpfr-2.4.0-a/PATCHES 2009-01-26 12:52:01.000000000 +0000
+++ mpfr-2.4.0-b/PATCHES 2009-02-20 17:27:44.000000000 +0000
@@ -0,0 +1 @@
+printf-hh-ll
diff -Naurd mpfr-2.4.0-a/VERSION mpfr-2.4.0-b/VERSION
--- mpfr-2.4.0-a/VERSION 2009-01-26 12:52:01.000000000 +0000
+++ mpfr-2.4.0-b/VERSION 2009-02-20 17:27:44.000000000 +0000
@@ -1 +1 @@
-2.4.0
+2.4.0-p1
diff -Naurd mpfr-2.4.0-a/acinclude.m4 mpfr-2.4.0-b/acinclude.m4
--- mpfr-2.4.0-a/acinclude.m4 2009-01-26 12:52:01.000000000 +0000
+++ mpfr-2.4.0-b/acinclude.m4 2009-01-26 12:52:01.000000000 +0000
@@ -722,6 +722,16 @@
[AC_DEFINE([NPRINTF_J], 1, [gmp_printf cannot read intmax_t])])
fi
+MPFR_FUNC_PRINTF_SPEC([%hhd], [char], [
+#include <gmp.h>
+ ], [gmp_],,
+ [AC_DEFINE([NPRINTF_HH], 1, [gmp_printf cannot use 'hh' length modifier])])
+
+MPFR_FUNC_PRINTF_SPEC([%lld], [long long int], [
+#include <gmp.h>
+ ], [gmp_],,
+ [AC_DEFINE([NPRINTF_LL], 1, [gmp_printf cannot read long long int])])
+
MPFR_FUNC_PRINTF_SPEC([%.0Lf], [long double], [
#include <gmp.h>
], [gmp_],,
diff -Naurd mpfr-2.4.0-a/configure mpfr-2.4.0-b/configure
--- mpfr-2.4.0-a/configure 2009-01-26 12:54:36.000000000 +0000
+++ mpfr-2.4.0-b/configure 2009-02-20 17:38:36.000000000 +0000
@@ -24874,6 +24874,170 @@
fi
+{ $as_echo "$as_me:$LINENO: checking if gmp_printf supports \"%hhd\"" >&5
+$as_echo_n "checking if gmp_printf supports \"%hhd\"... " >&6; }
+if test "$cross_compiling" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <stdio.h>
+
+#include <gmp.h>
+
+
+int
+main ()
+{
+
+ char s[256];
+ char a = 0;
+ return (gmp_sprintf (s, "%hhd", a) != 1) ? 1 : 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define NPRINTF_HH 1
+_ACEOF
+
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking if gmp_printf supports \"%lld\"" >&5
+$as_echo_n "checking if gmp_printf supports \"%lld\"... " >&6; }
+if test "$cross_compiling" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <stdio.h>
+
+#include <gmp.h>
+
+
+int
+main ()
+{
+
+ char s[256];
+ long long int a = 0;
+ return (gmp_sprintf (s, "%lld", a) != 1) ? 1 : 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define NPRINTF_LL 1
+_ACEOF
+
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+
+
{ $as_echo "$as_me:$LINENO: checking if gmp_printf supports \"%.0Lf\"" >&5
$as_echo_n "checking if gmp_printf supports \"%.0Lf\"... " >&6; }
if test "$cross_compiling" = yes; then
diff -Naurd mpfr-2.4.0-a/mpfr.h mpfr-2.4.0-b/mpfr.h
--- mpfr-2.4.0-a/mpfr.h 2009-01-26 12:52:01.000000000 +0000
+++ mpfr-2.4.0-b/mpfr.h 2009-02-20 17:27:44.000000000 +0000
@@ -27,7 +27,7 @@
#define MPFR_VERSION_MAJOR 2
#define MPFR_VERSION_MINOR 4
#define MPFR_VERSION_PATCHLEVEL 0
-#define MPFR_VERSION_STRING "2.4.0"
+#define MPFR_VERSION_STRING "2.4.0-p1"
/* Macros dealing with MPFR VERSION */
#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
diff -Naurd mpfr-2.4.0-a/tests/tfprintf.c mpfr-2.4.0-b/tests/tfprintf.c
--- mpfr-2.4.0-a/tests/tfprintf.c 2009-01-26 12:52:00.000000000 +0000
+++ mpfr-2.4.0-b/tests/tfprintf.c 2009-02-20 16:31:02.000000000 +0000
@@ -146,6 +146,7 @@
short sh = -1;
unsigned short ush = 1;
int i = -1;
+ int j = 1;
unsigned int ui = 1;
long lo = -1;
unsigned long ulo = 1;
@@ -179,12 +180,11 @@
limb[0] = limb[1] = limb[2] = ~ (mp_limb_t) 0;
- check_vfprintf (fout, "a. %Ra, b. %hhu, c. %u, d. %lx%hhn", mpfr, uch, ui,
- ulo, &uch);
- check_length (1, uch, 28, hhu);
- check_vfprintf (fout, "a. %hhi, b. %Rb, c. %u, d. %li%ln", sch, mpfr, i,
+ check_vfprintf (fout, "a. %Ra, b. %u, c. %lx%n", mpfr, ui, ulo, &j);
+ check_length (1, j, 22, d);
+ check_vfprintf (fout, "a. %c, b. %Rb, c. %u, d. %li%ln", i, mpfr, i,
lo, &ulo);
- check_length (2, ulo, 37, lu);
+ check_length (2, ulo, 36, lu);
check_vfprintf (fout, "a. %hi, b. %*f, c. %Re%hn", ush, 3, f, mpfr, &ush);
check_length (3, ush, 29, hu);
check_vfprintf (fout, "a. %hi, b. %f, c. %#.2Rf%n", sh, d, mpfr, &i);
@@ -208,13 +208,18 @@
check_length (9, sz, 30, zu);
#endif
+#ifndef NPRINTF_HH
+ check_vfprintf (fout, "a. %hhi, b.%RA, c. %hhu%hhn", sch, mpfr, uch, &uch);
+ check_length (10, uch, 21, hhu);
+#endif
+
#if (__GNU_MP_VERSION * 10 + __GNU_MP_VERSION_MINOR) >= 42
/* The 'M' specifier was added in gmp 4.2.0 */
check_vfprintf (fout, "a. %Mx b. %Re%Mn", limb[0], mpfr, &limb[0]);
if (limb[0] != 14 + BITS_PER_MP_LIMB / 4 || limb[1] != ~ (mp_limb_t) 0
|| limb[2] != ~ (mp_limb_t) 0)
{
- printf ("Error in test #10: mpfr_vfprintf did not print %d characters"
+ printf ("Error in test #11: mpfr_vfprintf did not print %d characters"
" as expected\n", 14 + (int) BITS_PER_MP_LIMB / 4);
exit (1);
}
@@ -227,13 +232,13 @@
if (limb[0] != 14 + 3 * BITS_PER_MP_LIMB / 4 || limb[1] != (mp_limb_t) 0
|| limb[2] != ~ (mp_limb_t) 0)
{
- printf ("Error in test #11: mpfr_vfprintf did not print %d characters"
+ printf ("Error in test #12: mpfr_vfprintf did not print %d characters"
" as expected\n", 14 + (int) BITS_PER_MP_LIMB / 4);
exit (1);
}
#endif
-#ifdef HAVE_LONG_LONG
+#if defined(HAVE_LONG_LONG) && !defined(NPRINTF_LL)
{
long long llo = -1;
unsigned long long ullo = 1;
diff -Naurd mpfr-2.4.0-a/tests/tprintf.c mpfr-2.4.0-b/tests/tprintf.c
--- mpfr-2.4.0-a/tests/tprintf.c 2009-01-26 12:52:00.000000000 +0000
+++ mpfr-2.4.0-b/tests/tprintf.c 2009-02-20 16:31:02.000000000 +0000
@@ -150,6 +150,7 @@
short sh = -1;
unsigned short ush = 1;
int i = -1;
+ int j = 1;
unsigned int ui = 1;
long lo = -1;
unsigned long ulo = 1;
@@ -178,11 +179,10 @@
mpfr_set_f (mpfr, mpf, GMP_RNDN);
prec = mpfr_get_prec (mpfr);
- check_vprintf ("a. %Ra, b. %hhu, c. %u, d. %lx%hhn", mpfr, uch, ui, ulo,
- &uch);
- check_length (1, uch, 28, hhu);
- check_vprintf ("a. %hhi, b. %Rb, c. %u, d. %li%ln", sch, mpfr, i, lo, &ulo);
- check_length (2, ulo, 37, lu);
+ check_vprintf ("a. %Ra, b. %u, c. %lx%n", mpfr, ui, ulo, &j);
+ check_length (1, j, 22, d);
+ check_vprintf ("a. %c, b. %Rb, c. %u, d. %li%ln", i, mpfr, i, lo, &ulo);
+ check_length (2, ulo, 36, lu);
check_vprintf ("a. %hi, b. %*f, c. %Re%hn", ush, 3, f, mpfr, &ush);
check_length (3, ush, 29, hu);
check_vprintf ("a. %hi, b. %f, c. %#.2Rf%n", sh, d, mpfr, &i);
@@ -204,7 +204,12 @@
check_length (9, sz, 30, zu);
#endif
-#ifdef HAVE_LONG_LONG
+#ifndef NPRINTF_HH
+ check_vprintf ("a. %hhi, b. %Ra, c. %hhu%hhn", sch, mpfr, uch, &uch);
+ check_length (10, uch, 22, hhu);
+#endif
+
+#if defined(HAVE_LONG_LONG) && !defined(NPRINTF_LL)
{
long long llo = -1;
unsigned long long ullo = 1;
diff -Naurd mpfr-2.4.0-a/vasprintf.c mpfr-2.4.0-b/vasprintf.c
--- mpfr-2.4.0-a/vasprintf.c 2009-01-26 12:52:01.000000000 +0000
+++ mpfr-2.4.0-b/vasprintf.c 2009-02-20 16:31:02.000000000 +0000
@@ -235,10 +235,14 @@
break;
case 'h':
if (*++format == 'h')
+#ifndef NPRINTF_HH
{
++format;
specinfo->arg_type = CHAR_ARG;
}
+#else
+ specinfo->arg_type = UNSUPPORTED;
+#endif
else
specinfo->arg_type = SHORT_ARG;
break;
@@ -246,7 +250,7 @@
if (*++format == 'l')
{
++format;
-#ifdef HAVE_LONG_LONG
+#if defined (HAVE_LONG_LONG) && !defined(NPRINTF_LL)
specinfo->arg_type = LONG_LONG_ARG;
#else
specinfo->arg_type = UNSUPPORTED;
diff -Naurd mpfr-2.4.0-a/version.c mpfr-2.4.0-b/version.c
--- mpfr-2.4.0-a/version.c 2009-01-26 12:52:01.000000000 +0000
+++ mpfr-2.4.0-b/version.c 2009-02-20 17:27:44.000000000 +0000
@@ -25,5 +25,5 @@
const char *
mpfr_get_version (void)
{
- return "2.4.0";
+ return "2.4.0-p1";
}
diff -Naurd mpfr-2.4.0-a/PATCHES mpfr-2.4.0-b/PATCHES
--- mpfr-2.4.0-a/PATCHES 2009-02-25 13:27:38.000000000 +0000
+++ mpfr-2.4.0-b/PATCHES 2009-02-25 13:42:26.000000000 +0000
@@ -0,0 +1 @@
+mpfr_snprintf
diff -Naurd mpfr-2.4.0-a/VERSION mpfr-2.4.0-b/VERSION
--- mpfr-2.4.0-a/VERSION 2009-02-20 17:27:44.000000000 +0000
+++ mpfr-2.4.0-b/VERSION 2009-02-25 13:41:31.000000000 +0000
@@ -1 +1 @@
-2.4.0-p1
+2.4.0-p2
diff -Naurd mpfr-2.4.0-a/mpfr.h mpfr-2.4.0-b/mpfr.h
--- mpfr-2.4.0-a/mpfr.h 2009-02-20 17:27:44.000000000 +0000
+++ mpfr-2.4.0-b/mpfr.h 2009-02-25 13:41:31.000000000 +0000
@@ -27,7 +27,7 @@
#define MPFR_VERSION_MAJOR 2
#define MPFR_VERSION_MINOR 4
#define MPFR_VERSION_PATCHLEVEL 0
-#define MPFR_VERSION_STRING "2.4.0-p1"
+#define MPFR_VERSION_STRING "2.4.0-p2"
/* Macros dealing with MPFR VERSION */
#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
diff -Naurd mpfr-2.4.0-a/printf.c mpfr-2.4.0-b/printf.c
--- mpfr-2.4.0-a/printf.c 2009-01-26 12:52:01.000000000 +0000
+++ mpfr-2.4.0-b/printf.c 2009-02-25 13:41:22.000000000 +0000
@@ -154,16 +154,16 @@
int ret;
size_t min_size;
- /* C99 allows SIZE to be null */
- if (size == 0)
- return 0;
-
- MPFR_ASSERTD (buf != NULL);
-
GET_STR (ret, str, fmt);
- min_size = (size_t)ret < size ? (size_t)ret : size - 1;
- strncpy (buf, str, min_size);
- buf[min_size + 1] = '\0';
+
+ /* C99 allows SIZE to be zero */
+ if (size != 0)
+ {
+ MPFR_ASSERTN (buf != NULL);
+ min_size = (size_t)ret < size ? (size_t)ret : size - 1;
+ strncpy (buf, str, min_size);
+ buf[min_size] = '\0';
+ }
mpfr_free_str (str);
return ret;
@@ -176,16 +176,17 @@
int ret;
int min_size;
- /* C99 allows SIZE to be null */
- if (size == 0)
- return 0;
+ GET_STR_VA (ret, str, fmt, ap);
- MPFR_ASSERTD (buf != NULL);
+ /* C99 allows SIZE to be zero */
+ if (size != 0)
+ {
+ MPFR_ASSERTN (buf != NULL);
+ min_size = (size_t)ret < size ? (size_t)ret : size - 1;
+ strncpy (buf, str, min_size);
+ buf[min_size] = '\0';
+ }
- GET_STR_VA (ret, str, fmt, ap);
- min_size = (size_t)ret < size ? (size_t)ret : size - 1;
- strncpy (buf, str, min_size);
- buf[min_size + 1] = '\0';
mpfr_free_str (str);
return ret;
}
diff -Naurd mpfr-2.4.0-a/tests/tsprintf.c mpfr-2.4.0-b/tests/tsprintf.c
--- mpfr-2.4.0-a/tests/tsprintf.c 2009-01-26 12:52:00.000000000 +0000
+++ mpfr-2.4.0-b/tests/tsprintf.c 2009-02-25 13:41:22.000000000 +0000
@@ -72,21 +72,37 @@
/* test mpfr_snprintf */
p = (int) (randlimb () % n0);
- n1 = mpfr_snprintf (buffer, p, fmt, x);
- if ((p != 0 && n0 != n1) || (p == 0 && n1 != 0))
+ if (p == 0 && (randlimb () & 1) == 0)
+ {
+ n1 = mpfr_snprintf (NULL, 0, fmt, x);
+ }
+ else
+ {
+ buffer[p] = 17;
+ n1 = mpfr_snprintf (buffer, p, fmt, x);
+ if (buffer[p] != 17)
+ {
+ printf ("Buffer overflow in mpfr_snprintf for p = %d!\n", p);
+ exit (1);
+ }
+ }
+ if (n0 != n1)
{
printf ("Error in mpfr_snprintf (s, %d, \"%s\", x) return value\n",
p, fmt);
printf ("expected: %d\ngot: %d\n", n0, n1);
exit (1);
}
- if (strncmp (expected, buffer, p) != 0)
+ if ((p > 1 && strncmp (expected, buffer, p-1) != 0)
+ || (p == 1 && buffer[0] != '\0'))
{
- printf ("Error in mpfr_snprintf (s, %d, \"%s\", x);\n", p, fmt);
- printf ("expected: \"%s\"\ngot: \"%s\"\n", expected, buffer);
+ char part_expected[p];
+ strncpy (part_expected, expected, p);
+ part_expected[p-1] = '\0';
+ printf ("Error in mpfr_vsnprintf (s, %d, \"%s\", ...);\n", p, fmt);
+ printf ("expected: \"%s\"\ngot: \"%s\"\n", part_expected, buffer);
exit (1);
}
-
return n0;
}
@@ -116,8 +132,21 @@
/* test mpfr_snprintf */
p = (int) (randlimb () % n0);
- n1 = mpfr_vsnprintf (buffer, p, fmt, ap1);
- if ((p != 0 && n0 != n1) || (p == 0 && n1 != 0))
+ if (p == 0 && (randlimb () & 1) == 0)
+ {
+ n1 = mpfr_vsnprintf (NULL, 0, fmt, ap1);
+ }
+ else
+ {
+ buffer[p] = 17;
+ n1 = mpfr_vsnprintf (buffer, p, fmt, ap1);
+ if (buffer[p] != 17)
+ {
+ printf ("Buffer overflow in mpfr_vsnprintf for p = %d!\n", p);
+ exit (1);
+ }
+ }
+ if (n0 != n1)
{
printf ("Error in mpfr_vsnprintf (s, %d, \"%s\", ...) return value\n",
p, fmt);
@@ -126,10 +155,14 @@
va_end (ap1);
exit (1);
}
- if (strncmp (expected, buffer, p) != 0)
+ if ((p > 1 && strncmp (expected, buffer, p-1) != 0)
+ || (p == 1 && buffer[0] != '\0'))
{
+ char part_expected[p];
+ strncpy (part_expected, expected, p);
+ part_expected[p-1] = '\0';
printf ("Error in mpfr_vsnprintf (s, %d, \"%s\", ...);\n", p, fmt);
- printf ("expected: \"%s\"\ngot: \"%s\"\n", expected, buffer);
+ printf ("expected: \"%s\"\ngot: \"%s\"\n", part_expected, buffer);
va_end (ap1);
exit (1);
diff -Naurd mpfr-2.4.0-a/version.c mpfr-2.4.0-b/version.c
--- mpfr-2.4.0-a/version.c 2009-02-20 17:27:44.000000000 +0000
+++ mpfr-2.4.0-b/version.c 2009-02-25 13:41:31.000000000 +0000
@@ -25,5 +25,5 @@
const char *
mpfr_get_version (void)
{
- return "2.4.0-p1";
+ return "2.4.0-p2";
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:be3d51ec2bdac6efb9408cde8882a936c8f43b1fde9aac5f0ce2682745e0529d
size 1062708

285
mpfr-2.4.1.patch Normal file
View File

@ -0,0 +1,285 @@
diff -Naurd mpfr-2.4.1-a/PATCHES mpfr-2.4.1-b/PATCHES
--- mpfr-2.4.1-a/PATCHES 2009-02-20 09:43:17.000000000 +0000
+++ mpfr-2.4.1-b/PATCHES 2009-02-27 16:56:29.000000000 +0000
@@ -0,0 +1 @@
+remainder-neg
diff -Naurd mpfr-2.4.1-a/VERSION mpfr-2.4.1-b/VERSION
--- mpfr-2.4.1-a/VERSION 2009-02-25 16:16:08.000000000 +0000
+++ mpfr-2.4.1-b/VERSION 2009-02-27 16:55:37.000000000 +0000
@@ -1 +1 @@
-2.4.1
+2.4.1-p1
diff -Naurd mpfr-2.4.1-a/mpfr.h mpfr-2.4.1-b/mpfr.h
--- mpfr-2.4.1-a/mpfr.h 2009-02-25 16:16:08.000000000 +0000
+++ mpfr-2.4.1-b/mpfr.h 2009-02-27 16:55:38.000000000 +0000
@@ -27,7 +27,7 @@
#define MPFR_VERSION_MAJOR 2
#define MPFR_VERSION_MINOR 4
#define MPFR_VERSION_PATCHLEVEL 1
-#define MPFR_VERSION_STRING "2.4.1"
+#define MPFR_VERSION_STRING "2.4.1-p1"
/* Macros dealing with MPFR VERSION */
#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
diff -Naurd mpfr-2.4.1-a/rem1.c mpfr-2.4.1-b/rem1.c
--- mpfr-2.4.1-a/rem1.c 2009-02-20 09:43:17.000000000 +0000
+++ mpfr-2.4.1-b/rem1.c 2009-02-27 16:55:15.000000000 +0000
@@ -170,7 +170,12 @@
}
if (mpz_cmp_ui (r, 0) == 0)
- inex = mpfr_set_ui (rem, 0, GMP_RNDN);
+ {
+ inex = mpfr_set_ui (rem, 0, GMP_RNDN);
+ /* take into account sign of x */
+ if (signx < 0)
+ mpfr_neg (rem, rem, GMP_RNDN);
+ }
else
{
if (rnd_q == GMP_RNDN)
@@ -190,6 +195,9 @@
*quo += 1;
}
}
+ /* take into account sign of x */
+ if (signx < 0)
+ mpz_neg (r, r);
inex = mpfr_set_z (rem, r, rnd);
/* if ex > ey, rem should be multiplied by 2^ey, else by 2^ex */
MPFR_EXP (rem) += (ex > ey) ? ey : ex;
@@ -198,13 +206,6 @@
if (quo)
*quo *= sign;
- /* take into account sign of x */
- if (signx < 0)
- {
- mpfr_neg (rem, rem, GMP_RNDN);
- inex = -inex;
- }
-
mpz_clear (mx);
mpz_clear (my);
mpz_clear (r);
diff -Naurd mpfr-2.4.1-a/tests/tremquo.c mpfr-2.4.1-b/tests/tremquo.c
--- mpfr-2.4.1-a/tests/tremquo.c 2009-02-20 09:43:15.000000000 +0000
+++ mpfr-2.4.1-b/tests/tremquo.c 2009-02-27 16:55:15.000000000 +0000
@@ -25,6 +25,36 @@
#include "mpfr-test.h"
+static void
+bug20090227 (void)
+{
+ mpfr_t x, y, r1, r2;
+ int inex1, inex2;
+
+ mpfr_init2 (x, 118);
+ mpfr_init2 (y, 181);
+ mpfr_init2 (r1, 140);
+ mpfr_init2 (r2, 140);
+ mpfr_set_si (x, -1, GMP_RNDN);
+ mpfr_set_str_binary (y, "1.100100100001111110110101010001000100001011010001100001000110100110001001100011001100010100010111000000011011100000111001101000100101001000000100100111000001000100010100110011111010");
+ inex1 = mpfr_remainder (r1, x, y, GMP_RNDU);
+ /* since the quotient is -1, r1 is the rounding of x+y */
+ inex2 = mpfr_add (r2, x, y, GMP_RNDU);
+ if (mpfr_cmp (r1, r2))
+ {
+ printf ("Error in mpfr_remainder (bug20090227)\n");
+ printf ("Expected ");
+ mpfr_dump (r2);
+ printf ("Got ");
+ mpfr_dump (r1);
+ exit (1);
+ }
+ mpfr_clear (x);
+ mpfr_clear (y);
+ mpfr_clear (r1);
+ mpfr_clear (r2);
+}
+
int
main (int argc, char *argv[])
{
@@ -50,6 +80,8 @@
tests_start_mpfr ();
+ bug20090227 ();
+
mpfr_init (x);
mpfr_init (y);
mpfr_init (r);
diff -Naurd mpfr-2.4.1-a/version.c mpfr-2.4.1-b/version.c
--- mpfr-2.4.1-a/version.c 2009-02-25 16:16:08.000000000 +0000
+++ mpfr-2.4.1-b/version.c 2009-02-27 16:55:38.000000000 +0000
@@ -25,5 +25,5 @@
const char *
mpfr_get_version (void)
{
- return "2.4.1";
+ return "2.4.1-p1";
}
diff -Naurd mpfr-2.4.1-a/PATCHES mpfr-2.4.1-b/PATCHES
--- mpfr-2.4.1-a/PATCHES 2009-03-04 13:15:05.000000000 +0000
+++ mpfr-2.4.1-b/PATCHES 2009-03-04 13:17:04.000000000 +0000
@@ -0,0 +1 @@
+assert
diff -Naurd mpfr-2.4.1-a/VERSION mpfr-2.4.1-b/VERSION
--- mpfr-2.4.1-a/VERSION 2009-02-27 16:55:37.000000000 +0000
+++ mpfr-2.4.1-b/VERSION 2009-03-04 13:16:46.000000000 +0000
@@ -1 +1 @@
-2.4.1-p1
+2.4.1-p2
diff -Naurd mpfr-2.4.1-a/mpfr-gmp.c mpfr-2.4.1-b/mpfr-gmp.c
--- mpfr-2.4.1-a/mpfr-gmp.c 2009-02-20 09:43:17.000000000 +0000
+++ mpfr-2.4.1-b/mpfr-gmp.c 2009-03-04 13:16:39.000000000 +0000
@@ -301,7 +301,7 @@
if (linenum != -1)
fprintf (stderr, "%d: ", linenum);
}
- fprintf (stderr, " assertion failed: %s\n", expr);
+ fprintf (stderr, "MPFR assertion failed: %s\n", expr);
abort();
}
diff -Naurd mpfr-2.4.1-a/mpfr.h mpfr-2.4.1-b/mpfr.h
--- mpfr-2.4.1-a/mpfr.h 2009-02-27 16:55:38.000000000 +0000
+++ mpfr-2.4.1-b/mpfr.h 2009-03-04 13:16:46.000000000 +0000
@@ -27,7 +27,7 @@
#define MPFR_VERSION_MAJOR 2
#define MPFR_VERSION_MINOR 4
#define MPFR_VERSION_PATCHLEVEL 1
-#define MPFR_VERSION_STRING "2.4.1-p1"
+#define MPFR_VERSION_STRING "2.4.1-p2"
/* Macros dealing with MPFR VERSION */
#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
diff -Naurd mpfr-2.4.1-a/version.c mpfr-2.4.1-b/version.c
--- mpfr-2.4.1-a/version.c 2009-02-27 16:55:38.000000000 +0000
+++ mpfr-2.4.1-b/version.c 2009-03-04 13:16:46.000000000 +0000
@@ -25,5 +25,5 @@
const char *
mpfr_get_version (void)
{
- return "2.4.1-p1";
+ return "2.4.1-p2";
}
diff -Naurd mpfr-2.4.1-a/tests/tfprintf.c mpfr-2.4.1-b/tests/tfprintf.c
--- mpfr-2.4.1-a/tests/tfprintf.c 2009-02-20 09:43:15.000000000 +0000
+++ mpfr-2.4.1-b/tests/tfprintf.c 2009-03-10 01:12:45.000000000 +0000
@@ -195,7 +195,7 @@
check_vfprintf (fout, "a. %Pu, b. %c, c. %Zi%Zn", prec, ch, mpz, &mpz);
check_length_with_cmp (6, mpz, 17, mpz_cmp_ui (mpz, 17), Zi);
check_vfprintf (fout, "%% a. %#.0RNg, b. %Qx%Rn, c. %p", mpfr, mpq, &mpfr,
- &i);
+ (void *) &i);
check_length_with_cmp (7, mpfr, 16, mpfr_cmp_ui (mpfr, 16), Rg);
#ifndef NPRINTF_T
diff -Naurd mpfr-2.4.1-a/tests/tprintf.c mpfr-2.4.1-b/tests/tprintf.c
--- mpfr-2.4.1-a/tests/tprintf.c 2009-02-20 09:43:15.000000000 +0000
+++ mpfr-2.4.1-b/tests/tprintf.c 2009-03-10 01:12:45.000000000 +0000
@@ -191,7 +191,8 @@
check_length (5, sz, 34, zu);
check_vprintf ("a. %Pu, b. %c, c. %RUG, d. %Zi%Zn", prec, ch, mpfr, mpz, &mpz);
check_length_with_cmp (6, mpz, 24, mpz_cmp_ui (mpz, 24), Zi);
- check_vprintf ("%% a. %#.0RNg, b. %Qx%Rn c. %p", mpfr, mpq, &mpfr, &i);
+ check_vprintf ("%% a. %#.0RNg, b. %Qx%Rn c. %p",
+ mpfr, mpq, &mpfr, (void *) &i);
check_length_with_cmp (7, mpfr, 16, mpfr_cmp_ui (mpfr, 16), Rg);
#ifndef NPRINTF_T
diff -Naurd mpfr-2.4.1-a/PATCHES mpfr-2.4.1-b/PATCHES
--- mpfr-2.4.1-a/PATCHES 2009-03-10 01:44:39.000000000 +0000
+++ mpfr-2.4.1-b/PATCHES 2009-03-10 01:44:40.000000000 +0000
@@ -0,0 +1 @@
+vasprintf-mp_limb_t
diff -Naurd mpfr-2.4.1-a/VERSION mpfr-2.4.1-b/VERSION
--- mpfr-2.4.1-a/VERSION 2009-03-04 13:16:46.000000000 +0000
+++ mpfr-2.4.1-b/VERSION 2009-03-10 01:44:40.000000000 +0000
@@ -1 +1 @@
-2.4.1-p2
+2.4.1-p4
diff -Naurd mpfr-2.4.1-a/mpfr.h mpfr-2.4.1-b/mpfr.h
--- mpfr-2.4.1-a/mpfr.h 2009-03-04 13:16:46.000000000 +0000
+++ mpfr-2.4.1-b/mpfr.h 2009-03-10 01:44:40.000000000 +0000
@@ -27,7 +27,7 @@
#define MPFR_VERSION_MAJOR 2
#define MPFR_VERSION_MINOR 4
#define MPFR_VERSION_PATCHLEVEL 1
-#define MPFR_VERSION_STRING "2.4.1-p2"
+#define MPFR_VERSION_STRING "2.4.1-p4"
/* Macros dealing with MPFR VERSION */
#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
diff -Naurd mpfr-2.4.1-a/vasprintf.c mpfr-2.4.1-b/vasprintf.c
--- mpfr-2.4.1-a/vasprintf.c 2009-02-20 09:43:17.000000000 +0000
+++ mpfr-2.4.1-b/vasprintf.c 2009-03-10 01:44:40.000000000 +0000
@@ -398,7 +398,7 @@
(void) va_arg ((ap), mpq_srcptr); \
break; \
case MP_LIMB_ARG: \
- (void) va_arg ((ap), mp_ptr); \
+ (void) va_arg ((ap), mp_limb_t); \
break; \
case MP_LIMB_ARRAY_ARG: \
(void) va_arg ((ap), mp_ptr); \
diff -Naurd mpfr-2.4.1-a/version.c mpfr-2.4.1-b/version.c
--- mpfr-2.4.1-a/version.c 2009-03-04 13:16:46.000000000 +0000
+++ mpfr-2.4.1-b/version.c 2009-03-10 01:44:40.000000000 +0000
@@ -25,5 +25,5 @@
const char *
mpfr_get_version (void)
{
- return "2.4.1-p2";
+ return "2.4.1-p4";
}
diff -Naurd mpfr-2.4.1-a/PATCHES mpfr-2.4.1-b/PATCHES
--- mpfr-2.4.1-a/PATCHES 2009-03-13 02:50:47.000000000 +0000
+++ mpfr-2.4.1-b/PATCHES 2009-03-13 02:50:48.000000000 +0000
@@ -0,0 +1 @@
+zeta_ui-shift
diff -Naurd mpfr-2.4.1-a/VERSION mpfr-2.4.1-b/VERSION
--- mpfr-2.4.1-a/VERSION 2009-03-10 01:44:40.000000000 +0000
+++ mpfr-2.4.1-b/VERSION 2009-03-13 02:50:48.000000000 +0000
@@ -1 +1 @@
-2.4.1-p4
+2.4.1-p5
diff -Naurd mpfr-2.4.1-a/mpfr.h mpfr-2.4.1-b/mpfr.h
--- mpfr-2.4.1-a/mpfr.h 2009-03-10 01:44:40.000000000 +0000
+++ mpfr-2.4.1-b/mpfr.h 2009-03-13 02:50:48.000000000 +0000
@@ -27,7 +27,7 @@
#define MPFR_VERSION_MAJOR 2
#define MPFR_VERSION_MINOR 4
#define MPFR_VERSION_PATCHLEVEL 1
-#define MPFR_VERSION_STRING "2.4.1-p4"
+#define MPFR_VERSION_STRING "2.4.1-p5"
/* Macros dealing with MPFR VERSION */
#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
diff -Naurd mpfr-2.4.1-a/version.c mpfr-2.4.1-b/version.c
--- mpfr-2.4.1-a/version.c 2009-03-10 01:44:40.000000000 +0000
+++ mpfr-2.4.1-b/version.c 2009-03-13 02:50:48.000000000 +0000
@@ -25,5 +25,5 @@
const char *
mpfr_get_version (void)
{
- return "2.4.1-p4";
+ return "2.4.1-p5";
}
diff -Naurd mpfr-2.4.1-a/zeta_ui.c mpfr-2.4.1-b/zeta_ui.c
--- mpfr-2.4.1-a/zeta_ui.c 2009-02-20 09:43:17.000000000 +0000
+++ mpfr-2.4.1-b/zeta_ui.c 2009-03-13 02:50:48.000000000 +0000
@@ -177,7 +177,9 @@
mpz_mul_ui (t, t, 2 * k - 1);
}
mpz_div_2exp (t, t, 1);
- if (n < 1UL << (BITS_PER_MP_LIMB / 2))
+ /* Warning: the test below assumes that an unsigned long
+ has no padding bits. */
+ if (n < 1UL << ((sizeof(unsigned long) * CHAR_BIT) / 2))
/* (n - k + 1) * (n + k - 1) < n^2 */
mpz_divexact_ui (t, t, (n - k + 1) * (n + k - 1));
else

3
mpfr-2.4.1.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:642890e85c6ee684b5c257612df15b034b2a06a5c277fb6647332ebe763a485e
size 1064281

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Mar 16 10:55:06 CET 2009 - rguenther@suse.de
- Update to version 2.4.1 (no changes).
- Apply current cummulative bugfixing patch.
* mpfr_fmod, mpfr_remainder and mpfr_remquo rounding issues.
* incorrect type in vasprintf.c.
* wrong type in mpfr_zeta_ui.
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Feb 25 15:57:54 CET 2009 - rguenther@suse.de Wed Feb 25 15:57:54 CET 2009 - rguenther@suse.de

View File

@ -1,5 +1,5 @@
# #
# spec file for package mpfr (Version 2.4.0) # spec file for package mpfr (Version 2.4.1)
# #
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
@ -24,13 +24,12 @@ BuildRequires: gmp-devel
License: LGPL v2.1 or later License: LGPL v2.1 or later
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
AutoReqProv: on AutoReqProv: on
Requires: gmp Version: 2.4.1
Version: 2.4.0 Release: 1
Release: 2
Summary: The MPFR multiple-precision floating-point library Summary: The MPFR multiple-precision floating-point library
Url: http://www.mpfr.org/ Url: http://www.mpfr.org/
Source: mpfr-%{version}.tar.bz2 Source: mpfr-%{version}.tar.bz2
Patch1: mpfr-2.4.0.patch Patch1: mpfr-%{version}.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
@ -145,6 +144,12 @@ rm -rf $RPM_BUILD_ROOT
%{_prefix}/include/mpfr.h %{_prefix}/include/mpfr.h
%changelog %changelog
* Mon Mar 16 2009 rguenther@suse.de
- Update to version 2.4.1 (no changes).
- Apply current cummulative bugfixing patch.
* mpfr_fmod, mpfr_remainder and mpfr_remquo rounding issues.
* incorrect type in vasprintf.c.
* wrong type in mpfr_zeta_ui.
* Wed Feb 25 2009 rguenther@suse.de * Wed Feb 25 2009 rguenther@suse.de
- Apply current cummulative bugfixing patch. - Apply current cummulative bugfixing patch.
* Fixes mpfr_snprintf and mpfr_vsnprintf buffer overflows. * Fixes mpfr_snprintf and mpfr_vsnprintf buffer overflows.