]> granicus.if.org Git - graphviz/commitdiff
Re-do some .h files to limit exposure of internal values, .h files,
authorerg <devnull@localhost>
Thu, 7 Dec 2006 22:49:37 +0000 (22:49 +0000)
committererg <devnull@localhost>
Thu, 7 Dec 2006 22:49:37 +0000 (22:49 +0000)
and dependencies on config.h; return to a simple, concrete boolean type

lib/neatogen/dijkstra.c
lib/neatogen/embed_graph.h

index d6e6761cce7d5a9345f1e59c4e573dae5525fee7..d7be8edf693cdae72ee6da735a2b3d8d9c14d7ff 100644 (file)
@@ -34,7 +34,7 @@
 
 typedef DistType Word;
 
-#define LOOP while(true)
+#define LOOP while(TRUE)
 
 /* This heap class is suited to the Dijkstra alg.
    data[i]=vertexNum <==> index[vertexNum]=i
@@ -118,10 +118,10 @@ initHeap(heap * h, int startVertex, int index[], Word dist[], int n)
        heapify(h, j, index, dist);
 }
 
-static bool extractMax(heap * h, int *max, int index[], Word dist[])
+static boolean extractMax(heap * h, int *max, int index[], Word dist[])
 {
     if (h->heapSize == 0)
-       return false;
+       return FALSE;
 
     *max = h->data[0];
     h->data[0] = h->data[h->heapSize - 1];
@@ -129,7 +129,7 @@ static bool extractMax(heap * h, int *max, int index[], Word dist[])
     h->heapSize--;
     heapify(h, 0, index, dist);
 
-    return true;
+    return TRUE;
 }
 
 static void
@@ -208,7 +208,7 @@ dijkstra_bounded(int vertex, vtx_data * graph, int n, DistType * dist,
 {
     int num_visited_nodes;
     int i;
-    static bool *node_in_neighborhood = NULL;
+    static boolean *node_in_neighborhood = NULL;
     static int size = 0;
     static int *index;
     Queue Q;
@@ -227,14 +227,14 @@ dijkstra_bounded(int vertex, vtx_data * graph, int n, DistType * dist,
        bfs_bounded(vertex, graph, n, dist, &Q, bound, visited_nodes);
     if (size < n) {
        node_in_neighborhood =
-           (bool *) realloc(node_in_neighborhood, n * sizeof(bool));
+           (boolean *) realloc(node_in_neighborhood, n * sizeof(boolean));
        for (i = size; i < n; i++) {
-           node_in_neighborhood[i] = false;
+           node_in_neighborhood[i] = FALSE;
        }
        size = n;
     }
     for (i = 0; i < num_visited_nodes; i++) {
-       node_in_neighborhood[visited_nodes[i]] = true;
+       node_in_neighborhood[visited_nodes[i]] = TRUE;
     }
 
 
@@ -272,7 +272,7 @@ dijkstra_bounded(int vertex, vtx_data * graph, int n, DistType * dist,
 
     /* restore initial false-status of 'node_in_neighborhood' */
     for (i = 0; i < num_visited_nodes; i++) {
-       node_in_neighborhood[visited_nodes[i]] = false;
+       node_in_neighborhood[visited_nodes[i]] = FALSE;
     }
     freeHeap(&H);
     freeQueue(&Q);
@@ -319,10 +319,10 @@ initHeap_f(heap * h, int startVertex, int index[], float dist[], int n)
        heapify_f(h, j, index, dist);
 }
 
-static bool extractMax_f(heap * h, int *max, int index[], float dist[])
+static boolean extractMax_f(heap * h, int *max, int index[], float dist[])
 {
     if (h->heapSize == 0)
-       return false;
+       return FALSE;
 
     *max = h->data[0];
     h->data[0] = h->data[h->heapSize - 1];
@@ -330,7 +330,7 @@ static bool extractMax_f(heap * h, int *max, int index[], float dist[])
     h->heapSize--;
     heapify_f(h, 0, index, dist);
 
-    return true;
+    return TRUE;
 }
 
 static void
index a46e99a009b274865529e6e804a7839547c47c11..cad6eb109ea49d09c0cf2c0642c32a149a5f59a2 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
     void PCA(DistType ** coords, int dim, int n, double **(&new_coords),
             int new_dim);
     void PCA(DistType ** coords, int dim, int n, double **(&new_coords),
-            int dim1, int dim2, bool recompute);
+            int dim1, int dim2, boolean recompute);
     void PCA_orthog(DistType ** coords, int dim, int n,
                    double **(&new_coords), int new_dim, double *orthog);
     void iterativePCA(DistType ** coords, int dim, int n,