From 31cfd60943fad56706c193a69eafe4a02dfcdae7 Mon Sep 17 00:00:00 2001 From: Sam Hatchett Date: Mon, 24 Jun 2024 15:10:06 -0400 Subject: [PATCH] fixes compilation with old compilers and keeps our programming conventions of declaring variables --- src/epanet.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/epanet.c b/src/epanet.c index 8583c14e..991024cd 100644 --- a/src/epanet.c +++ b/src/epanet.c @@ -2367,9 +2367,9 @@ int DLLEXPORT EN_getnodevalues(EN_Project p, int property, double *values) **---------------------------------------------------------------- */ { - int status = 0; + int status = 0, i = 0; - for (int i = 1; i <= p->network.Nnodes; i++) + for (i = 1; i <= p->network.Nnodes; i++) { status = EN_getnodevalue(p, i, property, &values[i - 1]); // if status is not 0, return the error code @@ -3939,8 +3939,8 @@ int DLLEXPORT EN_getlinkvalues(EN_Project p, int property, double *values) **---------------------------------------------------------------- */ { - int status = 0; - for(int i = 1; i <= p->network.Nlinks; i++) + int status = 0, i = 0; + for(i = 1; i <= p->network.Nlinks; i++) { status = EN_getlinkvalue(p, i, property, &values[i-1]); // If an error occurs, return the error code