Skip to content

Commit

Permalink
Merge pull request #804 from OpenWaterAnalytics/bugfix/compiler-fix
Browse files Browse the repository at this point in the history
fixes compilation with old compilers and keeps our programming conven…
  • Loading branch information
eladsal authored Jun 25, 2024
2 parents 94d136b + 31cfd60 commit cc9105f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/epanet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cc9105f

Please sign in to comment.