aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/unittests/gmp-utils-selftests.c12
2 files changed, 12 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9106860..4663f56 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2020-11-20 Simon Marchi <simon.marchi@polymtl.ca>
+ * unittests/gmp-utils-selftests.c (gdb_mpz_read_all_from_small):
+ Pass 2.0 to pow.
+ (gdb_mpz_write_all_from_small): Likewise.
+
+2020-11-20 Simon Marchi <simon.marchi@polymtl.ca>
+
* dwarf2/read.c (finish_fixed_point_type): Use std::abs instead
of abs.
diff --git a/gdb/unittests/gmp-utils-selftests.c b/gdb/unittests/gmp-utils-selftests.c
index e8c3c5c..af5bc65 100644
--- a/gdb/unittests/gmp-utils-selftests.c
+++ b/gdb/unittests/gmp-utils-selftests.c
@@ -125,8 +125,8 @@ gdb_mpz_read_all_from_small ()
to check the complete range. */
int buf_len = 1;
- LONGEST l_min = -pow (2, buf_len * 8 - 1);
- LONGEST l_max = pow (2, buf_len * 8 - 1) - 1;
+ LONGEST l_min = -pow (2.0, buf_len * 8 - 1);
+ LONGEST l_max = pow (2.0, buf_len * 8 - 1) - 1;
for (LONGEST l = l_min; l <= l_max; l++)
{
@@ -141,7 +141,7 @@ gdb_mpz_read_all_from_small ()
/* Do the same as above, but with an unsigned type. */
ULONGEST ul_min = 0;
- ULONGEST ul_max = pow (2, buf_len * 8) - 1;
+ ULONGEST ul_max = pow (2.0, buf_len * 8) - 1;
for (ULONGEST ul = ul_min; ul <= ul_max; ul++)
{
@@ -248,8 +248,8 @@ static void
gdb_mpz_write_all_from_small ()
{
int buf_len = 1;
- LONGEST l_min = -pow (2, buf_len * 8 - 1);
- LONGEST l_max = pow (2, buf_len * 8 - 1) - 1;
+ LONGEST l_min = -pow (2.0, buf_len * 8 - 1);
+ LONGEST l_max = pow (2.0, buf_len * 8 - 1) - 1;
for (LONGEST l = l_min; l <= l_max; l++)
{
@@ -259,7 +259,7 @@ gdb_mpz_write_all_from_small ()
/* Do the same as above, but with an unsigned type. */
ULONGEST ul_min = 0;
- ULONGEST ul_max = pow (2, buf_len * 8) - 1;
+ ULONGEST ul_max = pow (2.0, buf_len * 8) - 1;
for (ULONGEST ul = ul_min; ul <= ul_max; ul++)
{