]> granicus.if.org Git - graphviz/commitdiff
squash a -Wshadow warning in SparseMatrix_import_dot
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Apr 2021 04:00:24 +0000 (21:00 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 14 May 2021 00:03:36 +0000 (17:03 -0700)
By moving sz closer to its use location it is moved passed a nested declaration
of a different variable also called sz.

lib/sparse/DotIO.c

index 59cb331a78b14c341b28de8dd1f47efb624487e3..a7d929603ae7c8f1cdcecb3938cbf0e7b49d6204 100644 (file)
@@ -103,7 +103,6 @@ SparseMatrix_import_dot (Agraph_t* g, int dim, real **label_sizes, real **x, int
   real *val, *valD = NULL;
   real v;
   int type = MATRIX_TYPE_REAL;
-  size_t sz = sizeof(real);
   real padding = 10;
   int nedge_nodes = 0;
 
@@ -261,6 +260,7 @@ SparseMatrix_import_dot (Agraph_t* g, int dim, real **label_sizes, real **x, int
   else if (x)
     agerr (AGERR, "Error: graph %s has missing \"pos\" information", agnameof(g));
 
+  size_t sz = sizeof(real);
   if (format == FORMAT_CSR) A = SparseMatrix_from_coordinate_arrays(nedges, nnodes, nnodes, I, J, val, type, sz);
   if (edge_label_nodes) *n_edge_label_nodes = nedge_nodes;