Skip to content

Removed deprecated and unused to_unsigned_integer #4248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions src/util/arith_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,6 @@ bool to_integer(const constant_exprt &expr, mp_integer &int_value)
return true;
}

/// convert a positive integer expression to an unsigned int
/// \par parameters: a constant expression and a reference to an unsigned int
/// \return an error flag
bool to_unsigned_integer(const constant_exprt &expr, unsigned &uint_value)
{
mp_integer i;
if(to_integer(expr, i))
return true;
if(i<0)
return true;
else
{
uint_value = numeric_cast_v<unsigned>(i);
return false;
}
}

constant_exprt from_integer(
const mp_integer &int_value,
const typet &type)
Expand Down
5 changes: 0 additions & 5 deletions src/util/arith_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Author: Daniel Kroening, [email protected]
#ifndef CPROVER_UTIL_ARITH_TOOLS_H
#define CPROVER_UTIL_ARITH_TOOLS_H

#include "deprecate.h"
#include "invariant.h"
#include "mp_arith.h"
#include "optional.h"
Expand All @@ -26,10 +25,6 @@ class typet;
/// \return False if, and only if, the conversion was successful.
bool to_integer(const constant_exprt &expr, mp_integer &int_value);

// returns 'true' on error
DEPRECATED(SINCE(2018, 9, 29, "Use numeric_cast<unsigned>(e) instead"))
bool to_unsigned_integer(const constant_exprt &expr, unsigned &uint_value);

/// Numerical cast provides a unified way of converting from one numerical type
/// to another.
/// Generic case doesn't exist, this has to be specialized for different types.
Expand Down