Skip to content

Commit ca682e0

Browse files
author
Daniel Kroening
committed
graph node numbers are now size_t
1 parent c0e1999 commit ca682e0

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/goto-instrument/wmm/goto2graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ unsigned instrumentert::goto2graph_cfg(
122122
visitor.visit_cfg(value_sets, model, no_dependencies, duplicate_body,
123123
goto_functions.entry_point());
124124

125-
std::vector<unsigned> subgraph_index;
125+
std::vector<std::size_t> subgraph_index;
126126
num_sccs = egraph_alt.SCCs(subgraph_index);
127127
assert(egraph_SCCs.empty());
128128
egraph_SCCs.resize(num_sccs, std::set<unsigned>());

src/util/graph.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ template<class E=empty_edget>
2525
class graph_nodet
2626
{
2727
public:
28-
typedef unsigned node_indext;
28+
typedef std::size_t node_indext;
2929

3030
typedef E edget;
3131
typedef std::map<node_indext, edget> edgest;
@@ -39,7 +39,7 @@ class graph_nodet
3939

4040
inline void add_out(node_indext n)
4141
{
42-
out.insert(std::pair<unsigned, edget>(n, edget()));
42+
out.insert(std::pair<node_indext, edget>(n, edget()));
4343
}
4444

4545
inline void erase_in(node_indext n)
@@ -229,12 +229,12 @@ class graph
229229
std::vector<unsigned> depth;
230230
std::vector<unsigned> lowlink;
231231
std::vector<bool> in_scc;
232-
std::stack<unsigned> scc_stack;
233-
std::vector<unsigned> &subgraph_nr;
232+
std::stack<node_indext> scc_stack;
233+
std::vector<node_indext> &subgraph_nr;
234234

235-
unsigned scc_count, max_dfs;
235+
std::size_t scc_count, max_dfs;
236236

237-
tarjant(unsigned n, std::vector<unsigned> &_subgraph_nr):
237+
tarjant(std::size_t n, std::vector<node_indext> &_subgraph_nr):
238238
subgraph_nr(_subgraph_nr)
239239
{
240240
visited.resize(n, false);
@@ -246,7 +246,7 @@ class graph
246246
}
247247
};
248248

249-
void tarjan(class tarjant &t, unsigned v);
249+
void tarjan(class tarjant &t, node_indext v);
250250

251251
void shortest_path(
252252
node_indext src,
@@ -518,7 +518,7 @@ std::size_t graph<N>::connected_subgraphs(
518518
visited.resize(nodes.size(), false);
519519
subgraph_nr.resize(nodes.size(), 0);
520520

521-
unsigned nr=0;
521+
std::size_t nr=0;
522522

523523
for(node_indext src=0; src<size(); src++)
524524
{
@@ -566,7 +566,7 @@ Function: graph::tarjan
566566
\*******************************************************************/
567567

568568
template<class N>
569-
void graph<N>::tarjan(tarjant &t, unsigned v)
569+
void graph<N>::tarjan(tarjant &t, node_indext v)
570570
{
571571
t.scc_stack.push(v);
572572
t.in_scc[v]=true;
@@ -581,7 +581,7 @@ void graph<N>::tarjan(tarjant &t, unsigned v)
581581
it!=node.out.end();
582582
it++)
583583
{
584-
unsigned vp=it->first;
584+
node_indext vp=it->first;
585585
if(!t.visited[vp])
586586
{
587587
tarjan(t, vp);
@@ -597,7 +597,7 @@ void graph<N>::tarjan(tarjant &t, unsigned v)
597597
while(true)
598598
{
599599
assert(!t.scc_stack.empty());
600-
unsigned vp=t.scc_stack.top();
600+
node_indext vp=t.scc_stack.top();
601601
t.scc_stack.pop();
602602
t.in_scc[vp]=false;
603603
t.subgraph_nr[vp]=t.scc_count;

0 commit comments

Comments
 (0)