[Earthmovdist-commits] r24 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 15 04:16:36 CET 2010


Author: edd
Date: 2010-01-15 04:16:34 +0100 (Fri, 15 Jan 2010)
New Revision: 24

Modified:
   pkg/src/emdL1.cpp
Log:
make g++ -Wall happy by 
 - add #ifndef __GNUC__ around #pragma
 - commenting out one unused variable
 - adding curly braces around an otherwise ambiguous if/else block (but the visual indentation is pretty clear)


Modified: pkg/src/emdL1.cpp
===================================================================
--- pkg/src/emdL1.cpp	2010-01-15 03:15:21 UTC (rev 23)
+++ pkg/src/emdL1.cpp	2010-01-15 03:16:34 UTC (rev 24)
@@ -65,7 +65,9 @@
 
 *******************************************************************************/
 
+#ifndef __GNUC__
 #pragma warning(disable:4786)
+#endif 
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -503,7 +505,7 @@
 	//- Recursively build subtrees
 	PEmdEdge	pCurE=NULL, pNxtE=NULL;
 	PEmdNode	pCurN=NULL, pNxtN=NULL;
-	int	iCurL	= -1;
+	//int	iCurL	= -1;
 	int	nBin	= m_n1*m_n2*MAX(m_n3,1);
 	while(iQHead<nQueue && nQueue<nBin)
 	{
@@ -525,13 +527,13 @@
 		int	nNB	= m_nDim==2 ? 4 : 6;
 		for(int k=0;k<nNB;++k)
 		{
-			if(m_nDim==2)
+		  	if(m_nDim==2) {
 				if(k==0 && c>0)				pNxtN	= &(m_Nodes[r][c-1]);		// left
 				else if(k==1 && r>0)		pNxtN	= &(m_Nodes[r-1][c]);		// down
 				else if(k==2 && c<m_n2-1)	pNxtN	= &(m_Nodes[r][c+1]);		// right
 				else if(k==3 && r<m_n1-1)	pNxtN	= &(m_Nodes[r+1][c]);		// up
 				else						continue;
-			else if(m_nDim==3)
+			} else if(m_nDim==3) {
 				if(k==0 && c>0)				pNxtN	= &(m_3dNodes[r][c-1][z]);		// left
 				else if(k==1 && c<m_n2-1)	pNxtN	= &(m_3dNodes[r][c+1][z]);		// right
 				else if(k==2 && r>0)		pNxtN	= &(m_3dNodes[r-1][c][z]);		// down
@@ -539,6 +541,7 @@
 				else if(k==4 && z>0)		pNxtN	= &(m_3dNodes[r][c][z-1]);		// shallow
 				else if(k==5 && z<m_n3-1)	pNxtN	= &(m_3dNodes[r][c][z+1]);		// deep
 				else						continue;
+			}
 
 			if(pNxtN != pCurN->pParent)
 			{



More information about the Earthmovdist-commits mailing list