Skip to content

Commit c8ea79f

Browse files
committed
Use numeric_cast_v<unsigned> instead of deprecated integer2unsigned
1 parent 272636c commit c8ea79f

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/goto-instrument/accelerate/acceleration_utils.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,7 @@ void acceleration_utilst::extract_polynomial(
12351235
std::map<exprt, int> degrees;
12361236

12371237
mp_integer mp=binary2integer(concrete_term.get_value().c_str(), true);
1238-
monomial.coeff=mp.to_long();
1238+
monomial.coeff = numeric_cast_v<int>(mp);
12391239

12401240
if(monomial.coeff==0)
12411241
{

src/util/arith_tools.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ mp_integer power(const mp_integer &base,
231231
case 2:
232232
{
233233
mp_integer result;
234-
result.setPower2(exponent.to_ulong());
234+
result.setPower2(numeric_cast_v<unsigned>(exponent));
235235
return result;
236236
}
237237
case 1: return 1;

src/util/ieee_float.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Author: Daniel Kroening, [email protected]
88

99
#include "ieee_float.h"
1010

11-
#include <cstdint>
1211
#include <ostream>
1312
#include <cmath>
1413
#include <limits>
@@ -1246,7 +1245,7 @@ float ieee_floatt::to_float() const
12461245
CHECK_RETURN(i.is_ulong());
12471246
CHECK_RETURN(i <= std::numeric_limits<std::uint32_t>::max());
12481247

1249-
a.i=i.to_ulong();
1248+
a.i = numeric_cast_v<unsigned>(i);
12501249
return a.f;
12511250
}
12521251

0 commit comments

Comments
 (0)