# HG changeset patch # User Michael Guravage # Date 2010-06-23 16:21:32 # Node ID 59e38e5f05d2ae5cab0e1d5a818cd26a42673730 # Parent 32ba6ee9c7d945457cbe26b3072259f04292d553 Reverted NULL assignments to obviate compilation warnings. -- user: Michael Guravage branch 'default' 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/nodeitem.cpp changed src/qcanvasarrow.h changed src/simitembase.cpp diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,18 @@ 2010-06-23 + * simitembase.cpp: Removed NULL assignments to unused variables. + * VirtualLeaf.cpp: Ditto. + * apoplastitem.cpp: Ditto. + * canvas.cpp: Ditto. + * cell.cpp: Ditto. + * cellbase.h: Ditto. + * forwardeuler.cpp: Ditto. + * mainbase.h: Ditto. + * nodeitem.cpp: Ditto. + * qcanvasarrow.h: Ditto. + * simitembase.cpp: Ditto. + + * Makefile (clean): Add -f Makefile argument to each make invocation. * VirtualLeaf-install.nsi: New gpl license text. diff --git a/src/VirtualLeaf.cpp b/src/VirtualLeaf.cpp --- a/src/VirtualLeaf.cpp +++ b/src/VirtualLeaf.cpp @@ -275,10 +275,7 @@ TIMESTEP { /* Called if a cell is clicked */ -void Cell::OnClick(QMouseEvent *e) -{ - e = NULL; // use assignment merely to obviate compilation warning -} +void Cell::OnClick(QMouseEvent *e){} /* Custom message handler - Default appends a newline character to the end of each line. */ diff --git a/src/apoplastitem.cpp b/src/apoplastitem.cpp --- a/src/apoplastitem.cpp +++ b/src/apoplastitem.cpp @@ -68,8 +68,6 @@ void ApoplastItem::setColor(void) { setPen (QPen(diffcolor, 20) ); } -void ApoplastItem::OnClick(QMouseEvent *e) { - e = NULL; // merely to obviate compilation warnings -} +void ApoplastItem::OnClick(QMouseEvent *e) {} /* finis*/ 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,10 @@ +2010-06-23 + + * auxingrowthplugin.cpp: Removed NULL assignments to unused variables. + * meinhardtplugin.cpp: Ditto. + * testplugin.cpp: Ditto. + + 2010-06-22 * Makefile (clean): Add windows equivalent of UNIX touch. 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 @@ -39,7 +39,6 @@ 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(); 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 @@ -34,10 +34,7 @@ static const std::string _module_id("$Id 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::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {} void MeinhardtPlugin::SetCellColor(CellBase *c, QColor *color) { @@ -101,7 +98,6 @@ void MeinhardtPlugin::CelltoCellTranspor } void MeinhardtPlugin::WallDynamics(Wall *w, double *dw1, double *dw2) { - w = NULL; for (int c = 0;csetNamedColor(colors[c->Index()%colors.size()]); } - - void TestPlugin::CellHouseKeeping(CellBase *c) { - c->EnlargeTargetArea(par->cell_expansion_rate); if (c->Area() > par->rel_cell_div_threshold * c->BaseArea() ) { c->Divide(); } } -void TestPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) { - w = NULL; - dchem_c1 = dchem_c2 = NULL; -} +void TestPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {} -void TestPlugin::WallDynamics(Wall *w, double *dw1, double *dw2) { - w = NULL; - dw1 = dw2 = NULL; -} +void TestPlugin::WallDynamics(Wall *w, double *dw1, double *dw2) {} -void TestPlugin::CellDynamics(CellBase *c, double *dchem) { - c = NULL; - dchem=NULL; -} +void TestPlugin::CellDynamics(CellBase *c, double *dchem) {} Q_EXPORT_PLUGIN2(testplugin, TestPlugin) diff --git a/src/canvas.cpp b/src/canvas.cpp --- a/src/canvas.cpp +++ b/src/canvas.cpp @@ -103,9 +103,6 @@ FigureEditor::FigureEditor( const char* name, Qt::WindowFlags f) : QGraphicsView(&c,parent), mesh(m) { - name = NULL; // use these two assignments merely to obviate compile time warnings - f = Qt::Widget; - intersection_line = 0; //angle_line = 0; setInteractive(true); diff --git a/src/cell.cpp b/src/cell.cpp --- a/src/cell.cpp +++ b/src/cell.cpp @@ -1552,7 +1552,6 @@ 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."); } diff --git a/src/cellbase.h b/src/cellbase.h --- a/src/cellbase.h +++ b/src/cellbase.h @@ -453,7 +453,6 @@ ostream &operator<<(ostream &os, const C inline Vector PINdir(CellBase *here, CellBase *nb, Wall *w) { - 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 @@ -58,9 +58,6 @@ void ForwardEuler::odeint(double *ystart { 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 @@ -102,9 +102,9 @@ 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; QTransform viewport; diff --git a/src/nodeitem.cpp b/src/nodeitem.cpp --- a/src/nodeitem.cpp +++ b/src/nodeitem.cpp @@ -53,8 +53,6 @@ void NodeItem::userMove(double dx, doubl void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) { - option = NULL; // use assignment merely to obviate compilation warning - painter->setBrush(brush); painter->setPen(Qt::NoPen); painter->drawEllipse(ellipsesize); diff --git a/src/qcanvasarrow.h b/src/qcanvasarrow.h --- a/src/qcanvasarrow.h +++ b/src/qcanvasarrow.h @@ -35,9 +35,6 @@ 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 @@ -27,16 +27,11 @@ static const std::string _module_id("$Id SimItemBase::SimItemBase( void *v, QGraphicsScene *canvas ) { - canvas = NULL; // use assignment merely to obviate compilation warning obj=v; }; SimItemBase::~SimItemBase(void) {}; - -void SimItemBase::userMove(double dx, double dy) -{ - dx = dy = 0.0; // use assignment merely to obviate compilation warning -}; +void SimItemBase::userMove(double dx, double dy){}; /* finis */