mpfr4 (3.1.0-5) 0001-Apply-upstream-patch01-fixing-bug-about-MPFR_UNLIKEL.patch

Summary

 PATCHES         |    1 +
 VERSION         |    2 +-
 src/mpfr-impl.h |    5 +++--
 src/mpfr.h      |    2 +-
 src/version.c   |    2 +-
 5 files changed, 7 insertions(+), 5 deletions(-)

    
download this patch

Patch contents

From: Laurent Fousse <laurent@komite.net>
Date: Wed, 9 Nov 2011 20:45:28 +0100
Subject: Apply upstream patch01, fixing bug about MPFR_UNLIKELY.

---
 PATCHES         |    1 +
 VERSION         |    2 +-
 src/mpfr-impl.h |    5 +++--
 src/mpfr.h      |    2 +-
 src/version.c   |    2 +-
 5 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/PATCHES b/PATCHES
index e69de29..c5ab059 100644
--- a/PATCHES
+++ b/PATCHES
@@ -0,0 +1 @@
+mpfr_unlikely
diff --git a/VERSION b/VERSION
index fd2a018..4ba2733 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.1.0
+3.1.0-p1
diff --git a/src/mpfr-impl.h b/src/mpfr-impl.h
index 1f0f15d..088f7fa 100644
--- a/src/mpfr-impl.h
+++ b/src/mpfr-impl.h
@@ -988,10 +988,11 @@ extern unsigned char *mpfr_stack;
  ******************************************************/
 
 /* Theses macros help the compiler to determine if a test is
- * likely or unlikely. */
+   likely or unlikely. The !! is necessary in case x is larger
+   than a long. */
 #if __MPFR_GNUC(3,0) || __MPFR_ICC(8,1,0)
 # define MPFR_LIKELY(x) (__builtin_expect(!!(x),1))
-# define MPFR_UNLIKELY(x) (__builtin_expect((x),0))
+# define MPFR_UNLIKELY(x) (__builtin_expect(!!(x),0))
 #else
 # define MPFR_LIKELY(x) (x)
 # define MPFR_UNLIKELY(x) (x)
diff --git a/src/mpfr.h b/src/mpfr.h
index d918943..8546267 100644
--- a/src/mpfr.h
+++ b/src/mpfr.h
@@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
 #define MPFR_VERSION_MAJOR 3
 #define MPFR_VERSION_MINOR 1
 #define MPFR_VERSION_PATCHLEVEL 0
-#define MPFR_VERSION_STRING "3.1.0"
+#define MPFR_VERSION_STRING "3.1.0-p1"
 
 /* Macros dealing with MPFR VERSION */
 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
diff --git a/src/version.c b/src/version.c
index 2855663..14cb909 100644
--- a/src/version.c
+++ b/src/version.c
@@ -25,5 +25,5 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
 const char *
 mpfr_get_version (void)
 {
-  return "3.1.0";
+  return "3.1.0-p1";
 }