From 7009001f732a0d698763a97eba71a43e89ad57ea Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 20 Oct 2016 00:13:45 -0400 Subject: [PATCH] fix ambiguous call to abs() in tommath (#1228) fix ambiguous call to abs() in tommath --- src/mpi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mpi.cpp b/src/mpi.cpp index b8104f88e..ef0865b52 100644 --- a/src/mpi.cpp +++ b/src/mpi.cpp @@ -6708,7 +6708,7 @@ mp_rand (mp_int * a, int digits) /* first place a random non-zero digit */ do { - d = ((mp_digit) abs (MP_GEN_RANDOM())) & MP_MASK; + d = ((mp_digit) abs (int(MP_GEN_RANDOM()))) & MP_MASK; } while (d == 0); if ((res = mp_add_d (a, d, a)) != MP_OKAY) { @@ -6720,7 +6720,7 @@ mp_rand (mp_int * a, int digits) return res; } - if ((res = mp_add_d (a, ((mp_digit) abs (MP_GEN_RANDOM())), a)) != MP_OKAY) { + if ((res = mp_add_d (a, ((mp_digit) abs (int(MP_GEN_RANDOM()))), a)) != MP_OKAY) { return res; } }