Commit adb41a00 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Merge branch 'sonarqube' into 'master'

Sonarqube

See merge request solverstack/chameleon!79
parents 2e8a8bb2 98ba8385
Subproject commit b102625ef8626da53d4461e84050dc4cb5e62afb
Subproject commit a5142c9b74e6bfa007142aff48c3c70f99805995
......@@ -111,7 +111,7 @@ int MORSE_zgeadd( MORSE_enum trans, int M, int N,
}
/* Check input arguments */
if ((trans != MorseNoTrans) && (trans != MorseTrans) && (trans != MorseConjTrans)) {
if ((trans < MorseNoTrans) || (trans > MorseConjTrans)) {
morse_error("MORSE_zgeadd", "illegal value of trans");
return -1;
}
......@@ -324,7 +324,7 @@ int MORSE_zgeadd_Tile_Async( MORSE_enum trans,
return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
}
/* Check input arguments */
if ((trans != MorseNoTrans) && (trans != MorseTrans) && (trans != MorseConjTrans)) {
if ((trans < MorseNoTrans) || (trans > MorseConjTrans)) {
morse_error("MORSE_zgeadd_Tile_Async", "illegal value of trans");
return morse_request_fail(sequence, request, -1);
}
......
......@@ -152,11 +152,11 @@ int MORSE_zgemm( MORSE_enum transA, MORSE_enum transB, int M, int N, int K,
}
/* Check input arguments */
if ((transA != MorseNoTrans) && (transA != MorseTrans) && (transA != MorseConjTrans)) {
if ((transA < MorseNoTrans) || (transA > MorseConjTrans)) {
morse_error("MORSE_zgemm", "illegal value of transA");
return -1;
}
if ((transB != MorseNoTrans) && (transB != MorseTrans) && (transB != MorseConjTrans)) {
if ((transB < MorseNoTrans) || (transB > MorseConjTrans)) {
morse_error("MORSE_zgemm", "illegal value of transB");
return -2;
}
......@@ -401,11 +401,11 @@ int MORSE_zgemm_Tile_Async( MORSE_enum transA, MORSE_enum transB,
return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
}
/* Check input arguments */
if ((transA != MorseNoTrans) && (transA != MorseTrans) && (transA != MorseConjTrans)) {
if ((transA < MorseNoTrans) || (transA > MorseConjTrans)) {
morse_error("MORSE_zgemm_Tile_Async", "illegal value of transA");
return morse_request_fail(sequence, request, -1);
}
if ((transB != MorseNoTrans) && (transB != MorseTrans) && (transB != MorseConjTrans)) {
if ((transB < MorseNoTrans) || (transB > MorseConjTrans)) {
morse_error("MORSE_zgemm_Tile_Async", "illegal value of transB");
return morse_request_fail(sequence, request, -2);
}
......
......@@ -121,7 +121,7 @@ int MORSE_ztradd( MORSE_enum uplo, MORSE_enum trans, int M, int N,
morse_error("MORSE_ztradd", "illegal value of uplo");
return -1;
}
if ((trans != MorseNoTrans) && (trans != MorseTrans) && (trans != MorseConjTrans)) {
if ((trans < MorseNoTrans) || (trans > MorseConjTrans)) {
morse_error("MORSE_ztradd", "illegal value of trans");
return -2;
}
......@@ -340,7 +340,7 @@ int MORSE_ztradd_Tile_Async( MORSE_enum uplo, MORSE_enum trans,
return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
}
/* Check input arguments */
if ((trans != MorseNoTrans) && (trans != MorseTrans) && (trans != MorseConjTrans)) {
if ((trans < MorseNoTrans) || (trans > MorseConjTrans)) {
morse_error("MORSE_ztradd_Tile_Async", "illegal value of trans");
return morse_request_fail(sequence, request, -1);
}
......
......@@ -371,7 +371,7 @@ int MORSE_ztrmm_Tile_Async( MORSE_enum side, MORSE_enum uplo,
morse_error("MORSE_ztrmm_Tile", "illegal value of uplo");
return morse_request_fail(sequence, request, -2);
}
if (transA != MorseConjTrans && transA != MorseNoTrans && transA != MorseTrans) {
if ((transA < MorseNoTrans) || (transA > MorseConjTrans)) {
morse_error("MORSE_ztrmm_Tile", "illegal value of transA");
return morse_request_fail(sequence, request, -3);
}
......
......@@ -136,7 +136,7 @@ int MORSE_ztrsm( MORSE_enum side, MORSE_enum uplo,
morse_error("MORSE_ztrsm", "illegal value of uplo");
return -2;
}
if (transA != MorseConjTrans && transA != MorseNoTrans && transA != MorseTrans ) {
if (((transA < MorseNoTrans) || (transA > MorseConjTrans)) ) {
morse_error("MORSE_ztrsm", "illegal value of transA");
return -3;
}
......@@ -369,7 +369,7 @@ int MORSE_ztrsm_Tile_Async( MORSE_enum side, MORSE_enum uplo,
morse_error("MORSE_ztrsm_Tile", "illegal value of uplo");
return morse_request_fail(sequence, request, -2);
}
if (transA != MorseConjTrans && transA != MorseNoTrans && transA != MorseTrans) {
if ((transA < MorseNoTrans) || (transA > MorseConjTrans)) {
morse_error("MORSE_ztrsm_Tile", "illegal value of transA");
return morse_request_fail(sequence, request, -3);
}
......
......@@ -93,9 +93,7 @@ int CORE_zgeadd(MORSE_enum trans, int M, int N,
{
int i, j;
if ((trans != MorseNoTrans) &&
(trans != MorseTrans) &&
(trans != MorseConjTrans))
if ((trans < MorseNoTrans) || (trans > MorseConjTrans))
{
coreblas_error(1, "illegal value of trans");
return -1;
......
......@@ -99,7 +99,7 @@ int CORE_zlatro(MORSE_enum uplo, MORSE_enum trans,
coreblas_error(1, "Illegal value of uplo");
return -1;
}
if ((trans != MorseConjTrans) && (trans != MorseNoTrans) && (trans != MorseTrans) ) {
if ((trans < MorseNoTrans) || (trans > MorseConjTrans)) {
coreblas_error(2, "Illegal value of trans");
return -2;
}
......
......@@ -146,7 +146,7 @@ int CORE_zpemv(MORSE_enum trans, int storev,
/* Check input arguments */
if ((trans != MorseNoTrans) && (trans != MorseTrans) && (trans != MorseConjTrans)) {
if ((trans < MorseNoTrans) || (trans > MorseConjTrans)) {
coreblas_error(1, "Illegal value of trans");
return -1;
}
......
......@@ -118,9 +118,7 @@ int CORE_ztradd(MORSE_enum uplo, MORSE_enum trans, int M, int N,
return -1;
}
if ((trans != MorseNoTrans) &&
(trans != MorseTrans) &&
(trans != MorseConjTrans))
if ((trans < MorseNoTrans) || (trans > MorseConjTrans))
{
coreblas_error(2, "illegal value of trans");
return -2;
......
......@@ -16,7 +16,7 @@
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Cedric Castagnede
......
......@@ -16,7 +16,7 @@
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Cedric Castagnede
......
......@@ -83,7 +83,10 @@ int testing_zgeadd(int argc, char **argv)
MORSE_Complex64_t *Bfinal = (MORSE_Complex64_t *)malloc(LDBxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ((!A)||(!B)||(!Binit)||(!Bfinal)){
if ( (!A) || (!B) || (!Binit) || (!Bfinal) )
{
free(A); free(B);
free(Binit); free(Bfinal);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -258,7 +258,11 @@ int testing_zgels(int argc, char **argv)
MORSE_desc_t *T;
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Q)){
if ( (!A1) || (!A2) || (!B1) || (!B2) || (!Q) )
{
free(A1); free(A2);
free(B1); free(B2);
free(Q);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -95,7 +95,11 @@ int testing_zgels_hqr(int argc, char **argv)
MORSE_desc_t *TT = NULL;
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Q)){
if ( (!A1) || (!A2) || (!B1) || (!B2) || (!Q) )
{
free(A1); free(A2);
free(B1); free(B2);
free(Q);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -89,7 +89,11 @@ int testing_zgels_systolic(int argc, char **argv)
MORSE_desc_t *TT = NULL;
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Q)){
if ( (!A1) || (!A2) || (!B1) || (!B2) || (!Q) )
{
free(A1); free(A2);
free(B1); free(B2);
free(Q);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -88,7 +88,10 @@ int testing_zgemm(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ((!A)||(!B)||(!Cinit)||(!Cfinal)){
if ( (!A) || (!B) || (!Cinit) || (!Cfinal) )
{
free(A); free(B);
free(Cinit); free(Cfinal);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -87,6 +87,8 @@ int testing_zgeqrf_qdwh(int argc, char **argv)
/* Check if unable to allocate memory */
if ( (!A) || (!A1) || (!A2) || (!Q1) || (!Q2) ){
free(A); free(A1); free(A2);
free(Q1); free(Q2);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -196,7 +196,10 @@ int testing_zgesv_incpiv(int argc, char **argv)
int *IPIV;
/* Check if unable to allocate memory */
if ( (!A1) || (!A2)|| (!B1) || (!B2) ) {
if ( (!A1) || (!A2)|| (!B1) || (!B2) )
{
free(A1); free(A2);
free(B1); free(B2);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -100,6 +100,8 @@ int testing_zgesvd(int argc, char **argv)
/* Check if unable to allocate memory */
if ( (!A1) || (!S1) || (!S2) || (!work) ) {
free(A1); free(work);
free(S1); free(S2);
printf("Out of Memory \n ");
return -2;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment