# HG changeset patch # User Michael Guravage # Date 2010-06-15 13:44:36 # Node ID 137d9d3a313a299a351f252e67c21e2823127171 # Parent 18e4f7f50259418d7bf744bad8782bfd803328c6 Removed most compilation warnings; see ChangeLogs for details. -- user: Michael Guravage branch 'default' changed .hgignore changed src/ChangeLog changed src/VirtualLeaf.cpp changed src/apoplastitem.cpp changed src/build_models/ChangeLog changed src/build_models/auxingrowthplugin.cpp changed src/build_models/meinhardtplugin.cpp changed src/build_models/testplugin.cpp changed src/canvas.cpp changed src/cell.cpp changed src/cellbase.h changed src/forwardeuler.cpp changed src/mainbase.h changed src/mesh.cpp changed src/nodeitem.cpp changed src/output.cpp changed src/qcanvasarrow.h changed src/simitembase.cpp changed src/xmlwrite.cpp diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -17,6 +17,8 @@ syntax: glob *moc_*.cpp src/default.par bin* +TAGS +BROWSE # switch to regexp syntax. syntax: regexp diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,10 +1,42 @@ 2010-06-15 + * mesh.cpp (findNextBoundaryNode): Initialize Node *next_boundary_node = NULL; + + * xmlwrite.cpp (XMLReadSimtime): Removed unused variable cur + (XMLReadWalls): viz_flux need not be declared twice; default value of 0.0. + (XMLReadCells): Removed unused count variable. + (XMLReadSimtime): Removed unused cur variable. + (XMLRead): Removed unused v_str variable. + + * simitembase.cpp (userMove): Use assignment merely to obviate compilation warning. + (SimItemBase) Ditto. + + * qcanvasarrow.h (QGraphicsLineItem): Use assignment merely to obviate compilation warning. + + * output.cpp (OpenWriteFile): Removed unused par variable. + + * nodeitem.cpp (paint): Use assignment merely to obviate compilation warning. + + * forwardeuler.cpp (odeint): Use assignment merely to obviate compilation warning. + + * cell.cpp (DivideOverGivenLine): Use assignment merely to obviate compilation warning. + + * canvas.cpp (FigureEditor): Use assignments merely to obviate compilation errors. + (mousePressEvent): Removed unused item variable. + + * apoplastitem.cpp + (ApoplastItem): Removed unused par variable. + (OnClick): Use NULL assignment merely to obviate compilation warning. + + * mainbase.h (MainBase): Use assignment merely to obviate compilation warning. + + * cellbase.h (CellsStaticDatamembers): Use assignment merely to obviate compilation warning. + + * cell.cpp: Wrapped diagnostic output in QDEBUG blocks. * VirtualLeaf.cpp ditto. * canvas.cpp ditto. * cell.cpp ditto. - * cellbase.h * data_plot.cpp ditto. * forwardeuler.cpp ditto. * mesh.cpp ditto. diff --git a/src/VirtualLeaf.cpp b/src/VirtualLeaf.cpp --- a/src/VirtualLeaf.cpp +++ b/src/VirtualLeaf.cpp @@ -122,7 +122,7 @@ class DrawCell { public: void operator() (Cell &c,QGraphicsScene &canvas, MainBase &m) const { if (m.ShowBorderCellsP() || c.Boundary()==Cell::None) { - if (!m.ShowBoundaryOnlyP() && !m.HideCellsP()) + if (!m.ShowBoundaryOnlyP() && !m.HideCellsP()) { if (m.ShowToolTipsP()) { QString info_string=QString("Cell %1, chemicals: ( %2, %3, %4, %5, %6)\n %7 of PIN1 at walls.\n Area is %8\n PIN sum is %9\n Circumference is %10\n Boundary type is %11").arg(c.Index()).arg(c.Chemical(0)).arg(c.Chemical(1)).arg(c.Chemical(2)).arg(c.Chemical(3)).arg(c.Chemical(4)).arg(c.SumTransporters(1)).arg(c.Area()).arg(PINSum(c)).arg(c.Circumference()).arg(c.BoundaryStr()); @@ -131,10 +131,13 @@ public: } else { c.Draw(&canvas); } - if (m.ShowCentersP()) + } + if (m.ShowCentersP()){ c.DrawCenter(&canvas); - if (m.ShowFluxesP()) + } + if (m.ShowFluxesP()){ c.DrawFluxes(&canvas, par.arrowsize); + } } } }; @@ -319,6 +322,9 @@ TIMESTEP { /* Called if a cell is clicked */ void Cell::OnClick(QMouseEvent *e) { + + e = NULL; // use assignment merely to obviate compilation warning + /* #ifdef HAVE_QWT // Launch DataPlot window QStringList curvenames; diff --git a/src/apoplastitem.cpp b/src/apoplastitem.cpp --- a/src/apoplastitem.cpp +++ b/src/apoplastitem.cpp @@ -34,8 +34,6 @@ static const std::string _module_id("$Id ApoplastItem::ApoplastItem( Wall *w, QGraphicsScene *canvas ) : QGraphicsLineItem( 0, canvas ), SimItemBase( w, canvas){ - extern Parameter par; - setColor(); // line with "PIN1"is a bit inside the cell wall @@ -72,7 +70,6 @@ void ApoplastItem::setColor(void) { } void ApoplastItem::OnClick(QMouseEvent *e) { - - + e = NULL; // merely to obviate compile time warning } diff --git a/src/build_models/ChangeLog b/src/build_models/ChangeLog --- a/src/build_models/ChangeLog +++ b/src/build_models/ChangeLog @@ -1,3 +1,16 @@ +2010-06-15 + + + * testplugin.cpp (CelltoCellTransport) Use NULL assignment merely to obviate compilation warnings. + (WallDynamics): Ditto. + (CellDynamics): Ditto. + (OnDivide): Ditto. + + * meinhardtplugin.cpp (OnDivide): Use NULL assignment merely to obviate compilation warnings. + * (WallDynamics): Ditto. + + * auxingrowthplugin.cpp (OnDivide): Use NULL assignment merely to obviate compilation warnings. + 2010-06-03 * Makefile: Added top-level Makefile. diff --git a/src/build_models/auxingrowthplugin.cpp b/src/build_models/auxingrowthplugin.cpp --- a/src/build_models/auxingrowthplugin.cpp +++ b/src/build_models/auxingrowthplugin.cpp @@ -38,6 +38,8 @@ bool batch = false; // To be executed after cell division void AuxinGrowthPlugin::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) { + parent_info = NULL; // merely to obviate compile time error + // Auxin distributes between parent and daughter according to area double area1 = daughter1->Area(), area2 = daughter2->Area(); double tot_area = area1 + area2; diff --git a/src/build_models/meinhardtplugin.cpp b/src/build_models/meinhardtplugin.cpp --- a/src/build_models/meinhardtplugin.cpp +++ b/src/build_models/meinhardtplugin.cpp @@ -35,7 +35,8 @@ bool batch = false; // To be executed after cell division void MeinhardtPlugin::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) { - + parent_info = NULL; + daughter1 = daughter2 = NULL; } void MeinhardtPlugin::SetCellColor(CellBase *c, QColor *color) { @@ -104,6 +105,7 @@ void MeinhardtPlugin::CelltoCellTranspor } void MeinhardtPlugin::WallDynamics(Wall *w, double *dw1, double *dw2) { + w = NULL; for (int c = 0;cpos()); QPointF p = mapToScene(e->pos()); - NodeItem *item; - #ifdef QDEBUG qDebug() << endl << "MousePressEvent location: (" << p.x() << "," << p.y() << ")." << endl; qDebug() << "Magnification: " << Cell::Magnification() << endl; @@ -231,7 +232,7 @@ void FigureEditor::mousePressEvent(QMous }*/ #ifdef QDEBUG qDebug() << typeid(**it).name() << endl; - #endif QDEBUG + #endif if ( !strcmp(typeid(**it).name(),"8NodeItem")) { //moving = dynamic_cast(*it); diff --git a/src/cell.cpp b/src/cell.cpp --- a/src/cell.cpp +++ b/src/cell.cpp @@ -1813,7 +1813,7 @@ void Cell::DrawAxis(QGraphicsScene *c) c } void Cell::DrawStrain(QGraphicsScene *c) const { - + c = NULL; // assignment merely to obviate compilation warning MyWarning::warning("Sorry, Cell::DrawStrain temporarily not implemented."); /* Vector long_axis; double width; diff --git a/src/cellbase.h b/src/cellbase.h --- a/src/cellbase.h +++ b/src/cellbase.h @@ -490,7 +490,8 @@ protected: ostream &operator<<(ostream &os, const CellBase &v); inline Vector PINdir(CellBase *here, CellBase *nb, Wall *w) { - return w->getTransporter( here, 1) * w->getInfluxVector(here); + nb = NULL; // assignment merely to obviate compilation warning + return w->getTransporter( here, 1) * w->getInfluxVector(here); } diff --git a/src/forwardeuler.cpp b/src/forwardeuler.cpp --- a/src/forwardeuler.cpp +++ b/src/forwardeuler.cpp @@ -67,6 +67,10 @@ void ForwardEuler::odeint(double *ystart routine to be used. */ { static bool warning_issued = false; + + eps = hmin = 0.0; // use assignment merely to obviate compilation warning + nbad = nok = NULL; + if (!warning_issued) { cerr << "Using inaccurate method ForwardEuler\n"; warning_issued=true; diff --git a/src/mainbase.h b/src/mainbase.h --- a/src/mainbase.h +++ b/src/mainbase.h @@ -120,6 +120,7 @@ class MainBase { void Plot(int resize_stride=10); virtual void UserMessage(QString message, int timeout = 0) { + timeout = 0; // merely to obviate 'warning unused parameter' message cerr << message.toAscii().constData() << endl; } Mesh &mesh; diff --git a/src/mesh.cpp b/src/mesh.cpp --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1658,7 +1658,7 @@ void Mesh::RepairBoundaryPolygon(void) { Node* Mesh::findNextBoundaryNode(Node* boundary_node) { bool found_next_boundary_node = false; - Node *next_boundary_node; + Node *next_boundary_node = NULL; set boundary_node_owners; // This is a list of the current boundary node's owners' Ids vector neighborIds; // A list of the current boundary node's owners' 2nd neighbor Ids vector *> nodeOwners; // A vector of set pointers where each set contains the owner Ids of the nodes in the neighborIds list. diff --git a/src/nodeitem.cpp b/src/nodeitem.cpp --- a/src/nodeitem.cpp +++ b/src/nodeitem.cpp @@ -72,6 +72,7 @@ void NodeItem::paint(QPainter *painter, } painter->setBrush(gradient); */ + option = NULL; // use assignment merely to obviate compilation warning painter->setBrush(brush); painter->setPen(Qt::NoPen); diff --git a/src/output.cpp b/src/output.cpp --- a/src/output.cpp +++ b/src/output.cpp @@ -117,7 +117,6 @@ FILE *OpenWriteFile(const char *filename char fname[FNAMESIZE]; FILE *fp; - extern Parameter par; fprintf(stderr,"Opening %s for writing\n",filename); @@ -210,10 +209,8 @@ FILE *OpenReadFile(const char *filename) if((OpenFileAndCheckExistance(&fp,filename,"r"))==FALSE) { char *message=(char *)malloc(2000*sizeof(char)); - sprintf(message," File %s not found or empty, exiting... \n" - ,filename); + sprintf(message," File %s not found or empty, exiting... \n" ,filename); throw(message); - } return fp; } diff --git a/src/qcanvasarrow.h b/src/qcanvasarrow.h --- a/src/qcanvasarrow.h +++ b/src/qcanvasarrow.h @@ -35,7 +35,10 @@ class QGraphicsArrowItem : public QGraph void paint ( QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget ) { - + + widget = NULL; //use assignment merely to obviate compilation warning + option = NULL; + // construct arrow head QPointF start=line().p1(); QPointF end=line().p2(); diff --git a/src/simitembase.cpp b/src/simitembase.cpp --- a/src/simitembase.cpp +++ b/src/simitembase.cpp @@ -26,6 +26,7 @@ static const std::string _module_id("$Id$"); SimItemBase::SimItemBase( void *v, QGraphicsScene *canvas ) { + canvas = NULL; // use assignment merely to obviate compilation warning obj=v; }; @@ -33,5 +34,5 @@ SimItemBase::~SimItemBase(void) {}; void SimItemBase::userMove(double dx, double dy) { - + dx = dy = 0.0; // use assignment merely to obviate compilation warning }; diff --git a/src/xmlwrite.cpp b/src/xmlwrite.cpp --- a/src/xmlwrite.cpp +++ b/src/xmlwrite.cpp @@ -351,7 +351,7 @@ int Cell::XMLRead(xmlNode *cur) { n = cur->xmlChildrenNode; while(n!=NULL) { if ((!xmlStrcmp(n->name, (const xmlChar *)"chem"))) { - xmlChar *v_str = xmlGetProp(n, BAD_CAST "n"); + xmlNode *v_node = n->xmlChildrenNode; int nv=0; while (v_node!=NULL) { @@ -907,7 +907,6 @@ void Mesh::XMLReadSimtime(const xmlNode xmlNode *root_node; root_node = (xmlNode *)a_node; - xmlNode *cur; xmlChar *strsimtime = xmlGetProp(root_node, BAD_CAST "simtime"); @@ -1223,16 +1222,11 @@ void Mesh::XMLReadWalls(xmlNode *root, v nc = xmlGetProp(cur, BAD_CAST "viz_flux"); - double viz_flux; + double viz_flux = 0.0; if (nc!=0) { //viz_flux = strtod( (char *)nc, 0); - double viz_flux = standardlocale.toDouble((const char *)nc, &ok); + viz_flux = standardlocale.toDouble((const char *)nc, &ok); if (!ok) MyWarning::error("Could not convert \"%s\" to double in XMLRead.",(const char *)nc); - - } else { - // if the info is not there, we really don't care. - // It is just for visualization anyhow. - viz_flux = 0.; } xmlFree(nc); @@ -1544,7 +1538,7 @@ void Mesh::XMLReadCells(xmlNode *root) { while (cur!=NULL) { Cell *new_cell=0; - static int count=0; + if ((!xmlStrcmp(cur->name, (const xmlChar *)"cell"))){ new_cell = new Cell(0,0);