From 25f79c8da371327f353031a1f1b50f7d19fdcbdf Mon Sep 17 00:00:00 2001 From: Thilina Ratnayaka Date: Tue, 21 Feb 2023 14:46:42 -0600 Subject: [PATCH] Fix a few compiler warnings --- src/con.c | 3 ++- src/laplacian.c | 8 +++++--- src/mat.c | 4 ++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/con.c b/src/con.c index 97ad705e..8014a987 100644 --- a/src/con.c +++ b/src/con.c @@ -1321,7 +1321,8 @@ int parrsb_conn_mesh(long long *vtx, double *coord, int nelt, int ndim, int verbose = 0; { const char *val = getenv("PARRSB_VERBOSE_LEVEL"); - if (val != NULL) verbose= atoi(val); + if (val != NULL) + verbose = atoi(val); } if (c.id == 0 && verbose > 0) { diff --git a/src/laplacian.c b/src/laplacian.c index 59d91673..1873b742 100644 --- a/src/laplacian.c +++ b/src/laplacian.c @@ -133,8 +133,8 @@ static int par_csc(scalar *v, const struct laplacian *l, scalar *u, mat_vec_csr(v, u, L->M, L->gsh, L->buf, bfr); return 0; } - return 1; #endif + return 1; } static int par_csr_free(struct laplacian *l) { @@ -144,7 +144,9 @@ static int par_csr_free(struct laplacian *l) { gs_free(L->gsh); free(L->buf); free(L), L = NULL; + return 0; } + return 1; } //------------------------------------------------------------------------------ @@ -218,8 +220,8 @@ static int gs_weighted_free(struct laplacian *l) { free(gl->diag); gs_free(gl->gsh); - free(l->data); - l->data = NULL; + free(l->data), l->data = NULL; + return 0; } //------------------------------------------------------------------------------ diff --git a/src/mat.c b/src/mat.c index 1788aeca..34c27c21 100644 --- a/src/mat.c +++ b/src/mat.c @@ -55,6 +55,8 @@ int compress_nbrs(struct array *eij, struct array *nbr, buffer *bfr) { pe[k].v = -s; i = j; } + + return 0; } int csr_setup(struct mat *mat, struct array *entries, int sep, buffer *buf) { @@ -741,6 +743,8 @@ static int compress_mij(struct array *eij, struct array *entries, buffer *bfr) { pe[k].v = -s; i = j; } + + return 0; } struct par_mat *par_csr_setup_con(const uint nelt, const ulong *eid,