summaryrefslogtreecommitdiffstats
path: root/src/bdd/reo
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2008-07-02 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2008-07-02 08:01:00 -0700
commit303baf27cf34c2a57db97c4c567fd744241fa14b (patch)
treed6235cca48e7bdfe5884e517058c7791e66bb806 /src/bdd/reo
parentfa67e3c19e27c011517b91182eb3929412aaf402 (diff)
downloadabc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.gz
abc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.bz2
abc-303baf27cf34c2a57db97c4c567fd744241fa14b.zip
Version abc80702
Diffstat (limited to 'src/bdd/reo')
-rw-r--r--src/bdd/reo/reoSwap.c122
-rw-r--r--src/bdd/reo/reoTransfer.c10
-rw-r--r--src/bdd/reo/reoUnits.c2
3 files changed, 69 insertions, 65 deletions
diff --git a/src/bdd/reo/reoSwap.c b/src/bdd/reo/reoSwap.c
index 4afa650c..d3a9c7a5 100644
--- a/src/bdd/reo/reoSwap.c
+++ b/src/bdd/reo/reoSwap.c
@@ -47,7 +47,8 @@ double reoReorderSwapAdjacentVars( reo_man * p, int lev0, int fMovingUp )
// the new nodes on lev0
reo_unit * pLoop, * pUnit;
// the new nodes on lev1
- reo_unit * pNewPlane20, * pNewPlane21, * pNewPlane20R;
+ reo_unit * pNewPlane20 = NULL, * pNewPlane21 = NULL; // Suppress "might be used uninitialized"
+ reo_unit * pNewPlane20R;
reo_unit * pUnitE, * pUnitER, * pUnitT;
// the nodes below lev1
reo_unit * pNew1E, * pNew1T, * pNew2E, * pNew2T;
@@ -60,18 +61,19 @@ double reoReorderSwapAdjacentVars( reo_man * p, int lev0, int fMovingUp )
reo_unit * pListNew1 = NULL, ** ppListNew1 = &pListNew1;
reo_unit * pListTemp = NULL, ** ppListTemp = &pListTemp;
// various integer variables
- int fComp, fCompT, fFound, nWidthCofs, HKey, fInteract, temp, c;
+ int fComp, fCompT, fFound, HKey, fInteract, temp, c;
+ int nWidthCofs = -1; // Suppress "might be used uninitialized"
// statistical variables
int nNodesUpMovedDown = 0;
int nNodesDownMovedUp = 0;
int nNodesUnrefRemoved = 0;
int nNodesUnrefAdded = 0;
int nWidthReduction = 0;
- double AplWeightTotalLev0;
- double AplWeightTotalLev1;
- double AplWeightHalf;
- double AplWeightPrev;
- double AplWeightAfter;
+ double AplWeightTotalLev0 = 0.0; // Suppress "might be used uninitialized"
+ double AplWeightTotalLev1 = 0.0; // Suppress "might be used uninitialized"
+ double AplWeightHalf = 0.0; // Suppress "might be used uninitialized"
+ double AplWeightPrev = 0.0; // Suppress "might be used uninitialized"
+ double AplWeightAfter = 0.0; // Suppress "might be used uninitialized"
double nCostGain;
// set the old lists
@@ -248,14 +250,14 @@ double reoReorderSwapAdjacentVars( reo_man * p, int lev0, int fMovingUp )
{
// before after
//
- // <p1>
- // 0 / \ 1
- // / \
- // / \
- // / \ <p2n>
- // / \ 0 / \ 1
- // / \ / \
- // / \ / \
+ // <p1> .
+ // 0 / \ 1 .
+ // / \ .
+ // / \ .
+ // / \ <p2n> .
+ // / \ 0 / \ 1 .
+ // / \ / \ .
+ // / \ / \ .
// F0 F1 F0 F1
// move to plane-2-new
@@ -333,15 +335,15 @@ double reoReorderSwapAdjacentVars( reo_man * p, int lev0, int fMovingUp )
{
// before after
//
- // <p1> <p1n>
- // 0 / \ 1 0 / \ 1
- // / \ / \
- // / \ / \
- // <p2> <p2> <p2n> <p2n>
- // 0 / \ 1 0 / \ 1 0 / \ 1 0 / \ 1
- // / \ / \ / \ / \
- // / \ / \ / \ / \
- // F0 F1 F2 F3 F0 F2 F1 F3
+ // <p1> <p1n> .
+ // 0 / \ 1 0 / \ 1 .
+ // / \ / \ .
+ // / \ / \ .
+ // <p2> <p2> <p2n> <p2n> .
+ // 0 / \ 1 0 / \ 1 0 / \ 1 0 / \ 1 .
+ // / \ / \ / \ / \ .
+ // / \ / \ / \ / \ .
+ // F0 F1 F2 F3 F0 F2 F1 F3 .
// pNew1E pNew1T pNew2E pNew2T
//
pNew1E = pUnitE->pE; // F0
@@ -354,15 +356,15 @@ double reoReorderSwapAdjacentVars( reo_man * p, int lev0, int fMovingUp )
{
// before after
//
- // <p1> <p1n>
- // 0 . \ 1 0 / \ 1
- // . \ / \
- // . \ / \
- // <p2> <p2> <p2n> <p2n>
- // 0 / \ 1 0 / \ 1 0 . \ 1 0 . \ 1
- // / \ / \ . \ . \
- // / \ / \ . \ . \
- // F0 F1 F2 F3 F0 F2 F1 F3
+ // <p1> <p1n> .
+ // 0 . \ 1 0 / \ 1 .
+ // . \ / \ .
+ // . \ / \ .
+ // <p2> <p2> <p2n> <p2n> .
+ // 0 / \ 1 0 / \ 1 0 . \ 1 0 . \ 1 .
+ // / \ / \ . \ . \ .
+ // / \ / \ . \ . \ .
+ // F0 F1 F2 F3 F0 F2 F1 F3 .
// pNew1E pNew1T pNew2E pNew2T
//
pNew1E = Unit_Not(pUnitER->pE); // F0
@@ -389,15 +391,15 @@ double reoReorderSwapAdjacentVars( reo_man * p, int lev0, int fMovingUp )
{
// before after
//
- // <p1> <p1n>
- // 0 / \ 1 0 / \ 1
- // / \ / \
- // / \ / \
- // <p2> \ <p2n> <p2n>
- // 0 / \ 1 \ 0 / \ 1 0 / \ 1
- // / \ \ / \ / \
- // / \ \ / \ / \
- // F0 F1 F3 F0 F3 F1 F3
+ // <p1> <p1n> .
+ // 0 / \ 1 0 / \ 1 .
+ // / \ / \ .
+ // / \ / \ .
+ // <p2> \ <p2n> <p2n> .
+ // 0 / \ 1 \ 0 / \ 1 0 / \ 1 .
+ // / \ \ / \ / \ .
+ // / \ \ / \ / \ .
+ // F0 F1 F3 F0 F3 F1 F3 .
// pNew1E pNew1T pNew2E pNew2T
//
pNew1E = pUnitER->pE; // F0
@@ -410,15 +412,15 @@ double reoReorderSwapAdjacentVars( reo_man * p, int lev0, int fMovingUp )
{
// before after
//
- // <p1> <p1n>
- // 0 . \ 1 0 / \ 1
- // . \ / \
- // . \ / \
- // <p2> \ <p2n> <p2n>
- // 0 / \ 1 \ 0 . \ 1 0 . \ 1
- // / \ \ . \ . \
- // / \ \ . \ . \
- // F0 F1 F3 F0 F3 F1 F3
+ // <p1> <p1n> .
+ // 0 . \ 1 0 / \ 1 .
+ // . \ / \ .
+ // . \ / \ .
+ // <p2> \ <p2n> <p2n> .
+ // 0 / \ 1 \ 0 . \ 1 0 . \ 1 .
+ // / \ \ . \ . \ .
+ // / \ \ . \ . \ .
+ // F0 F1 F3 F0 F3 F1 F3 .
// pNew1E pNew1T pNew2E pNew2T
//
pNew1E = Unit_Not(pUnitER->pE); // F0
@@ -443,15 +445,15 @@ double reoReorderSwapAdjacentVars( reo_man * p, int lev0, int fMovingUp )
{
// before after
//
- // <p1> <p1n>
- // 0 / \ 1 0 / \ 1
- // / \ / \
- // / \ / \
- // / <p2> <p2n> <p2n>
- // / 0 / \ 1 0 / \ 1 0 / \ 1
- // / / \ / \ / \
- // / / \ / \ / \
- // F0 F2 F3 F0 F2 F0 F3
+ // <p1> <p1n> .
+ // 0 / \ 1 0 / \ 1 .
+ // / \ / \ .
+ // / \ / \ .
+ // / <p2> <p2n> <p2n> .
+ // / 0 / \ 1 0 / \ 1 0 / \ 1 .
+ // / / \ / \ / \ .
+ // / / \ / \ / \ .
+ // F0 F2 F3 F0 F2 F0 F3 .
// pNew1E pNew1T pNew2E pNew2T
//
pNew1E = pUnitE; // F0
diff --git a/src/bdd/reo/reoTransfer.c b/src/bdd/reo/reoTransfer.c
index 65d31d01..26a6689e 100644
--- a/src/bdd/reo/reoTransfer.c
+++ b/src/bdd/reo/reoTransfer.c
@@ -41,7 +41,8 @@ reo_unit * reoTransferNodesToUnits_rec( reo_man * p, DdNode * F )
{
DdManager * dd = p->dd;
reo_unit * pUnit;
- int HKey, fComp;
+ int HKey = -1; // Suppress "might be used uninitialized"
+ int fComp;
fComp = Cudd_IsComplement(F);
F = Cudd_Regular(F);
@@ -68,7 +69,7 @@ reo_unit * reoTransferNodesToUnits_rec( reo_man * p, DdNode * F )
if ( cuddIsConstant(F) )
{
pUnit->lev = REO_CONST_LEVEL;
- pUnit->pE = (reo_unit*)((int)(cuddV(F)));
+ pUnit->pE = (reo_unit*)((int)(PORT_PTRUINT_T)(cuddV(F)));
pUnit->pT = NULL;
// check if the diagram that is being reordering has complement edges
if ( F != dd->one )
@@ -117,7 +118,8 @@ DdNode * reoTransferUnitsToNodes_rec( reo_man * p, reo_unit * pUnit )
{
DdManager * dd = p->dd;
DdNode * bRes, * E, * T;
- int HKey, fComp;
+ int HKey = -1; // Suppress "might be used uninitialized"
+ int fComp;
fComp = Cudd_IsComplement(pUnit);
pUnit = Unit_Regular(pUnit);
@@ -137,7 +139,7 @@ DdNode * reoTransferUnitsToNodes_rec( reo_man * p, reo_unit * pUnit )
// treat the case of constants
if ( Unit_IsConstant(pUnit) )
{
- bRes = cuddUniqueConst( dd, ((double)((int)(pUnit->pE))) );
+ bRes = cuddUniqueConst( dd, ((double)((int)(PORT_PTRUINT_T)(pUnit->pE))) );
cuddRef( bRes );
}
else
diff --git a/src/bdd/reo/reoUnits.c b/src/bdd/reo/reoUnits.c
index aa86516e..52137027 100644
--- a/src/bdd/reo/reoUnits.c
+++ b/src/bdd/reo/reoUnits.c
@@ -84,7 +84,7 @@ void reoUnitsRecycleUnit( reo_man * p, reo_unit * pUnit )
void reoUnitsRecycleUnitList( reo_man * p, reo_plane * pPlane )
{
reo_unit * pUnit;
- reo_unit * pTail;
+ reo_unit * pTail = NULL; // Suppress "might be used uninitialized"
if ( pPlane->pHead == NULL )
return;