Skip to content

Commit 06193a6

Browse files
committed
use std::size_t
1 parent 5b0fb8e commit 06193a6

File tree

13 files changed

+49
-45
lines changed

13 files changed

+49
-45
lines changed

src/analyses/goto_check.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,11 @@ void goto_checkt::integer_overflow_check(
342342

343343
if(type.id()==ID_signedbv)
344344
{
345-
unsigned new_width=to_signedbv_type(type).get_width();
345+
std::size_t new_width=to_signedbv_type(type).get_width();
346346

347347
if(old_type.id()==ID_signedbv) // signed -> signed
348348
{
349-
unsigned old_width=to_signedbv_type(old_type).get_width();
349+
std::size_t old_width=to_signedbv_type(old_type).get_width();
350350
if(new_width>=old_width) return; // always ok
351351

352352
binary_relation_exprt no_overflow_upper(ID_le);
@@ -367,7 +367,7 @@ void goto_checkt::integer_overflow_check(
367367
}
368368
else if(old_type.id()==ID_unsignedbv) // unsigned -> signed
369369
{
370-
unsigned old_width=to_unsignedbv_type(old_type).get_width();
370+
std::size_t old_width=to_unsignedbv_type(old_type).get_width();
371371
if(new_width>=old_width+1) return; // always ok
372372

373373
binary_relation_exprt no_overflow_upper(ID_le);
@@ -408,11 +408,11 @@ void goto_checkt::integer_overflow_check(
408408
}
409409
else if(type.id()==ID_unsignedbv)
410410
{
411-
unsigned new_width=to_unsignedbv_type(type).get_width();
411+
std::size_t new_width=to_unsignedbv_type(type).get_width();
412412

413413
if(old_type.id()==ID_signedbv) // signed -> unsigned
414414
{
415-
unsigned old_width=to_signedbv_type(old_type).get_width();
415+
std::size_t old_width=to_signedbv_type(old_type).get_width();
416416

417417
if(new_width>=old_width-1)
418418
{
@@ -451,7 +451,7 @@ void goto_checkt::integer_overflow_check(
451451
}
452452
else if(old_type.id()==ID_unsignedbv) // unsigned -> unsigned
453453
{
454-
unsigned old_width=to_unsignedbv_type(old_type).get_width();
454+
std::size_t old_width=to_unsignedbv_type(old_type).get_width();
455455
if(new_width>=old_width) return; // always ok
456456

457457
binary_relation_exprt no_overflow_upper(ID_le);

src/goto-instrument/goto_program2code.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ bool goto_program2codet::set_block_end_points(
969969
cases_listt &cases,
970970
std::set<unsigned> &processed_locations)
971971
{
972-
std::map<goto_programt::const_targett, unsigned> targets_done;
972+
std::map<goto_programt::const_targett, std::size_t> targets_done;
973973

974974
for(cases_listt::iterator it=cases.begin();
975975
it!=cases.end();

src/goto-programs/graphml_goto_trace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void convert(
155155
graphml[sink].is_violation=false;
156156

157157
// step numbers start at 1
158-
std::vector<unsigned> step_to_node(goto_trace.steps.size()+1, 0);
158+
std::vector<std::size_t> step_to_node(goto_trace.steps.size()+1, 0);
159159

160160
for(goto_tracet::stepst::const_iterator
161161
it=goto_trace.steps.begin();

src/pointer-analysis/value_set.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ void value_sett::output(
181181

182182
const object_map_dt &object_map=e.object_map.read();
183183

184-
unsigned width=0;
184+
std::size_t width=0;
185185

186186
for(object_map_dt::const_iterator
187187
o_it=object_map.begin();
@@ -1878,7 +1878,7 @@ exprt value_sett::make_member(
18781878
if(src.id()==ID_struct ||
18791879
src.id()==ID_constant)
18801880
{
1881-
unsigned no=struct_union_type.component_number(component_name);
1881+
std::size_t no=struct_union_type.component_number(component_name);
18821882
assert(no<src.operands().size());
18831883
return src.operands()[no];
18841884
}

src/pointer-analysis/value_set_fi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void value_set_fit::output(
8989
object_mapt object_map;
9090
flatten(e, object_map);
9191

92-
unsigned width=0;
92+
std::size_t width=0;
9393

9494
forall_objects(o_it, object_map.read())
9595
{

src/pointer-analysis/value_set_fivr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void value_set_fivrt::output(
117117
out << display_name << " = { ";
118118
if(object_map.read().size()!=0) out << "\n ";
119119

120-
unsigned width=0;
120+
std::size_t width=0;
121121

122122
forall_objects(o_it, object_map.read())
123123
{

src/pointer-analysis/value_set_fivrns.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void value_set_fivrnst::output_entry(
120120
out << display_name << " = { ";
121121
if(object_map.read().size()!=0) out << "\n ";
122122

123-
unsigned width=0;
123+
std::size_t width=0;
124124

125125
forall_valid_objects(o_it, object_map.read())
126126
{

src/solvers/flattening/boolbv_typecast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ bool boolbvt::type_conversion(
545545
build_offset_map(dest_struct, dest_offsets);
546546

547547
// build name map
548-
typedef std::map<irep_idt, unsigned> op_mapt;
548+
typedef std::map<irep_idt, std::size_t> op_mapt;
549549
op_mapt op_map;
550550

551551
for(std::size_t i=0; i<op_comp.size(); i++)

src/solvers/flattening/bv_pointers.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ Function: bv_pointerst::encode
678678
679679
\*******************************************************************/
680680

681-
void bv_pointerst::encode(unsigned addr, bvt &bv)
681+
void bv_pointerst::encode(std::size_t addr, bvt &bv)
682682
{
683683
bv.resize(bits);
684684

@@ -795,9 +795,9 @@ Function: bv_pointerst::add_addr
795795

796796
void bv_pointerst::add_addr(const exprt &expr, bvt &bv)
797797
{
798-
unsigned a=pointer_logic.add_object(expr);
798+
std::size_t a=pointer_logic.add_object(expr);
799799

800-
if(a==(unsigned(1)>>object_bits))
800+
if(a==(std::size_t(1)>>object_bits))
801801
throw "too many variables";
802802

803803
encode(a, bv);

src/solvers/flattening/bv_pointers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class bv_pointerst:public boolbvt
2828

2929
unsigned object_bits, offset_bits, bits;
3030

31-
void encode(unsigned object, bvt &bv);
31+
void encode(std::size_t object, bvt &bv);
3232

3333
virtual bvt convert_pointer_type(const exprt &expr);
3434

0 commit comments

Comments
 (0)