Index: /issm/trunk-jpl/src/c/bamg/Mesh.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/Mesh.cpp	(revision 16151)
+++ /issm/trunk-jpl/src/c/bamg/Mesh.cpp	(revision 16152)
@@ -122,15 +122,15 @@
 		  }
 		  for (i=0;i<Tho.nbt;i++)
-			if(  reft[i] >=0 && flag[i]) 
-			  {
+			if(reft[i] >=0 && flag[i]){
 				const Triangle & t = Tho.triangles[i];
 				int i0 = Tho.GetId(t[0]);
 				int i1 = Tho.GetId(t[1]);
 				int i2 = Tho.GetId(t[2]);
-				if (i0<0 || i1<0 || i2<0){
+				if(i0<0 || i1<0 || i2<0){
 					delete [] refv;
 					_error_("i0<0 || i1<0 || i2< 0");
 				}
-				if (i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv){
+				if(i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv){
+					delete [] refv;
 					_error_("i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv");
 				}
@@ -4138,7 +4138,7 @@
 	 first_np_or_next_t1[i]=-1;
 	kk=0;
-	while (Head0>=0&& kk++<100) {
+	while(Head0>=0&& kk++<100){
 		kch=0;
-		for (i=Head0;i>=0;i=first_np_or_next_t0[ip=i],first_np_or_next_t0[ip]=-1) {
+		for(i=Head0;i>=0;i=first_np_or_next_t0[ip=i],first_np_or_next_t0[ip]=-1) {
 			//  pour tous les triangles autour du sommet s
 			register Triangle* t= vertices[i].t;
Index: /issm/trunk-jpl/src/c/shared/Bamg/HeapSort.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Bamg/HeapSort.h	(revision 16151)
+++ /issm/trunk-jpl/src/c/shared/Bamg/HeapSort.h	(revision 16152)
@@ -85,4 +85,7 @@
 		}
 	}
+
+	/*Make cppcheck happy*/
+	*porder=order;
 }/*}}}*/
 
Index: /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp	(revision 16151)
+++ /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp	(revision 16152)
@@ -15,15 +15,17 @@
 ErrorException::ErrorException(const string &what_arg){/*{{{*/
 
-	what_str=what_arg;
-	file_name="";
-	function_name="";
-	file_line=0;
+	what_str      = what_arg;
+	file_name     = "";
+	function_name = "";
+	file_line     = 0;
+
 }/*}}}*/
 ErrorException::ErrorException(const string& what_file, const string& what_function,int what_line, const string& what_arg){/*{{{*/
 
-	what_str=what_arg;
-	file_name=what_file;
-	function_name=what_function;
-	file_line=what_line;
+	what_str      = what_arg;
+	file_name     = what_file;
+	function_name = what_function;
+	file_line     = what_line;
+
 }/*}}}*/
 ErrorException::~ErrorException() throw(){/*{{{*/
Index: /issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h	(revision 16151)
+++ /issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h	(revision 16152)
@@ -83,5 +83,5 @@
 	public:
 	ErrorException(const string &what_arg); //for windows
-	ErrorException(const string&  what_file,const string& what_function,int what_line,const string& what_arg);//UNIX
+	ErrorException(const string &what_file,const string& what_function,int what_line,const string& what_arg);//UNIX
 	~ErrorException() throw();
 	virtual const char *what() const throw();
Index: /issm/trunk-jpl/src/c/shared/LatLong/Ll2xyx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/LatLong/Ll2xyx.cpp	(revision 16151)
+++ /issm/trunk-jpl/src/c/shared/LatLong/Ll2xyx.cpp	(revision 16152)
@@ -46,5 +46,5 @@
 	int     i,iret=0;
 	double  delta,slat;
-	double  cde,re,ex2,ex;
+	double  re,ex2,ex;
 	double  latitude,longitude;
 	double  T,rho,sl,tc,mc;
@@ -55,6 +55,4 @@
 	slat  = standard_parallel;
 
-	/*  Conversion constant from degrees to radians  */
-	cde = 57.29577951;
 	/*  Radius of the earth in meters  */
 	re  = 6378.273*1.e3;
Index: /issm/trunk-jpl/src/c/shared/LatLong/Xy2llx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/LatLong/Xy2llx.cpp	(revision 16151)
+++ /issm/trunk-jpl/src/c/shared/LatLong/Xy2llx.cpp	(revision 16152)
@@ -48,5 +48,5 @@
 	int     i,iret=0;
 	double  delta,slat;
-	double  cde,re,ex2,ex;
+	double  re,ex2,ex;
 	double  sl,rho,cm,T,chi;
 
@@ -56,6 +56,4 @@
 	slat  = standard_parallel;
 
-	/*  Conversion constant from degrees to radians  */
-	cde  = 57.29577951;
 	/*  Radius of the earth in meters  */
 	re   = 6378.273e+3;
Index: /issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 16151)
+++ /issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 16152)
@@ -45,15 +45,9 @@
 	static IssmPDouble* xip [MAX_LINE_GAUS_PTS]={xi1  ,xi2  ,xi3  ,xi4  };
 
-	static int np[MAX_LINE_GAUS_PTS]={sizeof(wgt1 )/sizeof(IssmPDouble),
-		sizeof(wgt2 )/sizeof(IssmPDouble),
-		sizeof(wgt3 )/sizeof(IssmPDouble),
-		sizeof(wgt4 )/sizeof(IssmPDouble)};
-
-	//	_printf0_("Gauss-Legendre recurrence coefficients ngaus=" << ngaus << "\n");
 	*pxgaus =xNew<IssmPDouble>(ngaus);
 	*pxwgt  =xNew<IssmPDouble>(ngaus);
 
 	/*  check to see if Gauss points need to be calculated  */
-	if (ngaus <= MAX_LINE_GAUS_PTS) {
+	if(ngaus <= MAX_LINE_GAUS_PTS) {
 
 		/*  copy the points from the static arrays (noting that the pointers
@@ -61,10 +55,10 @@
 			 have to know to not free them)  */
 
-		for (i=0; i<ngaus; i++) {
+		for(i=0; i<ngaus; i++) {
 			(*pxgaus)[i]=xip [ngaus-1][i];
 			(*pxwgt )[i]=wgtp[ngaus-1][i];
 		}
 	}
-	else {
+	else{
 
 		/*  calculate the Gauss points using recurrence relations  */
@@ -1259,7 +1253,4 @@
 		0.250000000000000, 0.500000000000000, 0.166666666666667, 
 		0.166666666666667, 0.166666666666667};
-	static IssmPDouble l23[]={
-		0.250000000000000, 0.166666666666667, 0.500000000000000, 
-		0.166666666666667, 0.166666666666667};
 	static IssmPDouble l33[]={
 		0.250000000000000, 0.166666666666667, 0.166666666666667, 
@@ -1511,11 +1502,4 @@
 	static IssmPDouble* xip [MAX_LINE_GLOB_PTS]={xi1  ,xi2  ,xi3  ,xi4  ,xi5  };
 
-	static int np[MAX_LINE_GLOB_PTS]={sizeof(wgt1 )/sizeof(IssmPDouble),
-		sizeof(wgt2 )/sizeof(IssmPDouble),
-		sizeof(wgt3 )/sizeof(IssmPDouble),
-		sizeof(wgt4 )/sizeof(IssmPDouble),
-		sizeof(wgt5 )/sizeof(IssmPDouble)};
-
-	//	_printf0_("Gauss-Lobatto recurrence coefficients ngaus=" << ngaus << "\n");
 	*pxgaus =xNew<IssmPDouble>(ngaus);
 	*pxwgt  =xNew<IssmPDouble>(ngaus);
Index: /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h	(revision 16151)
+++ /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h	(revision 16152)
@@ -504,6 +504,4 @@
 		IssmAbsVec<IssmDouble>* Solve(IssmAbsVec<IssmDouble>* pfin, Parameters* parameters){
 
-			int i;
-
 			/*output: */
 			IssmMpiVec<IssmDouble>* uf=NULL;
@@ -523,6 +521,5 @@
 					#endif
 					return (IssmAbsVec<IssmDouble>*)uf;
-					break;
-								}
+									 }
 				case GslEnum: {
 
@@ -535,9 +532,8 @@
 
 					return (IssmAbsVec<IssmDouble>*)uf;
-					break;
 					#else
 					_error_("GSL support not compiled in!");
 					#endif
-							  }
+								  }
 				default:
 					_error_("solver type not supported yet!");
Index: /issm/trunk-jpl/src/c/toolkits/mumps/MpiDenseMumpsSolve.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/mumps/MpiDenseMumpsSolve.cpp	(revision 16151)
+++ /issm/trunk-jpl/src/c/toolkits/mumps/MpiDenseMumpsSolve.cpp	(revision 16152)
@@ -110,5 +110,4 @@
 	/*Variables*/
 	ISSM_MPI_Comm  comm;
-	int            my_rank;
 	int            num_procs;
 	int            i,j;
@@ -125,5 +124,4 @@
 
 	/*Communicator info */
-	my_rank   = IssmComm::GetRank();
 	num_procs = IssmComm::GetSize();
 	comm      = IssmComm::GetComm();
