← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 3031: Fix compilation warnings on Ubuntu Precise.

 

------------------------------------------------------------
revno: 3031
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
branch nick: yade
timestamp: Thu 2012-02-16 17:05:15 +0100
message:
  Fix compilation warnings on Ubuntu Precise.
modified:
  lib/import/STLReader.hpp
  lib/multimethods/Indexable.hpp
  pkg/dem/ConcretePM.hpp
  pkg/dem/HertzMindlin.cpp
  pkg/dem/Ip2_FrictMat_FrictMat_MindlinCapillaryPhys.cpp
  pkg/dem/Tetra.cpp
  py/3rd-party/pygts-0.3.1/pygts.h


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'lib/import/STLReader.hpp'
--- lib/import/STLReader.hpp	2009-08-05 17:00:48 +0000
+++ lib/import/STLReader.hpp	2012-02-16 16:05:15 +0000
@@ -74,7 +74,7 @@
     fseek(fp, 0, SEEK_END);
     int file_size = ftell(fp);
     int facenum;
-	 int res;
+    size_t res;
     /* Check for binary or ASCII file */
     fseek(fp, STL_LABEL_SIZE, SEEK_SET);
     res=fread(&facenum, sizeof(int), 1, fp);
@@ -109,7 +109,7 @@
     
     vector<Vrtx> vcs;
     set<pair<int,int> > egs;
-	 int ret;
+    size_t ret;
 
     /* Read a single facet from an ASCII .STL file */
     while(!feof(fp))

=== modified file 'lib/multimethods/Indexable.hpp'
--- lib/multimethods/Indexable.hpp	2010-02-06 16:01:07 +0000
+++ lib/multimethods/Indexable.hpp	2012-02-16 16:05:15 +0000
@@ -73,16 +73,20 @@
 	public: virtual const int& getMaxCurrentlyUsedClassIndex() const {  \
 		SomeClass * Indexable##SomeClass = 0;                            \
 		Indexable##SomeClass = dynamic_cast<SomeClass*>(const_cast<SomeClass*>(this)); \
-		assert(Indexable##SomeClass);                                    \
+		if (Indexable##SomeClass) {                                      \
+			assert(Indexable##SomeClass);                                  \
+		}                                                                \
 		return getMaxCurrentlyUsedIndexStatic();                         \
 	}                                                                   \
 	public: virtual void incrementMaxCurrentlyUsedClassIndex() {        \
 		SomeClass * Indexable##SomeClass = 0;                            \
 		Indexable##SomeClass = dynamic_cast<SomeClass*>(this);           \
-		assert(Indexable##SomeClass);                                    \
+		if (Indexable##SomeClass) {                                      \
+			assert(Indexable##SomeClass);                                  \
+		}                                                                \
 		int& max = getMaxCurrentlyUsedIndexStatic();                     \
 		max++;                                                           \
-	}
+	}                                                                  \
 
 // macro that should be passed in the 4th argument of YADE_CLASS_BASE_ATTR_PY in the top-level indexable
 #define YADE_PY_TOPINDEXABLE(className) .add_property("dispIndex",&Indexable_getClassIndex<className>,"Return class index of this instance.").def("dispHierarchy",&Indexable_getClassIndices<className>,(boost::python::arg("names")=true),"Return list of dispatch classes (from down upwards), starting with the class instance itself, top-level indexable at last. If names is true (default), return class names rather than numerical indices.")

=== modified file 'pkg/dem/ConcretePM.hpp'
--- pkg/dem/ConcretePM.hpp	2012-01-31 18:21:29 +0000
+++ pkg/dem/ConcretePM.hpp	2012-02-16 16:05:15 +0000
@@ -190,6 +190,8 @@
 			case 1: // exponential
 				return 1.-(epsCrackOnset/kappaD)*exp(-(kappaD-epsCrackOnset)/epsFracture);
 		}
+		LOG_ERROR("End of void function!");
+		return 0;
 	}
 	//! return |sigmaT| at plastic surface for given sigmaN etc; not used by the law itself
 	Real yieldSigmaTMagnitude(Real sigmaN, Real omega, Real undamagedCohesion, Real tanFrictionAngle);

=== modified file 'pkg/dem/HertzMindlin.cpp'
--- pkg/dem/HertzMindlin.cpp	2012-01-23 14:43:54 +0000
+++ pkg/dem/HertzMindlin.cpp	2012-02-16 16:05:15 +0000
@@ -51,7 +51,7 @@
 	GenericSpheresContact* scg = YADE_CAST<GenericSpheresContact*>(interaction->geom.get());		
 	Real Da = scg->refR1>0 ? scg->refR1 : scg->refR2; 
 	Real Db = scg->refR2; 
-	Vector3r normal=scg->normal; 
+	//Vector3r normal=scg->normal;        //The variable set but not used
 
 
 	/* calculate stiffness coefficients */
@@ -177,7 +177,7 @@
 	
 	// shear force: transform, but keep the old value for now
 	geom->rotate(phys->usTotal);
-	Vector3r usOld=phys->usTotal;
+	//Vector3r usOld=phys->usTotal;     //The variable set but not used
 	Vector3r dUs=geom->shearIncrement();
 	phys->usTotal-=dUs;
 

=== modified file 'pkg/dem/Ip2_FrictMat_FrictMat_MindlinCapillaryPhys.cpp'
--- pkg/dem/Ip2_FrictMat_FrictMat_MindlinCapillaryPhys.cpp	2011-11-10 11:04:14 +0000
+++ pkg/dem/Ip2_FrictMat_FrictMat_MindlinCapillaryPhys.cpp	2012-02-16 16:05:15 +0000
@@ -46,7 +46,7 @@
 	GenericSpheresContact* scg = YADE_CAST<GenericSpheresContact*>(interaction->geom.get());		
 	Real Da = scg->refR1>0 ? scg->refR1 : scg->refR2; 
 	Real Db = scg->refR2; 
-	Vector3r normal=scg->normal; 
+	//Vector3r normal=scg->normal;  //The variable set but not used
 
 	/* calculate stiffness coefficients */
 	Real Ga = Ea/(2*(1+Va));

=== modified file 'pkg/dem/Tetra.cpp'
--- pkg/dem/Tetra.cpp	2010-11-07 11:46:20 +0000
+++ pkg/dem/Tetra.cpp	2012-02-16 16:05:15 +0000
@@ -24,7 +24,7 @@
 	Tetra* t=static_cast<Tetra*>(ig.get());
 	if(!bv){ bv=shared_ptr<Bound>(new Aabb); }
 	Aabb* aabb=static_cast<Aabb*>(bv.get());
-	Quaternionr invRot=se3.orientation.conjugate();
+	//Quaternionr invRot=se3.orientation.conjugate();   //The variable set but not used
 	Vector3r v_g[4]; for(int i=0; i<4; i++) v_g[i]=se3.orientation*t->v[i]; // vertices in global coordinates
 	#define __VOP(op,ix) op(v_g[0][ix],op(v_g[1][ix],op(v_g[2][ix],v_g[3][ix])))
 		aabb->min=se3.position+Vector3r(__VOP(std::min,0),__VOP(std::min,1),__VOP(std::min,2));

=== modified file 'py/3rd-party/pygts-0.3.1/pygts.h'
--- py/3rd-party/pygts-0.3.1/pygts.h	2009-07-27 17:08:23 +0000
+++ py/3rd-party/pygts-0.3.1/pygts.h	2012-02-16 16:05:15 +0000
@@ -32,11 +32,11 @@
 #define PYGTS_DEBUG 1
 #endif /* PYGTS_DEBUG */
 
+#include <Python.h>
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
 
-#include <Python.h>
 #include <structmember.h>
 
 /* Defined for arrayobject.h which is only included where needed */