[arch-commits] Commit in mpfr/repos (3 files)

2018-02-08 Thread Bartłomiej Piotrowski via arch-commits
Date: Thursday, February 8, 2018 @ 11:20:39
  Author: bpiotrowski
Revision: 316233

archrelease: copy trunk to testing-x86_64

Added:
  mpfr/repos/testing-x86_64/
  mpfr/repos/testing-x86_64/PKGBUILD
(from rev 316232, mpfr/trunk/PKGBUILD)
  mpfr/repos/testing-x86_64/mpfr-3.1.6-p1.patch
(from rev 316232, mpfr/trunk/mpfr-3.1.6-p1.patch)

-+
 PKGBUILD|   33 +
 mpfr-3.1.6-p1.patch |  285 ++
 2 files changed, 318 insertions(+)

Copied: mpfr/repos/testing-x86_64/PKGBUILD (from rev 316232, 
mpfr/trunk/PKGBUILD)
===
--- testing-x86_64/PKGBUILD (rev 0)
+++ testing-x86_64/PKGBUILD 2018-02-08 11:20:39 UTC (rev 316233)
@@ -0,0 +1,33 @@
+# $Id$
+# Maintainer: Allan McRae 
+# Contributor: damir 
+
+pkgname=mpfr
+pkgver=4.0.1
+pkgrel=1
+pkgdesc='Multiple-precision floating-point library'
+arch=(x86_64)
+url='http://www.mpfr.org/'
+license=(LGPL)
+depends=('gmp>=5.0')
+source=(http://www.mpfr.org/mpfr-$pkgver/mpfr-${pkgver}.tar.xz{,.asc})
+validpgpkeys=('07F3DBBECC1A39605078094D980C197698C3739D')
+sha256sums=('67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e'
+'SKIP')
+
+build() {
+  cd $pkgname-$pkgver
+  ./configure --prefix=/usr --enable-thread-safe --enable-shared
+  make
+}
+
+check() {
+  cd $pkgname-$pkgver
+  make check
+  make check-exported-symbols
+}
+
+package() {
+  cd $pkgname-$pkgver
+  make DESTDIR="$pkgdir" install
+}

Copied: mpfr/repos/testing-x86_64/mpfr-3.1.6-p1.patch (from rev 316232, 
mpfr/trunk/mpfr-3.1.6-p1.patch)
===
--- testing-x86_64/mpfr-3.1.6-p1.patch  (rev 0)
+++ testing-x86_64/mpfr-3.1.6-p1.patch  2018-02-08 11:20:39 UTC (rev 316233)
@@ -0,0 +1,285 @@
+diff -Naurd mpfr-3.1.6-a/PATCHES mpfr-3.1.6-b/PATCHES
+--- mpfr-3.1.6-a/PATCHES   2017-10-26 13:55:51.168013439 +
 mpfr-3.1.6-b/PATCHES   2017-10-26 13:55:51.236013121 +
+@@ -0,0 +1 @@
++mpfr_get
+diff -Naurd mpfr-3.1.6-a/VERSION mpfr-3.1.6-b/VERSION
+--- mpfr-3.1.6-a/VERSION   2017-09-07 11:36:44.0 +
 mpfr-3.1.6-b/VERSION   2017-10-26 13:55:51.236013121 +
+@@ -1 +1 @@
+-3.1.6
++3.1.6-p1
+diff -Naurd mpfr-3.1.6-a/src/get_ld.c mpfr-3.1.6-b/src/get_ld.c
+--- mpfr-3.1.6-a/src/get_ld.c  2017-01-01 01:39:09.0 +
 mpfr-3.1.6-b/src/get_ld.c  2017-10-26 13:55:51.208013252 +
+@@ -41,6 +41,9 @@
+   mpfr_exp_t sh; /* exponent shift, so that x/2^sh is in the double range 
*/
+   mpfr_t y, z;
+   int sign;
++  MPFR_SAVE_EXPO_DECL (expo);
++
++  MPFR_SAVE_EXPO_MARK (expo);
+ 
+   /* first round x to the target long double precision, so that
+  all subsequent operations are exact (this avoids double rounding
+@@ -103,6 +106,7 @@
+ }
+   if (sign < 0)
+ r = -r;
++  MPFR_SAVE_EXPO_FREE (expo);
+   return r;
+ }
+ }
+diff -Naurd mpfr-3.1.6-a/src/get_si.c mpfr-3.1.6-b/src/get_si.c
+--- mpfr-3.1.6-a/src/get_si.c  2017-01-01 01:39:09.0 +
 mpfr-3.1.6-b/src/get_si.c  2017-10-26 13:55:51.208013252 +
+@@ -28,6 +28,7 @@
+   mpfr_prec_t prec;
+   long s;
+   mpfr_t x;
++  MPFR_SAVE_EXPO_DECL (expo);
+ 
+   if (MPFR_UNLIKELY (!mpfr_fits_slong_p (f, rnd)))
+ {
+@@ -39,14 +40,22 @@
+   if (MPFR_IS_ZERO (f))
+ return (long) 0;
+ 
+-  /* determine prec of long */
+-  for (s = LONG_MIN, prec = 0; s != 0; s /= 2, prec++)
++  /* Determine the precision of long. |LONG_MIN| may have one more bit
++ as an integer, but in this case, this is a power of 2, thus fits
++ in a precision-prec floating-point number. */
++  for (s = LONG_MAX, prec = 0; s != 0; s /= 2, prec++)
+ { }
+ 
++  MPFR_SAVE_EXPO_MARK (expo);
++
+   /* first round to prec bits */
+   mpfr_init2 (x, prec);
+   mpfr_rint (x, f, rnd);
+ 
++  /* The flags from mpfr_rint are the wanted ones. In particular,
++ it sets the inexact flag when necessary. */
++  MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
++
+   /* warning: if x=0, taking its exponent is illegal */
+   if (MPFR_UNLIKELY (MPFR_IS_ZERO(x)))
+ s = 0;
+@@ -65,5 +74,7 @@
+ 
+   mpfr_clear (x);
+ 
++  MPFR_SAVE_EXPO_FREE (expo);
++
+   return s;
+ }
+diff -Naurd mpfr-3.1.6-a/src/get_sj.c mpfr-3.1.6-b/src/get_sj.c
+--- mpfr-3.1.6-a/src/get_sj.c  2017-01-01 01:39:09.0 +
 mpfr-3.1.6-b/src/get_sj.c  2017-10-26 13:55:51.208013252 +
+@@ -35,6 +35,7 @@
+   intmax_t r;
+   mpfr_prec_t prec;
+   mpfr_t x;
++  MPFR_SAVE_EXPO_DECL (expo);
+ 
+   if (MPFR_UNLIKELY (!mpfr_fits_intmax_p (f, rnd)))
+ {
+@@ -46,20 +47,24 @@
+   if (MPFR_IS_ZERO (f))
+  return (intmax_t) 0;
+ 
+-  /* determine the precision of intmax_t */
+-  for (r = MPFR_INTMAX_MIN, prec = 0; r != 0; r /= 2, prec++)
++  /* Determine the precision of intmax_t. 

[arch-commits] Commit in mpfr/repos (3 files)

2018-01-18 Thread Jan Steffens via arch-commits
Date: Thursday, January 18, 2018 @ 20:39:38
  Author: heftig
Revision: 315101

archrelease: copy trunk to staging-x86_64

Added:
  mpfr/repos/staging-x86_64/
  mpfr/repos/staging-x86_64/PKGBUILD
(from rev 315100, mpfr/trunk/PKGBUILD)
  mpfr/repos/staging-x86_64/mpfr-3.1.6-p1.patch
(from rev 315100, mpfr/trunk/mpfr-3.1.6-p1.patch)

-+
 PKGBUILD|   43 +++
 mpfr-3.1.6-p1.patch |  285 ++
 2 files changed, 328 insertions(+)

Copied: mpfr/repos/staging-x86_64/PKGBUILD (from rev 315100, 
mpfr/trunk/PKGBUILD)
===
--- staging-x86_64/PKGBUILD (rev 0)
+++ staging-x86_64/PKGBUILD 2018-01-18 20:39:38 UTC (rev 315101)
@@ -0,0 +1,43 @@
+# $Id$
+# Maintainer: Allan McRae 
+# Contributor: damir 
+
+pkgname=mpfr
+_pkgver=4.0.0
+#_patchlevel=p1
+#pkgver=${_pkgver}.${_patchlevel}
+pkgver=${_pkgver}
+pkgrel=1
+pkgdesc="Multiple-precision floating-point library"
+arch=('x86_64')
+url="http://www.mpfr.org/;
+license=('LGPL')
+depends=('gmp>=5.0')
+source=(http://www.mpfr.org/mpfr-current/mpfr-${_pkgver}.tar.xz{,.asc}
+#mpfr-${_pkgver}-${_patchlevel}.patch
+   )
+
+sha256sums=('fbe2cd1418b321f5c899ce4f0f0f4e73f5ecc7d02145b0e1fd096f5c3afb8a1d'
+'SKIP')
+validpgpkeys=('07F3DBBECC1A39605078094D980C197698C3739D')
+
+prepare() {
+  cd "${srcdir}/${pkgname}-${_pkgver}"
+  #patch -p1 -i $srcdir/mpfr-${_pkgver}-${_patchlevel}.patch
+}
+
+build() {
+  cd "${srcdir}/${pkgname}-${_pkgver}"
+  ./configure --prefix=/usr --enable-thread-safe --enable-shared
+  make
+}
+
+check() {
+  cd "${srcdir}/${pkgname}-${_pkgver}"
+  make check
+}
+
+package() {
+  cd "${srcdir}/${pkgname}-${_pkgver}"
+  make DESTDIR="${pkgdir}" install
+}

Copied: mpfr/repos/staging-x86_64/mpfr-3.1.6-p1.patch (from rev 315100, 
mpfr/trunk/mpfr-3.1.6-p1.patch)
===
--- staging-x86_64/mpfr-3.1.6-p1.patch  (rev 0)
+++ staging-x86_64/mpfr-3.1.6-p1.patch  2018-01-18 20:39:38 UTC (rev 315101)
@@ -0,0 +1,285 @@
+diff -Naurd mpfr-3.1.6-a/PATCHES mpfr-3.1.6-b/PATCHES
+--- mpfr-3.1.6-a/PATCHES   2017-10-26 13:55:51.168013439 +
 mpfr-3.1.6-b/PATCHES   2017-10-26 13:55:51.236013121 +
+@@ -0,0 +1 @@
++mpfr_get
+diff -Naurd mpfr-3.1.6-a/VERSION mpfr-3.1.6-b/VERSION
+--- mpfr-3.1.6-a/VERSION   2017-09-07 11:36:44.0 +
 mpfr-3.1.6-b/VERSION   2017-10-26 13:55:51.236013121 +
+@@ -1 +1 @@
+-3.1.6
++3.1.6-p1
+diff -Naurd mpfr-3.1.6-a/src/get_ld.c mpfr-3.1.6-b/src/get_ld.c
+--- mpfr-3.1.6-a/src/get_ld.c  2017-01-01 01:39:09.0 +
 mpfr-3.1.6-b/src/get_ld.c  2017-10-26 13:55:51.208013252 +
+@@ -41,6 +41,9 @@
+   mpfr_exp_t sh; /* exponent shift, so that x/2^sh is in the double range 
*/
+   mpfr_t y, z;
+   int sign;
++  MPFR_SAVE_EXPO_DECL (expo);
++
++  MPFR_SAVE_EXPO_MARK (expo);
+ 
+   /* first round x to the target long double precision, so that
+  all subsequent operations are exact (this avoids double rounding
+@@ -103,6 +106,7 @@
+ }
+   if (sign < 0)
+ r = -r;
++  MPFR_SAVE_EXPO_FREE (expo);
+   return r;
+ }
+ }
+diff -Naurd mpfr-3.1.6-a/src/get_si.c mpfr-3.1.6-b/src/get_si.c
+--- mpfr-3.1.6-a/src/get_si.c  2017-01-01 01:39:09.0 +
 mpfr-3.1.6-b/src/get_si.c  2017-10-26 13:55:51.208013252 +
+@@ -28,6 +28,7 @@
+   mpfr_prec_t prec;
+   long s;
+   mpfr_t x;
++  MPFR_SAVE_EXPO_DECL (expo);
+ 
+   if (MPFR_UNLIKELY (!mpfr_fits_slong_p (f, rnd)))
+ {
+@@ -39,14 +40,22 @@
+   if (MPFR_IS_ZERO (f))
+ return (long) 0;
+ 
+-  /* determine prec of long */
+-  for (s = LONG_MIN, prec = 0; s != 0; s /= 2, prec++)
++  /* Determine the precision of long. |LONG_MIN| may have one more bit
++ as an integer, but in this case, this is a power of 2, thus fits
++ in a precision-prec floating-point number. */
++  for (s = LONG_MAX, prec = 0; s != 0; s /= 2, prec++)
+ { }
+ 
++  MPFR_SAVE_EXPO_MARK (expo);
++
+   /* first round to prec bits */
+   mpfr_init2 (x, prec);
+   mpfr_rint (x, f, rnd);
+ 
++  /* The flags from mpfr_rint are the wanted ones. In particular,
++ it sets the inexact flag when necessary. */
++  MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
++
+   /* warning: if x=0, taking its exponent is illegal */
+   if (MPFR_UNLIKELY (MPFR_IS_ZERO(x)))
+ s = 0;
+@@ -65,5 +74,7 @@
+ 
+   mpfr_clear (x);
+ 
++  MPFR_SAVE_EXPO_FREE (expo);
++
+   return s;
+ }
+diff -Naurd mpfr-3.1.6-a/src/get_sj.c mpfr-3.1.6-b/src/get_sj.c
+--- mpfr-3.1.6-a/src/get_sj.c  2017-01-01 01:39:09.0 +
 mpfr-3.1.6-b/src/get_sj.c  2017-10-26 13:55:51.208013252 +
+@@ -35,6 +35,7 @@
+   intmax_t r;
+   mpfr_prec_t prec;
+   mpfr_t x;
++  MPFR_SAVE_EXPO_DECL (expo);
+ 
+   if 

[arch-commits] Commit in mpfr/repos (3 files)

2017-11-19 Thread Jan de Groot
Date: Sunday, November 19, 2017 @ 22:35:01
  Author: jgc
Revision: 310461

archrelease: copy trunk to testing-x86_64

Added:
  mpfr/repos/testing-x86_64/
  mpfr/repos/testing-x86_64/PKGBUILD
(from rev 310459, mpfr/trunk/PKGBUILD)
  mpfr/repos/testing-x86_64/mpfr-3.1.6-p1.patch
(from rev 310459, mpfr/trunk/mpfr-3.1.6-p1.patch)

-+
 PKGBUILD|   42 +++
 mpfr-3.1.6-p1.patch |  285 ++
 2 files changed, 327 insertions(+)

Copied: mpfr/repos/testing-x86_64/PKGBUILD (from rev 310459, 
mpfr/trunk/PKGBUILD)
===
--- testing-x86_64/PKGBUILD (rev 0)
+++ testing-x86_64/PKGBUILD 2017-11-19 22:35:01 UTC (rev 310461)
@@ -0,0 +1,42 @@
+# $Id$
+# Maintainer: Allan McRae 
+# Contributor: damir 
+
+pkgname=mpfr
+_pkgver=3.1.6
+_patchlevel=p1
+pkgver=${_pkgver}.${_patchlevel}
+#pkgver=${_pkgver}
+pkgrel=1
+pkgdesc="Multiple-precision floating-point library"
+arch=('x86_64')
+url="http://www.mpfr.org/;
+license=('LGPL')
+depends=('gmp>=5.0')
+source=(http://www.mpfr.org/mpfr-current/mpfr-${_pkgver}.tar.xz{,.asc}
+mpfr-${_pkgver}-${_patchlevel}.patch)
+sha256sums=('7a62ac1a04408614fccdc506e4844b10cf0ad2c2b1677097f8f35d3a1344a950'
+'SKIP'
+'5d37e47d9d206b1b306dfd590b3019c3f2651013403bb5cb290d1173ed080b28')
+validpgpkeys=('07F3DBBECC1A39605078094D980C197698C3739D')
+
+prepare() {
+  cd "${srcdir}/${pkgname}-${_pkgver}"
+  patch -p1 -i $srcdir/mpfr-${_pkgver}-${_patchlevel}.patch
+}
+
+build() {
+  cd "${srcdir}/${pkgname}-${_pkgver}"
+  ./configure --prefix=/usr --enable-thread-safe --enable-shared
+  make
+}
+
+check() {
+  cd "${srcdir}/${pkgname}-${_pkgver}"
+  make check
+}
+
+package() {
+  cd "${srcdir}/${pkgname}-${_pkgver}"
+  make DESTDIR="${pkgdir}" install
+}

Copied: mpfr/repos/testing-x86_64/mpfr-3.1.6-p1.patch (from rev 310459, 
mpfr/trunk/mpfr-3.1.6-p1.patch)
===
--- testing-x86_64/mpfr-3.1.6-p1.patch  (rev 0)
+++ testing-x86_64/mpfr-3.1.6-p1.patch  2017-11-19 22:35:01 UTC (rev 310461)
@@ -0,0 +1,285 @@
+diff -Naurd mpfr-3.1.6-a/PATCHES mpfr-3.1.6-b/PATCHES
+--- mpfr-3.1.6-a/PATCHES   2017-10-26 13:55:51.168013439 +
 mpfr-3.1.6-b/PATCHES   2017-10-26 13:55:51.236013121 +
+@@ -0,0 +1 @@
++mpfr_get
+diff -Naurd mpfr-3.1.6-a/VERSION mpfr-3.1.6-b/VERSION
+--- mpfr-3.1.6-a/VERSION   2017-09-07 11:36:44.0 +
 mpfr-3.1.6-b/VERSION   2017-10-26 13:55:51.236013121 +
+@@ -1 +1 @@
+-3.1.6
++3.1.6-p1
+diff -Naurd mpfr-3.1.6-a/src/get_ld.c mpfr-3.1.6-b/src/get_ld.c
+--- mpfr-3.1.6-a/src/get_ld.c  2017-01-01 01:39:09.0 +
 mpfr-3.1.6-b/src/get_ld.c  2017-10-26 13:55:51.208013252 +
+@@ -41,6 +41,9 @@
+   mpfr_exp_t sh; /* exponent shift, so that x/2^sh is in the double range 
*/
+   mpfr_t y, z;
+   int sign;
++  MPFR_SAVE_EXPO_DECL (expo);
++
++  MPFR_SAVE_EXPO_MARK (expo);
+ 
+   /* first round x to the target long double precision, so that
+  all subsequent operations are exact (this avoids double rounding
+@@ -103,6 +106,7 @@
+ }
+   if (sign < 0)
+ r = -r;
++  MPFR_SAVE_EXPO_FREE (expo);
+   return r;
+ }
+ }
+diff -Naurd mpfr-3.1.6-a/src/get_si.c mpfr-3.1.6-b/src/get_si.c
+--- mpfr-3.1.6-a/src/get_si.c  2017-01-01 01:39:09.0 +
 mpfr-3.1.6-b/src/get_si.c  2017-10-26 13:55:51.208013252 +
+@@ -28,6 +28,7 @@
+   mpfr_prec_t prec;
+   long s;
+   mpfr_t x;
++  MPFR_SAVE_EXPO_DECL (expo);
+ 
+   if (MPFR_UNLIKELY (!mpfr_fits_slong_p (f, rnd)))
+ {
+@@ -39,14 +40,22 @@
+   if (MPFR_IS_ZERO (f))
+ return (long) 0;
+ 
+-  /* determine prec of long */
+-  for (s = LONG_MIN, prec = 0; s != 0; s /= 2, prec++)
++  /* Determine the precision of long. |LONG_MIN| may have one more bit
++ as an integer, but in this case, this is a power of 2, thus fits
++ in a precision-prec floating-point number. */
++  for (s = LONG_MAX, prec = 0; s != 0; s /= 2, prec++)
+ { }
+ 
++  MPFR_SAVE_EXPO_MARK (expo);
++
+   /* first round to prec bits */
+   mpfr_init2 (x, prec);
+   mpfr_rint (x, f, rnd);
+ 
++  /* The flags from mpfr_rint are the wanted ones. In particular,
++ it sets the inexact flag when necessary. */
++  MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
++
+   /* warning: if x=0, taking its exponent is illegal */
+   if (MPFR_UNLIKELY (MPFR_IS_ZERO(x)))
+ s = 0;
+@@ -65,5 +74,7 @@
+ 
+   mpfr_clear (x);
+ 
++  MPFR_SAVE_EXPO_FREE (expo);
++
+   return s;
+ }
+diff -Naurd mpfr-3.1.6-a/src/get_sj.c mpfr-3.1.6-b/src/get_sj.c
+--- mpfr-3.1.6-a/src/get_sj.c  2017-01-01 01:39:09.0 +
 mpfr-3.1.6-b/src/get_sj.c  2017-10-26 13:55:51.208013252 +
+@@ -35,6 +35,7 @@
+   intmax_t r;
+   mpfr_prec_t prec;
+   

[arch-commits] Commit in mpfr/repos (3 files)

2017-01-05 Thread Allan McRae
Date: Friday, January 6, 2017 @ 04:05:49
  Author: allan
Revision: 285324

archrelease: copy trunk to testing-x86_64

Added:
  mpfr/repos/testing-x86_64/
  mpfr/repos/testing-x86_64/PKGBUILD
(from rev 285323, mpfr/trunk/PKGBUILD)
  mpfr/repos/testing-x86_64/mpfr-3.1.5-p2.patch
(from rev 285323, mpfr/trunk/mpfr-3.1.5-p2.patch)

-+
 PKGBUILD|   42 
 mpfr-3.1.5-p2.patch |  174 ++
 2 files changed, 216 insertions(+)

Copied: mpfr/repos/testing-x86_64/PKGBUILD (from rev 285323, 
mpfr/trunk/PKGBUILD)
===
--- testing-x86_64/PKGBUILD (rev 0)
+++ testing-x86_64/PKGBUILD 2017-01-06 04:05:49 UTC (rev 285324)
@@ -0,0 +1,42 @@
+# $Id$
+# Maintainer: Allan McRae 
+# Contributor: damir 
+
+pkgname=mpfr
+_pkgver=3.1.5
+_patchlevel=p2
+pkgver=${_pkgver}.${_patchlevel}
+#pkgver=${_pkgver}
+pkgrel=1
+pkgdesc="Multiple-precision floating-point library"
+arch=('i686' 'x86_64')
+url="http://www.mpfr.org/;
+license=('LGPL')
+depends=('gmp>=5.0')
+source=(http://www.mpfr.org/mpfr-current/mpfr-${_pkgver}.tar.xz{,.asc}
+mpfr-${_pkgver}-${_patchlevel}.patch)
+md5sums=('c4ac246cf9795a4491e7766002cd528f'
+ 'SKIP'
+ 'f388b7983bf69e2bfd3216426c89954c')
+validpgpkeys=('07F3DBBECC1A39605078094D980C197698C3739D')
+
+prepare() {
+  cd "${srcdir}/${pkgname}-${_pkgver}"
+  patch -p1 -i $srcdir/mpfr-${_pkgver}-${_patchlevel}.patch
+}
+
+build() {
+  cd "${srcdir}/${pkgname}-${_pkgver}"
+  ./configure --prefix=/usr --enable-thread-safe --enable-shared
+  make
+}
+
+check() {
+  cd "${srcdir}/${pkgname}-${_pkgver}"
+  make check
+}
+
+package() {
+  cd "${srcdir}/${pkgname}-${_pkgver}"
+  make DESTDIR="${pkgdir}" install
+}

Copied: mpfr/repos/testing-x86_64/mpfr-3.1.5-p2.patch (from rev 285323, 
mpfr/trunk/mpfr-3.1.5-p2.patch)
===
--- testing-x86_64/mpfr-3.1.5-p2.patch  (rev 0)
+++ testing-x86_64/mpfr-3.1.5-p2.patch  2017-01-06 04:05:49 UTC (rev 285324)
@@ -0,0 +1,174 @@
+diff -Naurd mpfr-3.1.5-a/PATCHES mpfr-3.1.5-b/PATCHES
+--- mpfr-3.1.5-a/PATCHES   2016-12-15 08:35:46.476430238 +
 mpfr-3.1.5-b/PATCHES   2016-12-15 08:35:46.544430346 +
+@@ -0,0 +1 @@
++vasprintf
+diff -Naurd mpfr-3.1.5-a/VERSION mpfr-3.1.5-b/VERSION
+--- mpfr-3.1.5-a/VERSION   2016-09-27 07:58:14.0 +
 mpfr-3.1.5-b/VERSION   2016-12-15 08:35:46.544430346 +
+@@ -1 +1 @@
+-3.1.5
++3.1.5-p1
+diff -Naurd mpfr-3.1.5-a/src/mpfr.h mpfr-3.1.5-b/src/mpfr.h
+--- mpfr-3.1.5-a/src/mpfr.h2016-09-27 07:58:15.0 +
 mpfr-3.1.5-b/src/mpfr.h2016-12-15 08:35:46.540430340 +
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 5
+-#define MPFR_VERSION_STRING "3.1.5"
++#define MPFR_VERSION_STRING "3.1.5-p1"
+ 
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.5-a/src/vasprintf.c mpfr-3.1.5-b/src/vasprintf.c
+--- mpfr-3.1.5-a/src/vasprintf.c   2016-09-27 07:58:15.0 +
 mpfr-3.1.5-b/src/vasprintf.c   2016-12-15 08:35:46.520430308 +
+@@ -1593,7 +1593,7 @@
+ }
+   else if (spec.spec == 'f' || spec.spec == 'F')
+ {
+-  if (spec.prec == -1)
++  if (spec.prec < 0)
+ spec.prec = 6;
+   if (regular_fg (np, p, spec, NULL) == -1)
+ goto error;
+diff -Naurd mpfr-3.1.5-a/src/version.c mpfr-3.1.5-b/src/version.c
+--- mpfr-3.1.5-a/src/version.c 2016-09-27 07:58:15.0 +
 mpfr-3.1.5-b/src/version.c 2016-12-15 08:35:46.544430346 +
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+-  return "3.1.5";
++  return "3.1.5-p1";
+ }
+diff -Naurd mpfr-3.1.5-a/tests/tsprintf.c mpfr-3.1.5-b/tests/tsprintf.c
+--- mpfr-3.1.5-a/tests/tsprintf.c  2016-09-27 07:58:14.0 +
 mpfr-3.1.5-b/tests/tsprintf.c  2016-12-15 08:35:46.520430308 +
+@@ -1251,6 +1251,25 @@
+   check_emin_aux (MPFR_EMIN_MIN);
+ }
+ 
++static void
++test20161214 (void)
++{
++  mpfr_t x;
++  char buf[32];
++  const char s[] = "0x0.f8p+1024";
++  int r;
++
++  mpfr_init2 (x, 64);
++  mpfr_set_str (x, s, 16, MPFR_RNDN);
++  r = mpfr_snprintf (buf, 32, "%.*RDf", -2, x);
++  MPFR_ASSERTN(r == 316);
++  r = mpfr_snprintf (buf, 32, "%.*RDf", INT_MIN + 1, x);
++  MPFR_ASSERTN(r == 316);
++  r = mpfr_snprintf (buf, 32, "%.*RDf", INT_MIN, x);
++  MPFR_ASSERTN(r == 316);
++  mpfr_clear (x);
++}
++
+ int
+ main (int argc, char **argv)
+ {
+@@ -1271,6 +1290,7 @@
+   mixed ();
+   check_emax ();
+   check_emin ();
++  test20161214 ();
+ 
+ #if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE)
+ #if MPFR_LCONV_DPTS
+diff -Naurd mpfr-3.1.5-a/PATCHES