From: erg Date: Thu, 7 Dec 2006 22:49:36 +0000 (+0000) Subject: Re-do some .h files to limit exposure of internal values, .h files, X-Git-Tag: LAST_LIBGRAPH~32^2~5773 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=597323b6b54c3135761ab8f29c464b3c2b7e3500;p=graphviz Re-do some .h files to limit exposure of internal values, .h files, and dependencies on config.h; return to a simple, concrete boolean type --- diff --git a/lib/neatogen/bfs.c b/lib/neatogen/bfs.c index b1a9933b9..5b64d02bd 100644 --- a/lib/neatogen/bfs.c +++ b/lib/neatogen/bfs.c @@ -154,20 +154,20 @@ void initQueue(Queue * qp, int startVertex) qp->end = 1; } -bool deQueue(Queue * qp, int *vertex) +boolean deQueue(Queue * qp, int *vertex) { if (qp->start >= qp->end) - return false; /* underflow */ + return FALSE; /* underflow */ *vertex = qp->data[qp->start++]; - return true; + return TRUE; } -bool enQueue(Queue * qp, int vertex) +boolean enQueue(Queue * qp, int vertex) { if (qp->end >= qp->queueSize) - return false; /* overflow */ + return FALSE; /* overflow */ qp->data[qp->end++] = vertex; - return true; + return TRUE; } #endif diff --git a/lib/neatogen/bfs.h b/lib/neatogen/bfs.h index a027d91dd..3b658cf56 100644 --- a/lib/neatogen/bfs.h +++ b/lib/neatogen/bfs.h @@ -79,8 +79,8 @@ extern "C" { extern void mkQueue(Queue *, int); extern void freeQueue(Queue *); extern void initQueue(Queue *, int startVertex); - extern bool deQueue(Queue *, int *); - extern bool enQueue(Queue *, int); + extern boolean deQueue(Queue *, int *); + extern boolean enQueue(Queue *, int); extern void bfs(int, vtx_data *, int, DistType *, Queue *); extern int bfs_bounded(int, vtx_data *, int, DistType *, Queue *, int, diff --git a/lib/neatogen/closest.c b/lib/neatogen/closest.c index ee6e13d5b..51636bef7 100644 --- a/lib/neatogen/closest.c +++ b/lib/neatogen/closest.c @@ -71,9 +71,9 @@ static void freeStack(PairStack * s) s->data[s->top++] = x; \ } -#define pop(s,x) ((s->top==0) ? false : (s->top--, x = s->data[s->top], true)) +#define pop(s,x) ((s->top==0) ? FALSE : (s->top--, x = s->data[s->top], TRUE)) -#define read_top(h,x) ((s->top==0) ? false : (x = s->data[s->top-1], true)) +#define read_top(h,x) ((s->top==0) ? FALSE : (x = s->data[s->top-1], TRUE)) #define sub(h,i) (h->data[i]) @@ -162,16 +162,16 @@ static void initHeap(PairHeap * h, double *place, int *ordering, int n) } } -static bool extractMax(PairHeap * h, Pair * max) +static boolean extractMax(PairHeap * h, Pair * max) { if (h->heapSize == 0) - return false; + return FALSE; *max = h->data[0]; h->data[0] = h->data[h->heapSize - 1]; h->heapSize--; heapify(h, 0); - return true; + return TRUE; } static void insert(PairHeap * h, Pair edge) @@ -197,11 +197,11 @@ isheap(PairHeap* h) for (i=0; iheapSize; i++) { l=left(i); r=right(i); if (insideHeap(h,l) && greaterPriority(h,l,i)) - return false; + return FALSE; if (insideHeap(h,r) && greaterPriority(h,r,i)) - return false; + return FALSE; } - return true; + return TRUE; } */ diff --git a/lib/neatogen/conjgrad.c b/lib/neatogen/conjgrad.c index 62cf570b8..813172cff 100644 --- a/lib/neatogen/conjgrad.c +++ b/lib/neatogen/conjgrad.c @@ -95,7 +95,7 @@ void conjugate_gradient void conjugate_gradient_f (float **A, double *x, double *b, int n, double tol, - int max_iterations, bool ortho1) { + int max_iterations, boolean ortho1) { /* Solves Ax=b using Conjugate-Gradients method */ /* 'x' and 'b' are orthogonalized against 1 if 'ortho1=true' */ diff --git a/lib/neatogen/conjgrad.h b/lib/neatogen/conjgrad.h index d482d7f01..b6d4ec5ac 100644 --- a/lib/neatogen/conjgrad.h +++ b/lib/neatogen/conjgrad.h @@ -37,7 +37,7 @@ extern "C" { ************************/ extern void conjugate_gradient_f(float **, double *, double *, int, - double, int, bool); + double, int, boolean); extern void conjugate_gradient_mkernel(float *, float *, float *, int, double, int);