]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2006-11-12 Joseph Myers <joseph@codesourcery.com>
authorAndreas Jaeger <aj@suse.de>
Thu, 12 Oct 2006 05:25:34 +0000 (05:25 +0000)
committerAndreas Jaeger <aj@suse.de>
Thu, 12 Oct 2006 05:25:34 +0000 (05:25 +0000)
* math/atest-exp.c (main): Cast hex value to mp_limb_t before
shifting.
* math/atest-exp2.c (read_mpn_hex): Likewise.
* math/atest-sincos.c (main): Likewise.

math/atest-exp.c
math/atest-exp2.c
math/atest-sincos.c

index 158be4231ac79a53095ecf928de58c00af718f45..2f168c9a6ddf5d6a28c05e40c5ab01348d4ef079 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Geoffrey Keating <Geoff.Keating@anu.edu.au>, 1997.
 
@@ -171,8 +171,10 @@ main (void)
 
    memset (e2, '\0', sizeof (mp1));
    for (i = -1; i < 100 && i < FRAC / 4; i++)
-     e2[(FRAC - i * 4 - 4) / mpbpl] |= ((strchr (hexdig, exp1[i + 1]) - hexdig)
-                                       << (FRAC - i * 4 - 4) % mpbpl);
+     e2[(FRAC - i * 4 - 4) / mpbpl] |= ((mp_limb_t) (strchr (hexdig,
+                                                            exp1[i + 1])
+                                                    - hexdig)
+                                       << (FRAC - i * 4 - 4) % mpbpl);
 
    if (mpn_cmp (ex, e2, SZ) >= 0)
      mpn_sub_n (e3, ex, e2, SZ);
index 33d942fc61e82933a1a442f4dad8a265c514a293..2c028a2b8386852dd7c5ab6693dc280b8563ba2c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Geoffrey Keating <Geoff.Keating@anu.edu.au>, 1997.
 
@@ -73,8 +73,9 @@ read_mpn_hex(mp_limb_t *x, const char *str)
 
   memset (x, 0, sizeof (mp1));
   for (i = -1; i < 100 && i < FRAC / 4; ++i)
-    x[(FRAC - i * 4 - 4) / mpbpl] |= ((strchr (hexdig, str[i + 1]) - hexdig)
-                                     << (FRAC - i * 4 - 4) % mpbpl);
+    x[(FRAC - i * 4 - 4) / mpbpl] |= ((mp_limb_t) (strchr (hexdig, str[i + 1])
+                                                  - hexdig)
+                                     << (FRAC - i * 4 - 4) % mpbpl);
 }
 
 static mp_limb_t *get_log2(void) __attribute__((const));
index 911aaec2754e25b1c4537b3f7ac87ea1ace3db3e..bef3521c9624e9c9f88fe22ec355bf7b35a53bb3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Geoffrey Keating <Geoff.Keating@anu.edu.au>, 1997.
 
@@ -239,9 +239,11 @@ main (void)
    memset (c2, 0, sizeof (mp1));
    for (i = 0; i < 100 && i < FRAC / 4; i++)
      {
-       s2[(FRAC - i * 4 - 4) / mpbpl] |= ((strchr (hexdig, sin1[i]) - hexdig)
-                                         << (FRAC - i * 4 - 4) % mpbpl);
-       c2[(FRAC - i * 4 - 4) / mpbpl] |= ((strchr (hexdig, cos1[i]) - hexdig)
+       s2[(FRAC - i * 4 - 4) / mpbpl] |= ((mp_limb_t) (strchr (hexdig, sin1[i])
+                                                      - hexdig)
+                                         << (FRAC - i * 4 - 4) % mpbpl);
+       c2[(FRAC - i * 4 - 4) / mpbpl] |= ((mp_limb_t) (strchr (hexdig, cos1[i])
+                                                      - hexdig)
                                          << (FRAC - i * 4 - 4) % mpbpl);
      }