From 2b7f91980a6d8b168693755be108e6ff4fe0b1da Mon Sep 17 00:00:00 2001 From: eldemet Date: Tue, 16 Jul 2013 15:14:38 +0300 Subject: [PATCH] Update epanet.c Problem when compiling the DLL using the MSVC++ 2010 Express. Proposed change: Define `int iPoint;' before the for-loop Error message reference: 1>epanet.c(1767): error C2143: syntax error : missing ';' before 'type' 1>epanet.c(1767): error C2143: syntax error : missing ';' before 'type' 1>epanet.c(1767): error C2143: syntax error : missing ')' before 'type' 1>epanet.c(1767): error C2143: syntax error : missing ';' before 'type' 1>epanet.c(1767): error C2065: 'iPoint' : undeclared identifier 1>epanet.c(1767): warning C4552: '<' : operator has no effect; expected operator with side-effect 1>epanet.c(1767): error C2065: 'iPoint' : undeclared identifier 1>epanet.c(1767): error C2059: syntax error : ')' 1>epanet.c(1767): error C2143: syntax error : missing ';' before '{' 1>epanet.c(1768): error C2065: 'iPoint' : undeclared identifier 1>epanet.c(1769): error C2065: 'iPoint' : undeclared identifier 1>epanet.c(1770): error C2065: 'iPoint' : undeclared identifier 1>epanet.c(1771): error C2065: 'iPoint' : undeclared identifier --- src/epanet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/epanet.c b/src/epanet.c index 69095a4..9e23e9f 100755 --- a/src/epanet.c +++ b/src/epanet.c @@ -1764,7 +1764,8 @@ int DLLEXPORT ENgetcurve(int curveIndex, int *nValues, float **xValues, float * float *pointX = calloc(nPoints, sizeof(float)); float *pointY = calloc(nPoints, sizeof(float)); - for (int iPoint = 0; iPoint < nPoints; iPoint++) { + int iPoint; + for (iPoint = 0; iPoint < nPoints; iPoint++) { double x = curve.X[iPoint] * Ucf[LENGTH]; double y = curve.Y[iPoint] * Ucf[VOLUME]; pointX[iPoint] = (float)x;