Index: /issm/trunk-jpl/src/c/bamg/BamgQuadtree.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/BamgQuadtree.cpp	(revision 21628)
+++ /issm/trunk-jpl/src/c/bamg/BamgQuadtree.cpp	(revision 21629)
@@ -7,6 +7,10 @@
 
 namespace bamg {
+
 #define ABS(i) ((i)<0 ?-(i) :(i))
-#define MAXDEPTH 30
+#define MAXDEPTH  30
+#define MAXISIZE  1073741824 //2^30
+#define MAXICOORD 1073741823 //2^30 - 1 = =111...111 (29 times one)
+
 	/*DOCUMENTATION What is a BamgQuadtree? {{{
 	 * A Quadtree is a very simple way to group vertices according
@@ -61,6 +65,4 @@
 
 		/*Initialize fields*/
-		this->MaxISize      = 1073741824; //2^30
-		this->MaxICoord     = 1073741823; //2^30 - 1
 		this->NbQuadtreeBox = 0;
 		this->NbVertices    = 0;
@@ -76,6 +78,4 @@
 
 		/*Initialize fields*/
-		this->MaxISize      = 1073741824; //2^30
-		this->MaxICoord     = 1073741823; //2^30 - 1
 		this->NbQuadtreeBox = 0;
 		this->NbVertices    = 0;
@@ -88,5 +88,5 @@
 
 		/*Check Sizes*/
-		_assert_(this->MaxISize>this->MaxICoord);
+		_assert_(MAXISIZE>MAXICOORD);
 
 		/*Add all vertices of the mesh*/
@@ -114,5 +114,5 @@
 
 		/*Initialize level*/
-		long level=MaxISize;
+		long level=MAXISIZE;
 
 		/*Get inital box (the largest)*/
@@ -236,11 +236,11 @@
 		if(!this->root->nbitems) return nearest_v; 
 
-		/*Project coordinates (xi,yi) onto [0,MaxICoord-1] x [0,MaxICoord-1]*/
+		/*Project coordinates (xi,yi) onto [0,MAXICOORD-1] x [0,MAXICOORD-1]*/
 		int xi2 = xi;
 		int yi2 = yi;
 		if(xi<0)        xi2 = 0;
-		if(xi>MaxISize) xi2 = MaxICoord;
+		if(xi>MAXISIZE) xi2 = MAXICOORD;
 		if(yi<0)        yi2 = 0;
-		if(yi>MaxISize) yi2 = MaxICoord;
+		if(yi>MAXISIZE) yi2 = MAXICOORD;
 
 		/*Get inital box (the largest)*/
@@ -249,6 +249,6 @@
 		/*Initialize level and sizes for largest box*/
 		int levelbin = (1L<<MAXDEPTH);// = 2^30
-		int        h = this->MaxISize;
-		int       hb = this->MaxISize;
+		int        h = MAXISIZE;
+		int       hb = MAXISIZE;
 		int       i0 = 0;
 		int       j0 = 0;
@@ -439,5 +439,5 @@
 		int l=0; // level
 		BamgQuadtreeBox* b;
-		int hb =  MaxISize;
+		int hb =  MAXISIZE;
 		int i0=0,j0=0;
 
Index: /issm/trunk-jpl/src/c/bamg/BamgQuadtree.h
===================================================================
--- /issm/trunk-jpl/src/c/bamg/BamgQuadtree.h	(revision 21628)
+++ /issm/trunk-jpl/src/c/bamg/BamgQuadtree.h	(revision 21629)
@@ -37,6 +37,4 @@
 
 			/*BamgQuadtree public Fields*/
-			int              MaxICoord;       // maximum integer coordinate 2^MaxDepth -1
-			int              MaxISize;        // maximum integer coordinate 2^MaxDepth
 			BamgQuadtreeBox *root;            // main box
 			long             NbQuadtreeBox;   // total number of boxes
Index: /issm/trunk-jpl/src/c/bamg/Geometry.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/Geometry.cpp	(revision 21628)
+++ /issm/trunk-jpl/src/c/bamg/Geometry.cpp	(revision 21629)
@@ -103,5 +103,6 @@
 			 * coefIcoor = (2^30 -1)/D
 			 */
-			coefIcoor=(MaxICoor)/(Max(pmax.x-pmin.x,pmax.y-pmin.y));
+			int MaxICoord = 1073741823;
+			coefIcoor=(MaxICoord)/(Max(pmax.x-pmin.x,pmax.y-pmin.y));
 			if(coefIcoor<=0) _error_("coefIcoor should be positive");
 		}
@@ -909,5 +910,5 @@
 		 * coefIcoor = (2^30 -1)/D
 		 */
-		return  I2( (Icoor1) (coefIcoor*(P.x-pmin.x)) ,(Icoor1) (coefIcoor*(P.y-pmin.y)) );
+		return  I2( (int) (coefIcoor*(P.x-pmin.x)) ,(int) (coefIcoor*(P.y-pmin.y)) );
 	}/*}}}*/
 	void Geometry::UnMarkEdges() {/*{{{*/
Index: /issm/trunk-jpl/src/c/bamg/Geometry.h
===================================================================
--- /issm/trunk-jpl/src/c/bamg/Geometry.h	(revision 21628)
+++ /issm/trunk-jpl/src/c/bamg/Geometry.h	(revision 21629)
@@ -31,5 +31,5 @@
 			Curve         *curves;
 			R2             pmin,pmax;             // domain extrema coordinates
-			double         coefIcoor;             // coef to integer Icoor1;
+			double         coefIcoor;             // coef to integer coordinates;
 			double         MaxCornerAngle;
 
Index: /issm/trunk-jpl/src/c/bamg/Mesh.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/Mesh.cpp	(revision 21628)
+++ /issm/trunk-jpl/src/c/bamg/Mesh.cpp	(revision 21629)
@@ -1575,5 +1575,6 @@
 
 		//Build Gh.coefIcoor
-		Gh.coefIcoor= (MaxICoor)/(Max(Gh.pmax.x-Gh.pmin.x,Gh.pmax.y-Gh.pmin.y));
+		int MaxICoord = 1073741823; //2^30 - 1 = =111...111 (29 times one)
+		Gh.coefIcoor= (MaxICoord)/(Max(Gh.pmax.x-Gh.pmin.x,Gh.pmax.y-Gh.pmin.y));
 		if (Gh.coefIcoor<=0){
 			delete [] colorV;
@@ -1665,5 +1666,5 @@
 		//unset adj
 		for (i=0;i<nbt;i++){
-			for ( j=0;j<3;j++){
+			for (j=0;j<3;j++){
 				triangles[i].SetAdj2(j,0,triangles[i].GetAllflag(j));
 			}
@@ -2863,5 +2864,5 @@
 			double hx,hy;
 			vi.m.Box(hx,hy);
-			Icoor1 hi=(Icoor1) (hx*coefIcoor),hj=(Icoor1) (hy*coefIcoor);
+			int hi=(int) (hx*coefIcoor),hj=(int) (hy*coefIcoor);
 			if(!quadtree->TooClose(&vi,seuil,hi,hj)){
 				// a good new point 
@@ -3036,5 +3037,5 @@
 	}
 	/*}}}*/
-	BamgVertex* Mesh::NearestVertex(Icoor1 i,Icoor1 j) {/*{{{*/
+	BamgVertex* Mesh::NearestVertex(int i,int j) {/*{{{*/
 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/NearestVertex)*/
 		return  quadtree->NearestVertex(i,j); 
@@ -3695,5 +3696,6 @@
 
 		//Compute coefIcoor
-		coefIcoor= (MaxICoor)/(Max(pmax.x-pmin.x,pmax.y-pmin.y));
+		int MaxICoord = 1073741823; //2^30 - 1 = =111...111 (29 times one)
+		coefIcoor= (MaxICoord)/(Max(pmax.x-pmin.x,pmax.y-pmin.y));
 		if (coefIcoor<=0){
 			_error_("coefIcoor should be positive, a problem in the geometry is likely");
@@ -3925,5 +3927,5 @@
 	/*}}}*/
 	I2 Mesh::R2ToI2(const R2 & P) const {/*{{{*/
-		return  I2( (Icoor1) (coefIcoor*(P.x-pmin.x)),(Icoor1) (coefIcoor*(P.y-pmin.y)) );
+		return  I2( (int) (coefIcoor*(P.x-pmin.x)),(int) (coefIcoor*(P.y-pmin.y)) );
 	}
 	/*}}}*/
Index: /issm/trunk-jpl/src/c/bamg/Mesh.h
===================================================================
--- /issm/trunk-jpl/src/c/bamg/Mesh.h	(revision 21628)
+++ /issm/trunk-jpl/src/c/bamg/Mesh.h	(revision 21629)
@@ -102,5 +102,5 @@
 			long GetId(const Edge & t) const;
 			long GetId(const Edge * t) const;
-			BamgVertex* NearestVertex(Icoor1 i,Icoor1 j) ;
+			BamgVertex* NearestVertex(int i,int j) ;
 			Triangle* TriangleFindFromCoord(const I2 & ,Icoor2 [3],Triangle *tstart=0) const;
 			void ReadMesh(int* index,double* x,double* y,int nods,int nels);
Index: /issm/trunk-jpl/src/c/bamg/macros.h
===================================================================
--- /issm/trunk-jpl/src/c/bamg/macros.h	(revision 21628)
+++ /issm/trunk-jpl/src/c/bamg/macros.h	(revision 21629)
@@ -19,5 +19,4 @@
 	static const short NextVertex[3] = {1,2,0};
 	static const short PreviousVertex[3] = {2,0,1};
-	const  Icoor1 MaxICoor   = 1073741823; // 2^30-1 =111...111 (29 times one)
 }
 
