From 65cc6fdea4bd3d5e971738cdc58c12da7b5e77e7 Mon Sep 17 00:00:00 2001 From: dwarning Date: Thu, 8 Jun 2023 15:01:20 +0200 Subject: [PATCH] cleanup few warnings --- src/maths/sparse/spOutput.c | 2 +- src/maths/sparse/spSMP.c | 21 ++++++++++++++++++++- src/maths/sparse/spextra.c | 2 -- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/maths/sparse/spOutput.c b/src/maths/sparse/spOutput.c index e08588c7d..1a823b634 100644 --- a/src/maths/sparse/spOutput.c +++ b/src/maths/sparse/spOutput.c @@ -137,7 +137,7 @@ spPrint( { register int J = 0; int I, Row, Col, Size, Top, StartCol = 1, StopCol, Columns, ElementCount = 0; -double Magnitude, SmallestDiag, SmallestElement; +double Magnitude, SmallestDiag = 0.0, SmallestElement = 0.0; double LargestElement = 0.0, LargestDiag = 0.0; ElementPtr pElement; #if spCOMPLEX diff --git a/src/maths/sparse/spSMP.c b/src/maths/sparse/spSMP.c index 0d4a4e1b5..0baf77373 100644 --- a/src/maths/sparse/spSMP.c +++ b/src/maths/sparse/spSMP.c @@ -96,6 +96,8 @@ #define NO 0 #define YES 1 +#define NG_IGNORE(x) (void)x + typedef spREAL *RealVector; static void LoadGmin(MatrixPtr Matrix, double Gmin); @@ -153,6 +155,8 @@ SMPcLUfac( SMPmatrix *Matrix, double PivTol) { + NG_IGNORE(PivTol); + spSetComplex( Matrix ); return spFactor( Matrix ); } @@ -166,6 +170,8 @@ SMPluFac( SMPmatrix *Matrix, double PivTol, double Gmin) { + NG_IGNORE(PivTol); + spSetReal( Matrix ); LoadGmin( Matrix, Gmin ); return spFactor( Matrix ); @@ -208,6 +214,9 @@ SMPcaSolve( SMPmatrix *Matrix, double RHS[], double iRHS[], double Spare[], double iSpare[]) { + NG_IGNORE(Spare); + NG_IGNORE(iSpare); + #if spCOMPLEX spSolveTransposed( Matrix, RHS, RHS, iRHS, iRHS ); #else @@ -223,6 +232,9 @@ SMPcSolve( SMPmatrix *Matrix, double RHS[], double iRHS[], double Spare[], double iSpare[]) { + NG_IGNORE(Spare); + NG_IGNORE(iSpare); + #if spCOMPLEX spSolve( Matrix, RHS, RHS, iRHS, iRHS ); #else @@ -238,6 +250,8 @@ SMPsolve( SMPmatrix *Matrix, double RHS[], double Spare[]) { + NG_IGNORE(Spare); + #if spCOMPLEX spSolve( Matrix, RHS, RHS, (spREAL*)NULL, (spREAL*)NULL ); #else @@ -264,6 +278,8 @@ SMPmatrix **pMatrix, int dummy) { int Error; + NG_IGNORE(dummy); + *pMatrix = (SMPmatrix *)spCreate( 0, 1, &Error ); return Error; } @@ -309,8 +325,11 @@ SMPprintRHS(SMPmatrix *Matrix, char *Filename, RealVector RHS, RealVector iRHS) void SMPprint( SMPmatrix *Matrix, -char *File) +char *Filename) { + if (Filename) + spFileMatrix(Matrix, Filename, "Circuit Matrix", 0, 1, 1 ); + else spPrint( Matrix, 0, 1, 1 ); } diff --git a/src/maths/sparse/spextra.c b/src/maths/sparse/spextra.c index e7104e249..116b00053 100644 --- a/src/maths/sparse/spextra.c +++ b/src/maths/sparse/spextra.c @@ -50,7 +50,6 @@ int size = Matrix->Size; return; #endif -#if REAL for (I = 1; I <= size; I++) { pElement = Matrix->FirstInRow[I]; while (pElement != NULL) @@ -59,5 +58,4 @@ int size = Matrix->Size; } } return; -#endif /* REAL */ }