bug fixes from master

This commit is contained in:
Sam Hatchett
2013-07-22 16:39:09 -04:00
parent 7e731b78ab
commit 99119ef992
2 changed files with 5 additions and 3 deletions

View File

@@ -1779,8 +1779,8 @@ int DLLEXPORT ENgetcurve(int curveIndex, int *nValues, EN_API_FLOAT_TYPE **xVal
EN_API_FLOAT_TYPE *pointX = calloc(nPoints, sizeof(EN_API_FLOAT_TYPE));
EN_API_FLOAT_TYPE *pointY = calloc(nPoints, sizeof(EN_API_FLOAT_TYPE));
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] = (EN_API_FLOAT_TYPE)x;
@@ -3297,7 +3297,8 @@ int DLLEXPORT ENgetaveragepatternvalue(int index, EN_API_FLOAT_TYPE *value)
if (!Openflag) return(102);
if (index < 1 || index > Npats) return(205);
//if (period < 1 || period > Pattern[index].Length) return(251);
for (int i=0; i<Pattern[index].Length; i++) {
int i;
for (i=0; i<Pattern[index].Length; i++) {
*value+=Pattern[index].F[i];
}
*value/=(EN_API_FLOAT_TYPE)Pattern[index].Length;

View File

@@ -338,6 +338,7 @@ int saveoutput()
/* Write out node results, then link results */
for (j=DEMAND; j<=QUALITY; j++) ERRCODE(nodeoutput(j,x,Ucf[j]));
for (j=FLOW; j<=FRICTION; j++) ERRCODE(linkoutput(j,x,Ucf[j]));
free(x);
return(errcode);
} /* End of saveoutput */