Changeset - 137d9d3a313a
[Not reviewed]
default
0 19 0
Michael Guravage - 15 years ago 2010-06-15 13:44:36
michael.guravage@cwi.nl
Removed most compilation warnings; see ChangeLogs for details.

--
user: Michael Guravage <michael.guravage@cwi.nl>
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
19 files changed with 101 insertions and 33 deletions:
0 comments (0 inline, 0 general)
.hgignore
Show inline comments
 
@@ -17,6 +17,8 @@ syntax: glob
 
*moc_*.cpp
 
src/default.par
 
bin*
 
TAGS
 
BROWSE
 

	
 
# switch to regexp syntax.
 
syntax: regexp
src/ChangeLog
Show inline comments
 
2010-06-15    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* 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.
src/VirtualLeaf.cpp
Show inline comments
 
@@ -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,12 +131,15 @@ 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);
 
    }
 
  }
 
  }
 
};
 

	
 
Mesh mesh;
 
@@ -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;
src/apoplastitem.cpp
Show inline comments
 
@@ -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
 
}
 

	
src/build_models/ChangeLog
Show inline comments
 
2010-06-15    <guravage@caterpie.sen.cwi.nl>
 

	
 

	
 
	* 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    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* Makefile: Added top-level Makefile.
src/build_models/auxingrowthplugin.cpp
Show inline comments
 
@@ -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;
src/build_models/meinhardtplugin.cpp
Show inline comments
 
@@ -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;c<NChem();c++) {
 
		dw1[c] = 0.; dw2[c] = 0.;
 
    }
src/build_models/testplugin.cpp
Show inline comments
 
@@ -36,7 +36,8 @@ bool batch = false;
 

	
 
// To be executed after cell division
 
void TestPlugin::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
	
 
  parent_info = NULL;
 
  daughter1 = daughter2 = NULL;
 
}
 

	
 
void TestPlugin::SetCellColor(CellBase *c, QColor *color) { 
 
@@ -58,9 +59,19 @@ void TestPlugin::CellHouseKeeping(CellBa
 
	}
 
}
 

	
 
void TestPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {}
 
void TestPlugin::WallDynamics(Wall *w, double *dw1, double *dw2) {}
 
void TestPlugin::CellDynamics(CellBase *c, double *dchem) { }
 
void TestPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  w = NULL;
 
  dchem_c1 = dchem_c2 = NULL;
 
}
 

	
 
void TestPlugin::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  w = NULL;
 
  dw1 = dw2 = NULL;
 
}
 

	
 
void TestPlugin::CellDynamics(CellBase *c, double *dchem) {
 
  c = NULL;
 
  dchem=NULL;
 
}
 

	
 
Q_EXPORT_PLUGIN2(testplugin, TestPlugin)
src/canvas.cpp
Show inline comments
 
@@ -101,6 +101,9 @@ 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);
 
@@ -153,8 +156,6 @@ void FigureEditor::mousePressEvent(QMous
 
  //QPointF p = matrix().inverted().map(e->pos());
 
  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<NodeItem*>(*it);
src/cell.cpp
Show inline comments
 
@@ -1813,7 +1813,7 @@ void Cell::DrawAxis(QGraphicsScene *c) c
 
}
 

	
 
void Cell::DrawStrain(QGraphicsScene *c) const {
 
	></i>
 
  c = NULL; // assignment merely to obviate compilation warning
 
	MyWarning::warning("Sorry, Cell::DrawStrain temporarily not implemented.");
 
	/* Vector long_axis;
 
	double width;
src/cellbase.h
Show inline comments
 
@@ -490,6 +490,7 @@ protected:
 
ostream &operator<<(ostream &os, const CellBase &v);
 

	
 
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);
 
}
 

	
src/forwardeuler.cpp
Show inline comments
 
@@ -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;
src/mainbase.h
Show inline comments
 
@@ -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;
src/mesh.cpp
Show inline comments
 
@@ -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<int> boundary_node_owners; // This is a list of the current boundary node's owners' Ids
 
  vector<int> neighborIds; // A list of the current boundary node's owners' 2nd neighbor Ids
 
  vector<set<int> *>  nodeOwners; // A vector of set pointers where each set contains the owner Ids of the nodes in the neighborIds list.
src/nodeitem.cpp
Show inline comments
 
@@ -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);
src/output.cpp
Show inline comments
 
@@ -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;
 
}
src/qcanvasarrow.h
Show inline comments
 
@@ -36,6 +36,9 @@ 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();
src/simitembase.cpp
Show inline comments
 
@@ -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
 
};
src/xmlwrite.cpp
Show inline comments
 
@@ -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);
0 comments (0 inline, 0 general)