Skip to content

Commit 8834dc5

Browse files
committed
Local bitvector analysis: cleanup improver use of unsigned
The correct type is std::size_t in all cases. Use `auto` where the type can be inferred, and the typedef'd name where it's `local_cfgt`'s business to choose the type.
1 parent 472a393 commit 8834dc5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/analyses/local_bitvector_analysis.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void local_bitvector_analysist::assign_lhs(
7070

7171
if(is_tracked(identifier))
7272
{
73-
unsigned dest_pointer=pointers.number(identifier);
73+
const auto dest_pointer = pointers.number(identifier);
7474
flagst rhs_flags=get_rec(rhs, loc_info_src);
7575
loc_info_dest[dest_pointer]=rhs_flags;
7676
}
@@ -125,7 +125,7 @@ local_bitvector_analysist::flagst local_bitvector_analysist::get_rec(
125125
const irep_idt &identifier=to_symbol_expr(rhs).get_identifier();
126126
if(is_tracked(identifier))
127127
{
128-
unsigned src_pointer=pointers.number(identifier);
128+
const auto src_pointer = pointers.number(identifier);
129129
return loc_info_src[src_pointer];
130130
}
131131
else
@@ -239,7 +239,7 @@ void local_bitvector_analysist::build()
239239
if(cfg.nodes.empty())
240240
return;
241241

242-
std::set<unsigned> work_queue;
242+
std::set<local_cfgt::node_nrt> work_queue;
243243
work_queue.insert(0);
244244

245245
loc_infos.resize(cfg.nodes.size());
@@ -255,7 +255,7 @@ void local_bitvector_analysist::build()
255255

256256
while(!work_queue.empty())
257257
{
258-
unsigned loc_nr = *work_queue.begin();
258+
const auto loc_nr = *work_queue.begin();
259259
const local_cfgt::nodet &node=cfg.nodes[loc_nr];
260260
const goto_programt::instructiont &instruction=*node.t;
261261
work_queue.erase(work_queue.begin());
@@ -345,7 +345,7 @@ void local_bitvector_analysist::output(
345345
const goto_functiont &goto_function,
346346
const namespacet &ns) const
347347
{
348-
unsigned l=0;
348+
std::size_t l = 0;
349349

350350
for(const auto &instruction : goto_function.body.instructions)
351351
{

0 commit comments

Comments
 (0)