Make node numbering int rather than unsigned.

(unsigned) -1 is not what I wanted :P
This commit is contained in:
Bill Currie 2012-12-19 16:50:06 +09:00
parent 927335a29c
commit 3270bb3f5e
2 changed files with 4 additions and 4 deletions

View file

@ -63,8 +63,8 @@ typedef struct flowedge_s {
*/
typedef struct flownode_s {
struct flownode_s *next; ///< for ALLOC
unsigned id; ///< index of this node in the flow graph
unsigned dfn; ///< depth-first ordering of this node
int id; ///< index of this node in the flow graph
int dfn; ///< depth-first ordering of this node
struct flowgraph_s *graph; ///< graph owning this node
struct set_s *predecessors; ///< predecessors of this node
struct set_s *successors; ///< successors of this node
@ -101,7 +101,7 @@ typedef struct flowgraph_s {
flowedge_t *edges; ///< array of all edges in the graph
int num_edges;
struct set_s *dfst; ///< edges in the depth-first search tree
unsigned *dfo; ///< depth-first order of nodes
int *dfo; ///< depth-first order of nodes
flowloop_t *loops; ///< linked list of natural loops
} flowgraph_t;

View file

@ -1125,7 +1125,7 @@ flow_build_dfst (flowgraph_t *graph)
set_add (visited, graph->num_nodes);
set_add (visited, graph->num_nodes + 1);
graph->dfo = calloc (graph->num_nodes, sizeof (unsigned));
graph->dfo = calloc (graph->num_nodes, sizeof (int));
graph->dfst = set_new ();
i = graph->num_nodes;
df_search (graph, visited, &i, 0);