From: Matthew Fernandez Date: Sat, 24 Apr 2021 04:00:24 +0000 (-0700) Subject: squash a -Wshadow warning in SparseMatrix_import_dot X-Git-Tag: 2.47.2~13^2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b00d0d9d7f6f7387560797991a2b9bbdb9b80d39;p=graphviz squash a -Wshadow warning in SparseMatrix_import_dot By moving sz closer to its use location it is moved passed a nested declaration of a different variable also called sz. --- diff --git a/lib/sparse/DotIO.c b/lib/sparse/DotIO.c index 59cb331a7..a7d929603 100644 --- a/lib/sparse/DotIO.c +++ b/lib/sparse/DotIO.c @@ -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;