]> granicus.if.org Git - graphviz/commitdiff
remove some variable shadowing in node_distinct_coloring_internal2
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 20 Jun 2021 18:59:51 +0000 (11:59 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Jun 2021 21:27:36 +0000 (14:27 -0700)
Squashes two -Wshadow warnings.

lib/edgepaint/node_distinct_coloring.c

index 14a8d896edbda81a70a21960a85f992a1acaa415..8e61c4dea0a7c351ae384213176c106b60fc9cb4 100644 (file)
@@ -43,8 +43,6 @@ static void node_distinct_coloring_internal2(int scheme, QuadTree qt, int weight
   real cspace_size = 0.7;
   real red[3], black[3], min;
   int flag = 0, imin;
-  color_lab lab;
-  color_rgb rgb;
   real *wgt = NULL;
   //int iter2 = 0, iter_max2;
 
@@ -52,9 +50,11 @@ static void node_distinct_coloring_internal2(int scheme, QuadTree qt, int weight
   max_level = MAX(1, -log(accuracy)/log(2.));
   max_level = MIN(30, max_level);
 
-  rgb.r = 255*0.5; rgb.g = 0; rgb.b = 0;
-  lab = RGB2LAB(rgb);
-  red[0] = lab.l; red[1] = lab.a; red[2] = lab.b;
+  {
+    color_rgb rgb = { .r = 255*0.5, .g = 0, .b = 0 };
+    color_lab lab = RGB2LAB(rgb);
+    red[0] = lab.l; red[1] = lab.a; red[2] = lab.b;
+  }
 
   n = A->m;
   if (n == 1){