Skip to content

Commit 0da9766

Browse files
authored
Merge pull request #2538 from tautschnig/vs-use-to_ulong
Use to_ulong instead of the deprecated integer2ulong
2 parents ee9444f + 13f83d5 commit 0da9766

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/util/mp_arith.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,16 @@ mp_integer::ullong_t integer2ulong(const mp_integer &n)
195195
std::size_t integer2size_t(const mp_integer &n)
196196
{
197197
PRECONDITION(n>=0 && n<=std::numeric_limits<std::size_t>::max());
198-
mp_integer::ullong_t ull=integer2ulong(n);
198+
PRECONDITION(n.is_ulong());
199+
mp_integer::ullong_t ull = n.to_ulong();
199200
return (std::size_t) ull;
200201
}
201202

202203
unsigned integer2unsigned(const mp_integer &n)
203204
{
204205
PRECONDITION(n>=0 && n<=std::numeric_limits<unsigned>::max());
205-
mp_integer::ullong_t ull=integer2ulong(n);
206+
PRECONDITION(n.is_ulong());
207+
mp_integer::ullong_t ull = n.to_ulong();
206208
return (unsigned)ull;
207209
}
208210

0 commit comments

Comments
 (0)