]> granicus.if.org Git - graphviz/commitdiff
GetBranches: move definition of i closer to its use and use a better type
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 24 Mar 2021 04:00:48 +0000 (21:00 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 31 Mar 2021 00:14:01 +0000 (17:14 -0700)
lib/label/split.q.c

index d71f5612e76b4b8fe83e3e8c9d0881a56b009d9d..84173c61b3855b817e55b06964696d5de94aa66d 100644 (file)
@@ -95,13 +95,11 @@ void SplitNode(RTree_t * rtp, Node_t * n, Branch_t * b, Node_t ** nn)
 -----------------------------------------------------------------------------*/
 static void GetBranches(RTree_t * rtp, Node_t * n, Branch_t * b)
 {
-    int i;
-
     assert(n);
     assert(b);
 
     /* load the branch buffer */
-    for (i = 0; i < NODECARD; i++) {
+    for (size_t i = 0; i < NODECARD; i++) {
        assert(n->branch[i].child);     /* node should have every entry full */
        rtp->split.BranchBuf[i] = n->branch[i];
     }
@@ -109,7 +107,7 @@ static void GetBranches(RTree_t * rtp, Node_t * n, Branch_t * b)
 
     /* calculate rect containing all in the set */
     rtp->split.CoverSplit = rtp->split.BranchBuf[0].rect;
-    for (i = 1; i < NODECARD + 1; i++) {
+    for (size_t i = 1; i < NODECARD + 1; i++) {
        rtp->split.CoverSplit = CombineRect(&rtp->split.CoverSplit,
                                            &rtp->split.BranchBuf[i].rect);
     }