summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/deps.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2017-04-15 20:11:43 +0200
committerAndrew Gregory <andrew.gregory.8@gmail.com>2017-04-16 14:26:13 +0200
commit9c763a0d1ba8aa56b1ff54cd8d137c6b73e19f11 (patch)
treeb0517e981cbca5b31247dec71fca5175afeb722b /lib/libalpm/deps.c
parent13ec13c85e4ea39e51d58b0842d8bef50e2ae369 (diff)
downloadpacman-9c763a0d1ba8aa56b1ff54cd8d137c6b73e19f11.tar.gz
pacman-9c763a0d1ba8aa56b1ff54cd8d137c6b73e19f11.tar.xz
graph.h: replace hardcoded values with an enum
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Diffstat (limited to 'lib/libalpm/deps.c')
-rw-r--r--lib/libalpm/deps.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 40b2be6d..e5527d6c 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -194,16 +194,16 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle,
vertex = vertices->data;
while(vptr) {
/* mark that we touched the vertex */
- vertex->state = -1;
+ vertex->state = ALPM_GRAPH_STATE_PROCESSING;
int found = 0;
while(vertex->childptr && !found) {
alpm_graph_t *nextchild = vertex->childptr->data;
vertex->childptr = vertex->childptr->next;
- if(nextchild->state == 0) {
+ if(nextchild->state == ALPM_GRAPH_STATE_UNPROCESSED) {
found = 1;
nextchild->parent = vertex;
vertex = nextchild;
- } else if(nextchild->state == -1) {
+ } else if(nextchild->state == ALPM_GRAPH_STATE_PROCESSING) {
/* child is an ancestor of vertex */
alpm_graph_t *transvertex = vertex;
@@ -244,13 +244,13 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle,
newtargs = alpm_list_add(newtargs, vertex->data);
}
/* mark that we've left this vertex */
- vertex->state = 1;
+ vertex->state = ALPM_GRAPH_STATE_PROCESSED;
vertex = vertex->parent;
if(!vertex) {
/* top level vertex reached, move to the next unprocessed vertex */
for( vptr = vptr->next; vptr; vptr = vptr->next) {
vertex = vptr->data;
- if(vertex->state == 0) {
+ if(vertex->state == ALPM_GRAPH_STATE_UNPROCESSED) {
break;
}
}