[Ptinpoly-commits] r38 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 27 01:49:38 CEST 2020


Author: jmaisog
Date: 2020-05-27 01:49:38 +0200 (Wed, 27 May 2020)
New Revision: 38

Modified:
   pkg/src/kodtree.h
   pkg/src/pinpolyhedronA.cc
Log:


Modified: pkg/src/kodtree.h
===================================================================
--- pkg/src/kodtree.h	2020-05-25 13:45:15 UTC (rev 37)
+++ pkg/src/kodtree.h	2020-05-26 23:49:38 UTC (rev 38)
@@ -61,7 +61,8 @@
 		checkAndMergeSubTreeAfterDelete(p,root);
 		return true;
 	}
-	WpInfo * insertExinfo(void *info,int infotype){
+	// JMM (5/26/2020): Change void to int...
+	WpInfo * insertExinfo(int *info,int infotype){
 		WpInfo *nwinf=new WpInfo(info,infotype);
 		insertWpInfoInSubTree(nwinf,root);
 		if(nwinf->rcount==0){

Modified: pkg/src/pinpolyhedronA.cc
===================================================================
--- pkg/src/pinpolyhedronA.cc	2020-05-25 13:45:15 UTC (rev 37)
+++ pkg/src/pinpolyhedronA.cc	2020-05-26 23:49:38 UTC (rev 38)
@@ -57,7 +57,9 @@
 
 	vti=new void *[numvert];
 	for(int i=0; i<numvert; i++)
-		vti[i]=startaddress+i;
+		// JMM (5/26/2020): Cast void** to int ** before dereferencing it (because startaddress is int*).
+		*((int **)vti+i))=startaddress+i;
+		//vti[i]=startaddress+i;
 }
 
 bool   PointInPolyhedron::ifexinfooverlapbox(void *info,int infotype,const Box &bd,double eps){
@@ -381,6 +383,7 @@
     polytree->setFuncExinfoShouldbeInCell(ifexinfoshouldbeincell);
 	polytree->setFuncExinfoOverlapBox(ifexinfooverlapbox);
 	for(int i=0; i<numtri; i++)
+		// JMM (5/26/2020): the first argument of insertExinfo has been changed to int* in kodtree.h
 		polytree->insertExinfo(i+startaddress,1);
 	setGCellAttribOfSubTree(polytree->getRoot());
 	//triused=new int[numtri];



More information about the Ptinpoly-commits mailing list