Skip to content

Commit 45436ce

Browse files
author
Daniel Kroening
committed
use std::size_t for container sizes
1 parent 0c26a53 commit 45436ce

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/solvers/smt2/smt2_conv.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -287,24 +287,24 @@ constant_exprt smt2_convt::parse_literal(
287287
src.get_sub()[0].id()=="_" &&
288288
src.get_sub()[1].id()=="+oo") // (_ +oo e s)
289289
{
290-
unsigned e=unsafe_string2unsigned(src.get_sub()[2].id_string());
291-
unsigned s=unsafe_string2unsigned(src.get_sub()[3].id_string());
290+
std::size_t e = unsafe_string2size_t(src.get_sub()[2].id_string());
291+
std::size_t s = unsafe_string2size_t(src.get_sub()[3].id_string());
292292
return ieee_floatt::plus_infinity(ieee_float_spect(s, e)).to_expr();
293293
}
294294
else if(src.get_sub().size()==4 &&
295295
src.get_sub()[0].id()=="_" &&
296296
src.get_sub()[1].id()=="-oo") // (_ -oo e s)
297297
{
298-
unsigned e=unsafe_string2unsigned(src.get_sub()[2].id_string());
299-
unsigned s=unsafe_string2unsigned(src.get_sub()[3].id_string());
298+
std::size_t e = unsafe_string2size_t(src.get_sub()[2].id_string());
299+
std::size_t s = unsafe_string2size_t(src.get_sub()[3].id_string());
300300
return ieee_floatt::minus_infinity(ieee_float_spect(s, e)).to_expr();
301301
}
302302
else if(src.get_sub().size()==4 &&
303303
src.get_sub()[0].id()=="_" &&
304304
src.get_sub()[1].id()=="NaN") // (_ NaN e s)
305305
{
306-
unsigned e=unsafe_string2unsigned(src.get_sub()[2].id_string());
307-
unsigned s=unsafe_string2unsigned(src.get_sub()[3].id_string());
306+
std::size_t e = unsafe_string2size_t(src.get_sub()[2].id_string());
307+
std::size_t s = unsafe_string2size_t(src.get_sub()[3].id_string());
308308
return ieee_floatt::NaN(ieee_float_spect(s, e)).to_expr();
309309
}
310310

@@ -4333,7 +4333,7 @@ void smt2_convt::find_symbols(const exprt &expr)
43334333
<< " -> " << type2id(expr.type()) << "\n"
43344334
<< "(define-fun " << function << " (";
43354335

4336-
for(unsigned i=0; i<expr.operands().size(); i++)
4336+
for(std::size_t i = 0; i < expr.operands().size(); i++)
43374337
{
43384338
if(i!=0)
43394339
out << " ";
@@ -4347,7 +4347,7 @@ void smt2_convt::find_symbols(const exprt &expr)
43474347
out << ' ';
43484348

43494349
exprt tmp1=expr;
4350-
for(unsigned i=0; i<tmp1.operands().size(); i++)
4350+
for(std::size_t i = 0; i < tmp1.operands().size(); i++)
43514351
tmp1.operands()[i]=
43524352
smt2_symbolt("op"+std::to_string(i), tmp1.operands()[i].type());
43534353

@@ -4751,7 +4751,7 @@ exprt smt2_convt::letify_rec(
47514751
exprt &expr,
47524752
std::vector<exprt> &let_order,
47534753
const seen_expressionst &map,
4754-
unsigned i)
4754+
std::size_t i)
47554755
{
47564756
if(i>=let_order.size())
47574757
return substitute_let(expr, map);

src/solvers/smt2/smt2_conv.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ class smt2_convt:public prop_convt
182182
};
183183

184184
typedef std::unordered_map<exprt, let_count_idt, irep_hash> seen_expressionst;
185-
unsigned let_id_count;
186-
static const unsigned LET_COUNT=2;
185+
std::size_t let_id_count;
186+
static const std::size_t LET_COUNT = 2;
187187

188188
class let_visitort:public expr_visitort
189189
{
@@ -208,7 +208,7 @@ class smt2_convt:public prop_convt
208208
exprt &expr,
209209
std::vector<exprt> &let_order,
210210
const seen_expressionst &map,
211-
unsigned i);
211+
std::size_t i);
212212

213213
void collect_bindings(
214214
exprt &expr,
@@ -303,7 +303,7 @@ class smt2_convt:public prop_convt
303303
smt2_identifierst smt2_identifiers;
304304

305305
// Boolean part
306-
unsigned no_boolean_variables;
306+
std::size_t no_boolean_variables;
307307
std::vector<bool> boolean_assignment;
308308
};
309309

0 commit comments

Comments
 (0)