From: Matthew Fernandez Date: Wed, 18 Jan 2023 16:24:45 +0000 (-0800) Subject: mingle nearest_neighbor_graph: squash warnings when building without libANN X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d43999448fd000c65ff506e09b2db5bd1d76b591;p=graphviz mingle nearest_neighbor_graph: squash warnings when building without libANN --- diff --git a/lib/mingle/nearest_neighbor_graph.cpp b/lib/mingle/nearest_neighbor_graph.cpp index bd1f6ab2a..aa731bd40 100644 --- a/lib/mingle/nearest_neighbor_graph.cpp +++ b/lib/mingle/nearest_neighbor_graph.cpp @@ -27,11 +27,12 @@ SparseMatrix nearest_neighbor_graph(int nPts, int num_neighbors, double *x, doub x: nPts*dim vector. The i-th point is x[i*dim : i*dim + dim - 1] */ + SparseMatrix A = NULL; + +#ifdef HAVE_ANN int nz; - SparseMatrix A; int k = num_neighbors; -#ifdef HAVE_ANN /* need to *2 as we do two sweeps of neighbors, so could have repeats */ std::vector irn(nPts * k * 2); std::vector jcn(nPts * k * 2); @@ -43,7 +44,10 @@ SparseMatrix nearest_neighbor_graph(int nPts, int num_neighbors, double *x, doub jcn.data(), val.data(), MATRIX_TYPE_REAL, sizeof(double)); #else - A = NULL; + (void)nPts; + (void)num_neighbors; + (void)x; + (void)eps; #endif return A;