Made mostly minor changes related to Klocwork analysis

This commit is contained in:
falgout 2012-10-13 01:19:59 +00:00
parent 10481d66d1
commit 74ae90ee0c
11 changed files with 24 additions and 23 deletions

View File

@ -229,6 +229,12 @@ HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver,
syH = (HYPRE_StructVector) sy;
switch(ssolver)
{
default:
/* If no solver is matched, use Jacobi, but throw and error */
if (ssolver != HYPRE_Jacobi)
{
hypre_error(HYPRE_ERROR_GENERIC);
} /* don't break */
case HYPRE_Jacobi:
HYPRE_StructJacobiCreate(comm, (HYPRE_StructSolver *)&sdata);
HYPRE_StructJacobiSetMaxIter(sdata, 1);
@ -331,7 +337,7 @@ HYPRE_SStructSplitSolve( HYPRE_SStructSolver solver,
hypre_ParVector *pary;
HYPRE_Int iter, part, vi, vj;
double b_dot_b, r_dot_r;
double b_dot_b = 0, r_dot_r;

View File

@ -908,12 +908,13 @@ hypre_FacSemiRestrictDestroy2( void *fac_restrict_vdata )
{
HYPRE_Int ierr = 0;
hypre_FacSemiRestrictData2 *fac_restrict_data = fac_restrict_vdata;
HYPRE_Int nvars= (fac_restrict_data-> nvars);
HYPRE_Int nvars;
HYPRE_Int i, j;
if (fac_restrict_data)
{
nvars= (fac_restrict_data-> nvars);
hypre_SStructPVectorDestroy(fac_restrict_data-> fgrid_cvectors);
for (i= 0; i< nvars; i++)

View File

@ -70,8 +70,8 @@ hypre_FACSolve3( void *fac_vdata,
hypre_ParVector *parx;
hypre_ParVector *pary;
double b_dot_b, r_dot_r, eps;
double e_dot_e, e_dot_e_l, x_dot_x;
double b_dot_b = 0, r_dot_r, eps = 0;
double e_dot_e = 0, e_dot_e_l, x_dot_x = 1;
HYPRE_Int level, i;
HYPRE_Int ierr = 0;

View File

@ -10,9 +10,6 @@
* $Revision$
***********************************************************************EHEADER*/
#include "_hypre_sstruct_ls.h"
/*--------------------------------------------------------------------------
@ -86,8 +83,8 @@ hypre_MaxwellSolve( void * maxwell_vdata,
HYPRE_Int Solve_err_flag;
HYPRE_Int relax_local, cycle_param;
double b_dot_b, r_dot_r, eps;
double e_dot_e, x_dot_x;
double b_dot_b = 0, r_dot_r, eps = 0;
double e_dot_e = 0, x_dot_x = 1;
HYPRE_Int i, j;
HYPRE_Int level;

View File

@ -81,7 +81,7 @@ hypre_MaxwellSolve2( void * maxwell_vdata,
HYPRE_Int Solve_err_flag;
HYPRE_Int relax_local, cycle_param;
double b_dot_b, r_dot_r, eps;
double b_dot_b = 0, r_dot_r, eps = 0;
double e_dot_e, x_dot_x;
HYPRE_Int i, j;

View File

@ -5500,6 +5500,7 @@ hypre_CollapseStencilToStencil(hypre_ParCSRMatrix *Aee,
marker= hypre_TAlloc(HYPRE_Int, max_ranksize);
cnt= 0;
centre= 0;
for (j= -1; j<= 1; j++)
{
hypre_CopyIndex(pt_location, index1);

View File

@ -53,8 +53,8 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata,
double *rel_norms = (sys_pfmg_data -> rel_norms);
HYPRE_Int *active_l = (sys_pfmg_data -> active_l);
double b_dot_b, r_dot_r, eps;
double e_dot_e, x_dot_x;
double b_dot_b, r_dot_r, eps = 0;
double e_dot_e = 0, x_dot_x = 1;
HYPRE_Int i, l;
@ -276,11 +276,6 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata,
hypre_SStructPInnerProd(e_l[0], e_l[0], &e_dot_e);
hypre_SStructPInnerProd(x_l[0], x_l[0], &x_dot_x);
}
else
{
e_dot_e = 0.0;
x_dot_x = 1.0;
}
}
/* fine grid post-relaxation */

View File

@ -85,12 +85,13 @@ HYPRE_SStructVectorDestroy( HYPRE_SStructVector vector )
HYPRE_Int nparts;
hypre_SStructPVector **pvectors;
HYPRE_Int part;
HYPRE_Int vector_type = hypre_SStructVectorObjectType(vector);
HYPRE_Int vector_type;
/* GEC1002 destroying dataindices and data in vector */
/* GEC1002 destroying data indices and data in vector */
if (vector)
{
vector_type = hypre_SStructVectorObjectType(vector);
hypre_SStructVectorRefCount(vector) --;
if (hypre_SStructVectorRefCount(vector) == 0)
{

View File

@ -2241,7 +2241,7 @@ hypre_SStructGridIntersect( hypre_SStructGrid *grid,
{
boxman = hypre_SStructGridBoxManager(grid, part, var);
}
else if (action == 1)
else
{
boxman = hypre_SStructGridNborBoxManager(grid, part, var);
}

View File

@ -63,7 +63,7 @@ hypre_PFMGSolve( void *pfmg_vdata,
double *rel_norms = (pfmg_data -> rel_norms);
HYPRE_Int *active_l = (pfmg_data -> active_l);
double b_dot_b, r_dot_r, eps;
double b_dot_b = 0, r_dot_r, eps = 0;
double e_dot_e, x_dot_x;
HYPRE_Int i, l;

View File

@ -80,8 +80,8 @@ hypre_SMGSolve( void *smg_vdata,
double *norms = (smg_data -> norms);
double *rel_norms = (smg_data -> rel_norms);
double b_dot_b, r_dot_r, eps;
double e_dot_e, x_dot_x;
double b_dot_b = 0, r_dot_r, eps = 0;
double e_dot_e = 0, x_dot_x = 1;
HYPRE_Int i, l;