From 1000eab5ab8c64eed6821d0a7c78024a00297a17 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 5 Dec 2014 11:30:27 +0100 Subject: [PATCH] Fix LDBL80_WORDS macro on big endian platforms. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * m4/isfinite.m4 (gl_ISFINITEL_WORKS): Add missing parenthesis in LDBL80_WORDS macro. * m4/isinf.m4 (gl_ISINFL_WORKS): Likewise. * m4/isnanl.m4 (gl_FUNC_ISNANL_WORKS): Likewise. * tests/test-isfinite.c (test_isfinitel): Likewise. * tests/test-isinf.c (test_isinfl): Likewise. * tests/test-isnan.c (test_long_double): Likewise. * tests/test-isnanl.h (main): Likewise. * tests/test-snprintf-posix.h (LDBL80_WORDS): Add missing parenthesis. * tests/test-sprintf-posix.h (LDBL80_WORDS): Likewise. * tests/test-vasnprintf-posix.c (LDBL80_WORDS): Likewise. * tests/test-vasprintf-posix.c (LDBL80_WORDS): Likewise. Reported by Pádraig Brady. --- ChangeLog | 17 +++++++++++++++++ m4/isfinite.m4 | 4 ++-- m4/isinf.m4 | 4 ++-- m4/isnanl.m4 | 4 ++-- tests/test-isfinite.c | 2 +- tests/test-isinf.c | 2 +- tests/test-isnan.c | 2 +- tests/test-isnanl.h | 2 +- tests/test-snprintf-posix.h | 2 +- tests/test-sprintf-posix.h | 2 +- tests/test-vasnprintf-posix.c | 2 +- tests/test-vasprintf-posix.c | 2 +- 12 files changed, 31 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7379fa6d78..fb6723b173 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2014-12-05 Bruno Haible + + Fix LDBL80_WORDS macro on big endian platforms. + * m4/isfinite.m4 (gl_ISFINITEL_WORKS): Add missing parenthesis in + LDBL80_WORDS macro. + * m4/isinf.m4 (gl_ISINFL_WORKS): Likewise. + * m4/isnanl.m4 (gl_FUNC_ISNANL_WORKS): Likewise. + * tests/test-isfinite.c (test_isfinitel): Likewise. + * tests/test-isinf.c (test_isinfl): Likewise. + * tests/test-isnan.c (test_long_double): Likewise. + * tests/test-isnanl.h (main): Likewise. + * tests/test-snprintf-posix.h (LDBL80_WORDS): Add missing parenthesis. + * tests/test-sprintf-posix.h (LDBL80_WORDS): Likewise. + * tests/test-vasnprintf-posix.c (LDBL80_WORDS): Likewise. + * tests/test-vasprintf-posix.c (LDBL80_WORDS): Likewise. + Reported by Pádraig Brady. + 2014-12-02 KO Myung-Hun git-version-gen: do not print new line characters diff --git a/m4/isfinite.m4 b/m4/isfinite.m4 index 53ad9092a7..bfd1ea39ae 100644 --- a/m4/isfinite.m4 +++ b/m4/isfinite.m4 @@ -1,4 +1,4 @@ -# isfinite.m4 serial 13 +# isfinite.m4 serial 14 dnl Copyright (C) 2007-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -94,7 +94,7 @@ int main () # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else diff --git a/m4/isinf.m4 b/m4/isinf.m4 index 7174acecdb..4d844b0f02 100644 --- a/m4/isinf.m4 +++ b/m4/isinf.m4 @@ -1,4 +1,4 @@ -# isinf.m4 serial 9 +# isinf.m4 serial 10 dnl Copyright (C) 2007-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -101,7 +101,7 @@ int main () # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else diff --git a/m4/isnanl.m4 b/m4/isnanl.m4 index 98b2b69fce..a26cc93fc6 100644 --- a/m4/isnanl.m4 +++ b/m4/isnanl.m4 @@ -1,4 +1,4 @@ -# isnanl.m4 serial 17 +# isnanl.m4 serial 18 dnl Copyright (C) 2007-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -177,7 +177,7 @@ int main () # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else diff --git a/tests/test-isfinite.c b/tests/test-isfinite.c index 5d320eafe8..5b3f1dde2b 100644 --- a/tests/test-isfinite.c +++ b/tests/test-isfinite.c @@ -181,7 +181,7 @@ test_isfinitel () # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else diff --git a/tests/test-isinf.c b/tests/test-isinf.c index 2505c32018..2a582572b4 100644 --- a/tests/test-isinf.c +++ b/tests/test-isinf.c @@ -187,7 +187,7 @@ test_isinfl () # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else diff --git a/tests/test-isnan.c b/tests/test-isnan.c index 9cb5e072ad..e7693677a9 100644 --- a/tests/test-isnan.c +++ b/tests/test-isnan.c @@ -168,7 +168,7 @@ test_long_double (void) # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else diff --git a/tests/test-isnanl.h b/tests/test-isnanl.h index 015b086497..3b8fb3da4a 100644 --- a/tests/test-isnanl.h +++ b/tests/test-isnanl.h @@ -80,7 +80,7 @@ main () # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else diff --git a/tests/test-snprintf-posix.h b/tests/test-snprintf-posix.h index ce8a6d25aa..1f723b37c5 100644 --- a/tests/test-snprintf-posix.h +++ b/tests/test-snprintf-posix.h @@ -34,7 +34,7 @@ have_minus_zero () #ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } #else diff --git a/tests/test-sprintf-posix.h b/tests/test-sprintf-posix.h index 3871a1f692..e23d34db59 100644 --- a/tests/test-sprintf-posix.h +++ b/tests/test-sprintf-posix.h @@ -34,7 +34,7 @@ have_minus_zero () #ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } #else diff --git a/tests/test-vasnprintf-posix.c b/tests/test-vasnprintf-posix.c index 4fd21c8836..5f9094762d 100644 --- a/tests/test-vasnprintf-posix.c +++ b/tests/test-vasnprintf-posix.c @@ -47,7 +47,7 @@ have_minus_zero () #ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } #else diff --git a/tests/test-vasprintf-posix.c b/tests/test-vasprintf-posix.c index 6a28cffbfa..40cdfa9656 100644 --- a/tests/test-vasprintf-posix.c +++ b/tests/test-vasprintf-posix.c @@ -46,7 +46,7 @@ have_minus_zero () #ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } #else -- 2.39.5