]> granicus.if.org Git - graphviz/commitdiff
neatogen: remove unused 'total_gap' in 'constrained_majorization_new_with_gaps'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 14 May 2022 02:31:41 +0000 (19:31 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 14 May 2022 02:31:41 +0000 (19:31 -0700)
The CMake macOS CI job has begun erroring out:

  …/lib/neatogen/quad_prog_solve.c:602:11: error: variable 'total_gap' set but
    not used [-Werror,-Wunused-but-set-variable]
    float total_gap, target_place;
          ^

While the error is accurate, nothing has changed on our side that would have
caused this. I can only assume Gitlab have upgraded the macOS runners to pull in
a new version of Clang.

lib/neatogen/quad_prog_solve.c

index 2617ee19c43bc22c23548b175070945e15a6f98a..233c939a2b0e2500ac1ab367597090aedba648a6 100644 (file)
@@ -599,7 +599,7 @@ constrained_majorization_new_with_gaps(CMajEnv * e, float *b,
     int level = -1, max_in_level = 0;
     int counter;
     float *gap;
-    float total_gap, target_place;
+    float target_place;
 
     if (max_iterations <= 0) {
        return 0;
@@ -651,14 +651,12 @@ constrained_majorization_new_with_gaps(CMajEnv * e, float *b,
             * nodes connected with active constraints
             */
            cur_place = place[ordering[left]];
-           total_gap = 0;
            target_place = cur_place;
            gap[ordering[left]] = 0;
            for (right = left + 1; right < n; right++) {
                if (lev[right] > lev[right - 1]) {
                    /* we are entering a new level */
                    target_place += levels_gap; /* note that 'levels_gap' may be negative */
-                   total_gap += levels_gap;
                }
                node = ordering[right];
                    /* not sure if this is better than 'place[node]!=target_place' */