diff --git a/src/maths/sparse/spAllocate.c b/src/maths/sparse/spAllocate.c index bfad2a2fb..b8afd886f 100644 --- a/src/maths/sparse/spAllocate.c +++ b/src/maths/sparse/spAllocate.c @@ -202,7 +202,7 @@ int AllocatedSize; Matrix->FillinsRemaining = 0; RecordAllocation( Matrix, (void *)Matrix ); - if (Matrix->Error == spNO_MEMORY) goto MemoryError; + if (Matrix->Error == spNO_MEMORY) goto MemoryError; /* FIXME: Use of memory after free */ /* Take out the trash. */ Matrix->TrashCan.Real = 0.0; diff --git a/src/maths/sparse/spBuild.c b/src/maths/sparse/spBuild.c index 81b5885df..2ce9471be 100644 --- a/src/maths/sparse/spBuild.c +++ b/src/maths/sparse/spBuild.c @@ -185,7 +185,7 @@ spFindElement( ) { register ElementPtr pElement; -int StartAt; +int StartAt = 0; long int Min = LARGEST_LONG_INTEGER; #define BorderRight 0 /* Start at left border, move right. */ #define BorderDown 1 /* Start at top border, move down. */ diff --git a/src/maths/sparse/spFactor.c b/src/maths/sparse/spFactor.c index 22293dd52..6ed0add0f 100644 --- a/src/maths/sparse/spFactor.c +++ b/src/maths/sparse/spFactor.c @@ -377,7 +377,7 @@ RealNumber Mult; /* Update column. */ pColumn = Matrix->FirstInCol[Step]; - while (pColumn->Row < Step) + while (pColumn->Row < Step) /* FIXME: Access to Row results in dereference of NULL pointer */ { pElement = Matrix->Diag[pColumn->Row]; pColumn->Real = Dest[pColumn->Row] * pElement->Real; while ((pElement = pElement->NextInCol) != NULL) @@ -409,7 +409,7 @@ RealNumber Mult; /* Update column. */ pColumn = Matrix->FirstInCol[Step]; - while (pColumn->Row < Step) + while (pColumn->Row < Step) /* FIXME: Access to Row results in dereference of NULL pointer */ { pElement = Matrix->Diag[pColumn->Row]; Mult = (*pDest[pColumn->Row] *= pElement->Real); while ((pElement = pElement->NextInCol) != NULL) @@ -486,7 +486,7 @@ ComplexNumber Mult, Pivot; /* Update column. */ pColumn = Matrix->FirstInCol[Step]; - while (pColumn->Row < Step) + while (pColumn->Row < Step) /* FIXME: Access to Row results in dereference of NULL pointer */ { pElement = Matrix->Diag[pColumn->Row]; /* Cmplx expr: Mult = Dest[pColumn->Row] * (1.0 / *pPivot). */ CMPLX_MULT(Mult, Dest[pColumn->Row], *pElement); @@ -524,7 +524,7 @@ ComplexNumber Mult, Pivot; /* Update column. */ pColumn = Matrix->FirstInCol[Step]; - while (pColumn->Row < Step) + while (pColumn->Row < Step) /* FIXME: Access to Row results in dereference of NULL pointer */ { pElement = Matrix->Diag[pColumn->Row]; /* Cmplx expr: Mult = *pDest[pColumn->Row] * (1.0 / *pPivot). */ CMPLX_MULT(Mult, *pDest[pColumn->Row], *pElement); @@ -656,7 +656,7 @@ BOOLEAN *DoRealDirect; } pColumn = Matrix->FirstInCol[Step]; - while (pColumn->Row < Step) + while (pColumn->Row < Step) /* FIXME: Access to Row results in dereference of NULL pointer */ { pElement = Matrix->Diag[pColumn->Row]; Nm[Step]++; while ((pElement = pElement->NextInCol) != NULL) @@ -2530,7 +2530,7 @@ register ElementPtr pElement; pElement = *ElementAboveRow2; } while (pElement->Row < Row2); - ElementBelowRow2 = Element2->NextInCol; + ElementBelowRow2 = Element2->NextInCol;/* FIXME: ElementBelowRow2 is never read */ /* Move Element2 to Row1. */ *ElementAboveRow2 = Element2->NextInCol; @@ -2675,7 +2675,7 @@ register ElementPtr pElement; pElement = *ElementLeftOfCol2; } while (pElement->Col < Col2); - ElementRightOfCol2 = Element2->NextInRow; + ElementRightOfCol2 = Element2->NextInRow; /* FIXME: ElementRightOfCol2 is never read */ /* Move Element2 to Col1. */ *ElementLeftOfCol2 = Element2->NextInRow; diff --git a/src/maths/sparse/spUtils.c b/src/maths/sparse/spUtils.c index 1eb3ec5fc..a932e086f 100644 --- a/src/maths/sparse/spUtils.c +++ b/src/maths/sparse/spUtils.c @@ -240,7 +240,7 @@ BOOLEAN Swapped, AnotherPassNeeded; if (AnotherPassNeeded) { for (J = StartAt; NOT Swapped AND (J <= Size); J++) { if (Matrix->Diag[J] == NULL) - { Twins = CountTwins( Matrix, J, &pTwin1, &pTwin2 ); + { Twins = CountTwins( Matrix, J, &pTwin1, &pTwin2 ); /* FIXME: Twins is never used */ SwapCols( Matrix, pTwin1, pTwin2 ); Swapped = YES; }