]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - stdio-common/_itowa.c
[powerpc] No need to enter "Ignore Exceptions Mode"
[thirdparty/glibc.git] / stdio-common / _itowa.c
index 8047c877c90f50f727d7478ce0db518e56be47a0..2a53562d67a860b7c9e6754f2a8ea962a22f3c6a 100644 (file)
@@ -1,5 +1,5 @@
 /* Internal function for converting integers to ASCII.
-   Copyright (C) 1994-1996,1999,2000,2002,2007 Free Software Foundation, Inc.
+   Copyright (C) 1994-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Torbjorn Granlund <tege@matematik.su.se>
    and Ulrich Drepper <drepper@gnu.org>.
@@ -16,7 +16,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #include <gmp-mparam.h>
 #include <gmp.h>
@@ -24,7 +24,7 @@
 #include <stdlib/gmp-impl.h>
 #include <stdlib/longlong.h>
 
-#include "_itowa.h"
+#include <_itowa.h>
 
 
 /* Canonize environment.  For some architectures not all values might
@@ -85,13 +85,10 @@ extern const wchar_t _itowa_lower_digits[] attribute_hidden;
 extern const wchar_t _itowa_upper_digits[] attribute_hidden;
 
 
-#if LLONG_MAX != LONG_MAX
+#if _ITOA_NEEDED
 wchar_t *
-_itowa (value, buflim, base, upper_case)
-     unsigned long long int value;
-     wchar_t *buflim;
-     unsigned int base;
-     int upper_case;
+_itowa (unsigned long long int value, wchar_t *buflim, unsigned int base,
+       int upper_case)
 {
   const wchar_t *digits = (upper_case
                           ? _itowa_upper_digits : _itowa_lower_digits);
@@ -102,7 +99,7 @@ _itowa (value, buflim, base, upper_case)
     {
 # define RUN_2N(BITS) \
       do                                                                     \
-        {                                                                    \
+                                                                           \
          /* `unsigned long long int' always has 64 bits.  */                 \
          mp_limb_t work_hi = value >> (64 - BITS_PER_MP_LIMB);               \
                                                                              \
@@ -159,7 +156,8 @@ _itowa (value, buflim, base, upper_case)
        if (brec->flag)
          while (value != 0)
            {
-             mp_limb_t quo, rem, x, dummy;
+             mp_limb_t quo, rem, x;
+             mp_limb_t dummy __attribute__ ((unused));
 
              umul_ppmm (x, dummy, value, base_multiplier);
              quo = (x + ((value - x) >> 1)) >> (brec->post_shift - 1);
@@ -170,7 +168,8 @@ _itowa (value, buflim, base, upper_case)
        else
          while (value != 0)
            {
-             mp_limb_t quo, rem, x, dummy;
+             mp_limb_t quo, rem, x;
+             mp_limb_t dummy __attribute__ ((unused));
 
              umul_ppmm (x, dummy, value, base_multiplier);
              quo = x >> brec->post_shift;
@@ -296,7 +295,8 @@ _itowa (value, buflim, base, upper_case)
            if (brec->flag)
              while (ti != 0)
                {
-                 mp_limb_t quo, rem, x, dummy;
+                 mp_limb_t quo, rem, x;
+                 mp_limb_t dummy __attribute__ ((unused));
 
                  umul_ppmm (x, dummy, ti, base_multiplier);
                  quo = (x + ((ti - x) >> 1)) >> (brec->post_shift - 1);
@@ -308,7 +308,8 @@ _itowa (value, buflim, base, upper_case)
            else
              while (ti != 0)
                {
-                 mp_limb_t quo, rem, x, dummy;
+                 mp_limb_t quo, rem, x;
+                 mp_limb_t dummy __attribute__ ((unused));
 
                  umul_ppmm (x, dummy, ti, base_multiplier);
                  quo = x >> brec->post_shift;