OpenWaterAnalytics / EPANET

The Water Distribution System Hydraulic and Water Quality Analysis Toolkit
MIT License
279 stars 204 forks source link

Remove some compiler warnings #673

Closed jburguete closed 2 years ago

jburguete commented 2 years ago

Several GCC compiler warnings indicate possible issues in the code.

diff -Naur src/epanet.c src2/epanet.c --- src/epanet.c 2022-03-28 20:24:51.756202697 +0200 +++ src2/epanet.c 2022-03-31 18:02:55.219740205 +0200 @@ -4019,6 +4019,7 @@ if (curveIndex < 0 || curveIndex > net->Ncurves) return 206; Link[index].Kc = curveIndex; }

-static int mmdint(int neqns, int xadj, int adjncy, int dhead, int* dforw, +static int mmdint(int neqns, int xadj, int dhead, int dforw, int dbakw, int qsize, int llist, int marker); static int mmdelm(int mdnode, int xadj, int adjncy, int dhead, int dforw, int dbakw, int qsize, int llist, int marker, @@ -110,7 +110,7 @@ nofsub = 0; //mmdint(neqns, &xadj[1], &adjncy[1], &dhead[1], &invp[1], &perm[1], // &qsize[1], &llist[1], &marker[1]);

-static int mmdint(int neqns, int xadj, int adjncy, int dhead, int* dforw, +static int mmdint(int neqns, int xadj, int dhead, int dforw, int dbakw, int qsize, int llist, int marker) { / System generated locals / diff -Naur src/hydsolver.c src2/hydsolver.c --- src/hydsolver.c 2022-03-28 20:24:51.756202697 +0200 +++ src2/hydsolver.c 2022-04-01 08:46:46.802593514 +0200 @@ -320,7 +320,7 @@ s = hyd->LinkStatus[k]; if (link->Type == PIPE) {

diff -Naur src/quality.c src2/quality.c --- src/quality.c 2022-03-28 20:24:51.756202697 +0200 +++ src2/quality.c 2022-04-01 08:42:53.262206122 +0200 @@ -69,10 +69,10 @@

     // Build adjacency lists
     errcode = buildadjlists(net);
LRossman commented 2 years ago

@jburguete thanks for finding these warnings. I assume you found them by compiling the project's master branch. However to fix them, changes should be made to a new branch created off of devand then have that new branch merged into dev. Please follow the instructions in the CONTRIBUTING section of the project's README.

Also I reviewed your proposed changes and agree with all but the last. I don't see any place in smatrix.c where the variable sm is declared but not used.

eladsal commented 2 years ago

Thank you @jburguete , can we close this PR in light of #674?

jburguete commented 2 years ago

Yes, of course. Sorry, it is my first pull request and I am not jet familiarized with the interfaces

eladsal commented 2 years ago

No worries, thank you!