Skip to content

Commit ed2cf6a

Browse files
committed
Remove unused parameter from float_bvt::is_zero
1 parent d6bdee6 commit ed2cf6a

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/solvers/floatbv/float_bv.cpp

+7-9
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ exprt float_bvt::convert(const exprt &expr)
6464
else if(expr.id()==ID_typecast &&
6565
expr.type().id()==ID_bool &&
6666
expr.op0().type().id()==ID_floatbv) // float -> bool
67-
return not_exprt(is_zero(expr.op0(), get_spec(expr.op0())));
67+
return not_exprt(is_zero(expr.op0()));
6868
else if(expr.id()==ID_floatbv_plus)
6969
return add_sub(false, expr.op0(), expr.op1(), expr.op2(), get_spec(expr));
7070
else if(expr.id()==ID_floatbv_minus)
@@ -129,8 +129,8 @@ exprt float_bvt::is_equal(
129129
const ieee_float_spect &spec)
130130
{
131131
// special cases: -0 and 0 are equal
132-
exprt is_zero0=is_zero(src0, spec);
133-
exprt is_zero1=is_zero(src1, spec);
132+
const exprt is_zero0 = is_zero(src0);
133+
const exprt is_zero1 = is_zero(src1);
134134
const and_exprt both_zero(is_zero0, is_zero1);
135135

136136
// NaN compares to nothing
@@ -145,9 +145,7 @@ exprt float_bvt::is_equal(
145145
not_exprt(nan));
146146
}
147147

148-
exprt float_bvt::is_zero(
149-
const exprt &src,
150-
const ieee_float_spect &spec)
148+
exprt float_bvt::is_zero(const exprt &src)
151149
{
152150
// we mask away the sign bit, which is the most significant bit
153151
const floatbv_typet &type=to_floatbv_type(src.type());
@@ -743,8 +741,8 @@ exprt float_bvt::relation(
743741
assert(rel==relt::EQ || rel==relt::LT || rel==relt::LE);
744742

745743
// special cases: -0 and 0 are equal
746-
exprt is_zero1=is_zero(src1, spec);
747-
exprt is_zero2=is_zero(src2, spec);
744+
const exprt is_zero1 = is_zero(src1);
745+
const exprt is_zero2 = is_zero(src2);
748746
const and_exprt both_zero(is_zero1, is_zero2);
749747

750748
// NaN compares to nothing
@@ -1346,7 +1344,7 @@ float_bvt::unbiased_floatt float_bvt::unpack(
13461344
sub_bias(result.exponent, spec));
13471345

13481346
result.infinity=isinf(src, spec);
1349-
result.zero=is_zero(src, spec);
1347+
result.zero = is_zero(src);
13501348
result.NaN=isnan(src, spec);
13511349

13521350
return result;

src/solvers/floatbv/float_bv.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class float_bvt
3636
exprt negation(const exprt &, const ieee_float_spect &);
3737
exprt abs(const exprt &, const ieee_float_spect &);
3838
exprt is_equal(const exprt &, const exprt &, const ieee_float_spect &);
39-
exprt is_zero(const exprt &, const ieee_float_spect &);
39+
exprt is_zero(const exprt &);
4040
exprt isnan(const exprt &, const ieee_float_spect &);
4141
exprt isinf(const exprt &, const ieee_float_spect &);
4242
exprt isnormal(const exprt &, const ieee_float_spect &);

0 commit comments

Comments
 (0)