Skip to content

Remove pointless typecasts #1580

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
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
12 changes: 6 additions & 6 deletions src/util/std_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,17 @@ mp_integer signedbv_typet::largest() const

constant_exprt signedbv_typet::zero_expr() const
{
return to_constant_expr(from_integer(0, *this));
return from_integer(0, *this);
}

constant_exprt signedbv_typet::smallest_expr() const
{
return to_constant_expr(from_integer(smallest(), *this));
return from_integer(smallest(), *this);
}

constant_exprt signedbv_typet::largest_expr() const
{
return to_constant_expr(from_integer(largest(), *this));
return from_integer(largest(), *this);
}

mp_integer unsignedbv_typet::smallest() const
Expand All @@ -171,15 +171,15 @@ mp_integer unsignedbv_typet::largest() const

constant_exprt unsignedbv_typet::zero_expr() const
{
return to_constant_expr(from_integer(0, *this));
return from_integer(0, *this);
}

constant_exprt unsignedbv_typet::smallest_expr() const
{
return to_constant_expr(from_integer(smallest(), *this));
return from_integer(smallest(), *this);
}

constant_exprt unsignedbv_typet::largest_expr() const
{
return to_constant_expr(from_integer(largest(), *this));
return from_integer(largest(), *this);
}