c89 conformance

This commit is contained in:
Sam Hatchett
2015-06-12 10:34:40 -04:00
parent dfe879af19
commit bee95a6ee2

View File

@@ -222,6 +222,7 @@ int runqual(long *t)
long hydtime; /* Hydraulic solution time */ long hydtime; /* Hydraulic solution time */
long hydstep; /* Hydraulic time step */ long hydstep; /* Hydraulic time step */
int errcode = 0; int errcode = 0;
int i;
/* Update reported simulation time */ /* Update reported simulation time */
*t = Qtime; *t = Qtime;
@@ -240,7 +241,7 @@ int runqual(long *t)
QTankVolumes[i-1] = Tank[i].V; QTankVolumes[i-1] = Tank[i].V;
} }
for (int i=1; i<= Nlinks; ++i) for (i=1; i<= Nlinks; ++i)
{ {
if (LinkStatus[i] <= CLOSED) { if (LinkStatus[i] <= CLOSED) {
QLinkFlow[i-1] = Q[i]; QLinkFlow[i-1] = Q[i];
@@ -251,11 +252,11 @@ int runqual(long *t)
} }
else { else {
// stepwise calculation // stepwise calculation
for (int i=1; i<= Ntanks; ++i) { for (i=1; i<= Ntanks; ++i) {
QTankVolumes[i-1] = Tank[i].V; QTankVolumes[i-1] = Tank[i].V;
} }
for (int i=1; i<= Nlinks; ++i) for (i=1; i<= Nlinks; ++i)
{ {
if (LinkStatus[i] <= CLOSED) { if (LinkStatus[i] <= CLOSED) {
QLinkFlow[i-1] = Q[i]; QLinkFlow[i-1] = Q[i];
@@ -281,7 +282,7 @@ int nextqual(long *tstep)
{ {
long hydstep; /* Hydraulic solution time step */ long hydstep; /* Hydraulic solution time step */
int errcode = 0; int errcode = 0;
int i;
/* Determine time step */ /* Determine time step */
*tstep = 0; *tstep = 0;
@@ -302,7 +303,7 @@ int nextqual(long *tstep)
} }
// restore the previous step's tank volumes // restore the previous step's tank volumes
for (int i=1; i<=Ntanks; i++) { for (i=1; i<=Ntanks; i++) {
if (Tank[i].A != 0) { // skip reservoirs again if (Tank[i].A != 0) { // skip reservoirs again
int n = Tank[i].Node; int n = Tank[i].Node;
Tank[i].V = QTankVolumes[i-1]; Tank[i].V = QTankVolumes[i-1];
@@ -311,7 +312,7 @@ int nextqual(long *tstep)
} }
// restore the previous step's pipe link flows // restore the previous step's pipe link flows
for (int i=1; i<=Nlinks; i++) { for (i=1; i<=Nlinks; i++) {
if (LinkStatus[i] <= CLOSED) { if (LinkStatus[i] <= CLOSED) {
Q[i] = 0.0; Q[i] = 0.0;
} }
@@ -332,7 +333,7 @@ int nextqual(long *tstep)
// restore tank levels to post-runH state, if needed. // restore tank levels to post-runH state, if needed.
if (OpenHflag) { if (OpenHflag) {
for (int i=1; i<=Ntanks; i++) { for (i=1; i<=Ntanks; i++) {
if (Tank[i].A != 0) { // skip reservoirs again if (Tank[i].A != 0) { // skip reservoirs again
int n = Tank[i].Node; int n = Tank[i].Node;
Tank[i].V = tankVolumes[i-1]; Tank[i].V = tankVolumes[i-1];
@@ -340,7 +341,7 @@ int nextqual(long *tstep)
} }
} }
for (int i=1; i<=Nlinks; ++i) { for (i=1; i<=Nlinks; ++i) {
if (LinkStatus[i] <= CLOSED) { if (LinkStatus[i] <= CLOSED) {
Q[i] = QLinkFlow[i-1]; Q[i] = QLinkFlow[i-1];
} }