Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ab39ef6b authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Minor fixes reported by coverity

parent e2922b3f
No related branches found
No related tags found
1 merge request!31Hotfix and code factorization
......@@ -189,7 +189,7 @@ typedef enum spm_normtype_e {
SpmOneNorm = 171, /**< One norm: max_j( sum_i( |a_{ij}| ) ) */
SpmFrobeniusNorm = 174, /**< Frobenius norm: sqrt( sum_{i,j} (a_{ij}^2) ) */
SpmInfNorm = 175, /**< Inifinite norm: max_i( sum_j( |a_{ij}| ) ) */
SpmMaxNorm = 177 /**< Inifinite norm: max_{i,j}( | a_{ij} | ) */
SpmMaxNorm = 177 /**< Max norm: max_{i,j}( | a_{ij} | ) */
} spm_normtype_t;
/**
......
......@@ -321,7 +321,7 @@ spmBase( spmatrix_t *spm,
}
}
if (spm->dofs != NULL) {
for (i = 0; i <= n; i++) {
for (i = 0; i <= spm->gN; i++) {
spm->dofs[i] += baseadj;
}
}
......
......@@ -86,8 +86,8 @@ spmDofExtend( const spmatrix_t *spm,
* Initialize the dofs array where the degree of freedom of vertex i is
* dof[i+1] - dof[i]
*/
*dofptr = baseval;
if( spm->clustnum == 0 ) {
*dofptr = baseval;
for(i=0; i<spm->gN; i++, dofptr++) {
dofi = 1 + ( rand() % dof );
dofptr[1] = dofptr[0] + dofi;
......
......@@ -116,7 +116,7 @@ spm_gather_csx_update( const spmatrix_t *spm,
for ( c=1; c<spm->clustnbr; c++ ) {
/* Let's start shifting the value after the first array */
spm_int_t shift = recvdispls[c];
spm_int_t end = ( c == spm->clustnbr-1 ) ? spm->gN+1 : recvdispls[c+1];
spm_int_t end = ( c < (spm->clustnbr-1) ) ? recvdispls[c+1] : spm->gN+1;
spm_int_t i;
to_add += recvcounts[c-1];
......
......@@ -64,7 +64,7 @@ int spm_zspmm( spm_side_t side,
/**
* Norm computation routines
*/
double z_spmNorm( int ntype, const spmatrix_t *spm );
double z_spmNorm( spm_normtype_t ntype, const spmatrix_t *spm );
/**
* Extra routines
......
......@@ -386,7 +386,7 @@ z_spmOneNorm( const spmatrix_t *spm )
*
*******************************************************************************/
double
z_spmNorm( int ntype,
z_spmNorm( spm_normtype_t ntype,
const spmatrix_t *spm )
{
double norm = 0.;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment