diff options
Diffstat (limited to 'src/opt')
38 files changed, 220 insertions, 211 deletions
diff --git a/src/opt/cut/cutMan.c b/src/opt/cut/cutMan.c index 8593ef93..882567fd 100644 --- a/src/opt/cut/cutMan.c +++ b/src/opt/cut/cutMan.c @@ -44,7 +44,6 @@ extern void Npn_StartTruth8( uint8 uTruths[][32] ); Cut_Man_t * Cut_ManStart( Cut_Params_t * pParams ) { Cut_Man_t * p; - int clk = clock(); // extern int nTruthDsd; // nTruthDsd = 0; assert( pParams->nVarsMax >= 3 && pParams->nVarsMax <= CUT_SIZE_MAX ); @@ -121,16 +120,6 @@ Cut_Man_t * Cut_ManStart( Cut_Params_t * pParams ) ***********************************************************************/ void Cut_ManStop( Cut_Man_t * p ) { - Cut_Cut_t * pCut; - int i; -// extern int nTruthDsd; -// printf( "Decomposable cuts = %d.\n", nTruthDsd ); - - Vec_PtrForEachEntry( p->vCutsNew, pCut, i ) - if ( pCut != NULL ) - { - int k = 0; - } if ( p->vCutsNew ) Vec_PtrFree( p->vCutsNew ); if ( p->vCutsOld ) Vec_PtrFree( p->vCutsOld ); if ( p->vCutsTemp ) Vec_PtrFree( p->vCutsTemp ); diff --git a/src/opt/cut/cutNode.c b/src/opt/cut/cutNode.c index 1f93b14b..2d17020b 100644 --- a/src/opt/cut/cutNode.c +++ b/src/opt/cut/cutNode.c @@ -561,7 +561,8 @@ int Cut_ManMappingArea_rec( Cut_Man_t * p, int Node ) ***********************************************************************/ void Cut_NodeDoComputeCuts( Cut_Man_t * p, Cut_List_t * pSuper, int Node, int fCompl0, int fCompl1, Cut_Cut_t * pList0, Cut_Cut_t * pList1, int fTriv, int TreeCode ) { - Cut_Cut_t * pStop0, * pStop1, * pTemp0, * pTemp1, * pStore0, * pStore1; + Cut_Cut_t * pStop0, * pStop1, * pTemp0, * pTemp1; + Cut_Cut_t * pStore0 = NULL, * pStore1 = NULL; // Suppress "might be used uninitialized" int i, nCutsOld, Limit; // start with the elementary cut if ( fTriv ) @@ -667,7 +668,8 @@ Quits: Cut_Cut_t * Cut_NodeUnionCuts( Cut_Man_t * p, Vec_Int_t * vNodes ) { Cut_List_t Super, * pSuper = &Super; - Cut_Cut_t * pList, * pListStart, * pCut, * pCut2, * pTop; + Cut_Cut_t * pList, * pListStart, * pCut, * pCut2; + Cut_Cut_t * pTop = NULL; // Suppress "might be used uninitialized" int i, k, Node, Root, Limit = p->pParams->nVarsMax; int clk = clock(); @@ -973,11 +975,9 @@ int Cut_CutListVerify( Cut_Cut_t * pList ) { if ( Cut_CutCheckDominance( pDom, pCut ) ) { - int x = 0; printf( "******************* These are contained cuts:\n" ); Cut_CutPrint( pDom, 1 ); Cut_CutPrint( pDom, 1 ); - return 0; } } diff --git a/src/opt/cut/cutOracle.c b/src/opt/cut/cutOracle.c index 3eb4462b..4ec6bc05 100644 --- a/src/opt/cut/cutOracle.c +++ b/src/opt/cut/cutOracle.c @@ -70,7 +70,6 @@ static Cut_Cut_t * Cut_CutMerge( Cut_Oracle_t * p, Cut_Cut_t * pCut0, Cut_Cut_t Cut_Oracle_t * Cut_OracleStart( Cut_Man_t * pMan ) { Cut_Oracle_t * p; - int clk = clock(); assert( pMan->pParams->nVarsMax >= 3 && pMan->pParams->nVarsMax <= CUT_SIZE_MAX ); assert( pMan->pParams->fRecord ); @@ -135,10 +134,7 @@ void Cut_OracleStop( Cut_Oracle_t * p ) } Vec_PtrForEachEntry( p->vCutsNew, pCut, i ) - if ( pCut != NULL ) - { - int k = 0; - } + if ( p->vCuts0 ) Vec_PtrFree( p->vCuts0 ); if ( p->vCuts1 ) Vec_PtrFree( p->vCuts1 ); if ( p->vCutsNew ) Vec_PtrFree( p->vCutsNew ); diff --git a/src/opt/cut/cutPre22.c b/src/opt/cut/cutPre22.c index 5cb87a9c..5ba860c9 100644 --- a/src/opt/cut/cutPre22.c +++ b/src/opt/cut/cutPre22.c @@ -74,30 +74,30 @@ struct Cut_CMan_t_ }; // NP-classes of functions of 3 variables (22) -static char * s_NP3[22] = { - " 0\n", // 00 const 0 // 0 vars - " 1\n", // 01 const 1 // 0 vars - "1 1\n", // 02 a // 1 vars - "11 1\n", // 03 ab // 2 vars - "11 0\n", // 04 (ab)' // 2 vars - "10 1\n01 1\n", // 05 a<+>b // 2 vars - "111 1\n", // 06 0s abc // 3 vars - "111 0\n", // 07 (abc)' // - "11- 1\n1-1 1\n", // 08 1p a(b+c) // - "11- 0\n1-1 0\n", // 09 (a(b+c))' // - "111 1\n100 1\n010 1\n001 1\n", // 10 2s a<+>b<+>c // - "10- 0\n1-0 0\n011 0\n", // 11 3p a<+>bc // - "101 1\n110 1\n", // 12 4p a(b<+>c) // - "101 0\n110 0\n", // 13 (a(b<+>c))' // - "11- 1\n1-1 1\n-11 1\n", // 14 5s ab+bc+ac // - "111 1\n000 1\n", // 15 6s abc+a'b'c' // - "111 0\n000 0\n", // 16 (abc+a'b'c')' // - "11- 1\n-11 1\n0-1 1\n", // 17 7 ab+bc+a'c // - "011 1\n101 1\n110 1\n", // 18 8s a'bc+ab'c+abc' // - "011 0\n101 0\n110 0\n", // 19 (a'bc+ab'c+abc')' // - "100 1\n-11 1\n", // 20 9p ab'c'+bc // - "100 0\n-11 0\n" // 21 (ab'c'+bc)' // -}; +//static char * s_NP3[22] = { +// " 0\n", // 00 const 0 // 0 vars +// " 1\n", // 01 const 1 // 0 vars +// "1 1\n", // 02 a // 1 vars +// "11 1\n", // 03 ab // 2 vars +// "11 0\n", // 04 (ab)' // 2 vars +// "10 1\n01 1\n", // 05 a<+>b // 2 vars +// "111 1\n", // 06 0s abc // 3 vars +// "111 0\n", // 07 (abc)' // +// "11- 1\n1-1 1\n", // 08 1p a(b+c) // +// "11- 0\n1-1 0\n", // 09 (a(b+c))' // +// "111 1\n100 1\n010 1\n001 1\n", // 10 2s a<+>b<+>c // +// "10- 0\n1-0 0\n011 0\n", // 11 3p a<+>bc // +// "101 1\n110 1\n", // 12 4p a(b<+>c) // +// "101 0\n110 0\n", // 13 (a(b<+>c))' // +// "11- 1\n1-1 1\n-11 1\n", // 14 5s ab+bc+ac // +// "111 1\n000 1\n", // 15 6s abc+a'b'c' // +// "111 0\n000 0\n", // 16 (abc+a'b'c')' // +// "11- 1\n-11 1\n0-1 1\n", // 17 7 ab+bc+a'c // +// "011 1\n101 1\n110 1\n", // 18 8s a'bc+ab'c+abc' // +// "011 0\n101 0\n110 0\n", // 19 (a'bc+ab'c+abc')' // +// "100 1\n-11 1\n", // 20 9p ab'c'+bc // +// "100 0\n-11 0\n" // 21 (ab'c'+bc)' // +//}; // NP-classes of functions of 3 variables (22) static char * s_NP3Names[22] = { @@ -126,16 +126,16 @@ static char * s_NP3Names[22] = { }; // the number of variables in each function -static int s_NP3VarNums[22] = { 0, 0, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; +//static int s_NP3VarNums[22] = { 0, 0, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; // NPN classes of functions of exactly 3 inputs (10) static int s_NPNe3[10] = { 6, 8, 10, 11, 12, 14, 15, 17, 18, 20 }; // NPN classes of functions of exactly 3 inputs that are symmetric (5) -static int s_NPNe3s[10] = { 6, 10, 14, 15, 18 }; +//static int s_NPNe3s[10] = { 6, 10, 14, 15, 18 }; // NPN classes of functions of exactly 3 inputs (4) -static int s_NPNe3p[10] = { 8, 11, 12, 20 }; +//static int s_NPNe3p[10] = { 8, 11, 12, 20 }; static Cut_CMan_t * Cut_CManStart(); static void Cut_CManStop( Cut_CMan_t * p ); @@ -231,7 +231,7 @@ void Cut_CellPrecompute() { Cut_CMan_t * p; Cut_Cell_t * pCell, * pTemp; - int i1, i2, i3, i, j, k, c, clk = clock(), clk2 = clock(); + int i1, i2, i3, i, j, k, c, clk = clock(); //, clk2 = clock(); p = Cut_CManStart(); @@ -397,7 +397,7 @@ void Cut_CellPrecompute() } } - printf( "BASIC: Total = %d. Good = %d. Entry = %d. ", p->nTotal, p->nGood, sizeof(Cut_Cell_t) ); + printf( "BASIC: Total = %d. Good = %d. Entry = %d. ", (int)p->nTotal, (int)p->nGood, (int)sizeof(Cut_Cell_t) ); PRT( "Time", clock() - clk ); printf( "Cells: " ); for ( i = 0; i <= 9; i++ ) @@ -481,7 +481,7 @@ void Cut_CellPrecompute() //p->timeTable += clock() - clk2; } - printf( "VAR %d: Total = %d. Good = %d. Entry = %d. ", k, p->nTotal, p->nGood, sizeof(Cut_Cell_t) ); + printf( "VAR %d: Total = %d. Good = %d. Entry = %d. ", k, p->nTotal, p->nGood, (int)sizeof(Cut_Cell_t) ); PRT( "Time", clock() - clk ); printf( "Cells: " ); for ( i = 0; i <= 9; i++ ) @@ -517,7 +517,7 @@ int Cut_CellTableLookup( Cut_CMan_t * p, Cut_Cell_t * pCell ) Cut_Cell_t ** pSlot, * pTemp; unsigned Hash; Hash = Extra_TruthHash( pCell->uTruth, Extra_TruthWordNum( pCell->nVars ) ); - if ( !st_find_or_add( p->tTable, (char *)Hash, (char ***)&pSlot ) ) + if ( !st_find_or_add( p->tTable, (char *)(PORT_PTRUINT_T)Hash, (char ***)&pSlot ) ) *pSlot = NULL; for ( pTemp = *pSlot; pTemp; pTemp = pTemp->pNext ) { @@ -863,15 +863,15 @@ void Cut_CellDumpToFile() for ( i = 0; i < 4; i++ ) if ( pTemp->nUsed == 0 ) - BoxUsed[ pTemp->Box[i] ][0]++; + BoxUsed[ (int)pTemp->Box[i] ][0]++; else if ( pTemp->nUsed < 10 ) - BoxUsed[ pTemp->Box[i] ][1]++; + BoxUsed[ (int)pTemp->Box[i] ][1]++; else if ( pTemp->nUsed < 100 ) - BoxUsed[ pTemp->Box[i] ][2]++; + BoxUsed[ (int)pTemp->Box[i] ][2]++; else if ( pTemp->nUsed < 1000 ) - BoxUsed[ pTemp->Box[i] ][3]++; + BoxUsed[ (int)pTemp->Box[i] ][3]++; else - BoxUsed[ pTemp->Box[i] ][4]++; + BoxUsed[ (int)pTemp->Box[i] ][4]++; } } @@ -962,7 +962,7 @@ int Cut_CellTruthLookup( unsigned * pTruth, int nVars ) // check if the cell exists Hash = Extra_TruthHash( pCell->uTruth, Extra_TruthWordNum(pCell->nVars) ); - if ( st_lookup( p->tTable, (char *)Hash, (char **)&pTemp ) ) + if ( st_lookup( p->tTable, (char *)(PORT_PTRUINT_T)Hash, (char **)&pTemp ) ) { for ( ; pTemp; pTemp = pTemp->pNext ) { diff --git a/src/opt/cut/cutTruth.c b/src/opt/cut/cutTruth.c index c3514ad7..6ecf20e4 100644 --- a/src/opt/cut/cutTruth.c +++ b/src/opt/cut/cutTruth.c @@ -30,9 +30,10 @@ /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// -extern int nTotal = 0; -extern int nGood = 0; -extern int nEqual = 0; +// used in abcCut.c +int nTotal = 0; +int nGood = 0; +int nEqual = 0; //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// diff --git a/src/opt/dec/decAbc.c b/src/opt/dec/decAbc.c index 6adb0f98..2886668e 100644 --- a/src/opt/dec/decAbc.c +++ b/src/opt/dec/decAbc.c @@ -43,7 +43,7 @@ Abc_Obj_t * Dec_GraphToNetwork( Abc_Ntk_t * pNtk, Dec_Graph_t * pGraph ) { Abc_Obj_t * pAnd0, * pAnd1; - Dec_Node_t * pNode; + Dec_Node_t * pNode = NULL; // Suppress "might be used uninitialized" int i; // check for constant function if ( Dec_GraphIsConst(pGraph) ) @@ -77,7 +77,7 @@ Abc_Obj_t * Dec_GraphToNetwork( Abc_Ntk_t * pNtk, Dec_Graph_t * pGraph ) Abc_Obj_t * Dec_GraphToNetworkNoStrash( Abc_Ntk_t * pNtk, Dec_Graph_t * pGraph ) { Abc_Obj_t * pAnd, * pAnd0, * pAnd1; - Dec_Node_t * pNode; + Dec_Node_t * pNode = NULL; // Suppress "might be used uninitialized" int i; // check for constant function if ( Dec_GraphIsConst(pGraph) ) @@ -217,7 +217,7 @@ void Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, bool fUpda ***********************************************************************/ Hop_Obj_t * Dec_GraphToNetworkAig( Hop_Man_t * pMan, Dec_Graph_t * pGraph ) { - Dec_Node_t * pNode; + Dec_Node_t * pNode = NULL; // Suppress "might be used uninitialized" Hop_Obj_t * pAnd0, * pAnd1; int i; // check for constant function @@ -278,7 +278,7 @@ Hop_Obj_t * Dec_GraphFactorSop( Hop_Man_t * pMan, char * pSop ) ***********************************************************************/ Ivy_Obj_t * Dec_GraphToNetworkIvy( Ivy_Man_t * pMan, Dec_Graph_t * pGraph ) { - Dec_Node_t * pNode; + Dec_Node_t * pNode = NULL; // Suppress "might be used uninitialized" Ivy_Obj_t * pAnd0, * pAnd1; int i; // check for constant function diff --git a/src/opt/dec/decFactor.c b/src/opt/dec/decFactor.c index 768dcd9b..94205196 100644 --- a/src/opt/dec/decFactor.c +++ b/src/opt/dec/decFactor.c @@ -231,7 +231,6 @@ Dec_Edge_t Dec_FactorTrivial( Dec_Graph_t * pFForm, Mvc_Cover_t * pCover ) Dec_Man_t * pManDec = Abc_FrameReadManDec(); Vec_Int_t * vEdgeCubes = pManDec->vCubes; Vec_Int_t * vEdgeLits = pManDec->vLits; - Mvc_Manager_t * pMem = pManDec->pMvcMem; Dec_Edge_t eNode; Mvc_Cube_t * pCube; // create the factored form for each cube diff --git a/src/opt/dec/decMan.c b/src/opt/dec/decMan.c index 65857461..3d65ffc5 100644 --- a/src/opt/dec/decMan.c +++ b/src/opt/dec/decMan.c @@ -42,7 +42,7 @@ Dec_Man_t * Dec_ManStart() { Dec_Man_t * p; - int clk = clock(); +// int clk = clock(); p = ALLOC( Dec_Man_t, 1 ); p->pMvcMem = Mvc_ManagerStart(); p->vCubes = Vec_IntAlloc( 8 ); diff --git a/src/opt/dec/decUtil.c b/src/opt/dec/decUtil.c index 463bc7e2..aeabeac4 100644 --- a/src/opt/dec/decUtil.c +++ b/src/opt/dec/decUtil.c @@ -41,7 +41,7 @@ DdNode * Dec_GraphDeriveBdd( DdManager * dd, Dec_Graph_t * pGraph ) { DdNode * bFunc, * bFunc0, * bFunc1; - Dec_Node_t * pNode; + Dec_Node_t * pNode = NULL; // Suppress "might be used uninitialized" int i; // sanity checks @@ -91,7 +91,8 @@ DdNode * Dec_GraphDeriveBdd( DdManager * dd, Dec_Graph_t * pGraph ) unsigned Dec_GraphDeriveTruth( Dec_Graph_t * pGraph ) { unsigned uTruths[5] = { 0xAAAAAAAA, 0xCCCCCCCC, 0xF0F0F0F0, 0xFF00FF00, 0xFFFF0000 }; - unsigned uTruth, uTruth0, uTruth1; + unsigned uTruth = 0; // Suppress "might be used uninitialized" + unsigned uTruth0, uTruth1; Dec_Node_t * pNode; int i; @@ -109,17 +110,17 @@ unsigned Dec_GraphDeriveTruth( Dec_Graph_t * pGraph ) // assign the elementary variables Dec_GraphForEachLeaf( pGraph, pNode, i ) - pNode->pFunc = (void *)uTruths[i]; + pNode->pFunc = (void *)(PORT_PTRUINT_T)uTruths[i]; // compute the function for each internal node Dec_GraphForEachNode( pGraph, pNode, i ) { - uTruth0 = (unsigned)Dec_GraphNode(pGraph, pNode->eEdge0.Node)->pFunc; - uTruth1 = (unsigned)Dec_GraphNode(pGraph, pNode->eEdge1.Node)->pFunc; + uTruth0 = (unsigned)(PORT_PTRUINT_T)Dec_GraphNode(pGraph, pNode->eEdge0.Node)->pFunc; + uTruth1 = (unsigned)(PORT_PTRUINT_T)Dec_GraphNode(pGraph, pNode->eEdge1.Node)->pFunc; uTruth0 = pNode->eEdge0.fCompl? ~uTruth0 : uTruth0; uTruth1 = pNode->eEdge1.fCompl? ~uTruth1 : uTruth1; uTruth = uTruth0 & uTruth1; - pNode->pFunc = (void *)uTruth; + pNode->pFunc = (void *)(PORT_PTRUINT_T)uTruth; } // complement the result if necessary diff --git a/src/opt/fret/fretInit.c b/src/opt/fret/fretInit.c index bf249035..0c7b1e29 100644 --- a/src/opt/fret/fretInit.c +++ b/src/opt/fret/fretInit.c @@ -1205,9 +1205,9 @@ static void Abc_FlowRetime_ConnectBiasNode(Abc_Obj_t *pBiasNode, Abc_Obj_t *pObj ***********************************************************************/ void Abc_FlowRetime_AddInitBias( ) { Abc_Ntk_t *pNtk = pManMR->pNtk; - Abc_Obj_t *pBiasNode, *pObj, *pNext, *pNext2; + Abc_Obj_t *pBiasNode, *pObj; InitConstraint_t *pConstraint; - int i, j, k, l, id; + int i, j, id; const int nConstraints = Vec_PtrSize( pManMR->vInitConstraints ); pManMR->pDataArray = REALLOC( Flow_Data_t, pManMR->pDataArray, pManMR->nNodes + (nConstraints*(pManMR->iteration+1)) ); diff --git a/src/opt/fret/fretMain.c b/src/opt/fret/fretMain.c index df784e6a..77ea8468 100644 --- a/src/opt/fret/fretMain.c +++ b/src/opt/fret/fretMain.c @@ -478,7 +478,7 @@ int Abc_FlowRetime_PushFlows( Abc_Ntk_t * pNtk, bool fVerbose ) { int i, j, flow = 0, last, srcDist = 0; Abc_Obj_t *pObj, *pObj2; - int clk = clock(); +// int clk = clock(); pManMR->constraintMask |= BLOCK; diff --git a/src/opt/fxu/fxu.c b/src/opt/fxu/fxu.c index d11fd793..b49ef9aa 100644 --- a/src/opt/fxu/fxu.c +++ b/src/opt/fxu/fxu.c @@ -79,7 +79,7 @@ int Fxu_FastExtract( Fxu_Data_t * pData ) Weight1 = Fxu_HeapSingleReadMaxWeight( p->pHeapSingle ); if ( pData->fVerbose ) printf( "Div %5d : Best single = %5d.\r", Counter++, Weight1 ); - if ( Weight1 > 0 || Weight1 == 0 && pData->fUse0 ) + if ( Weight1 > 0 || (Weight1 == 0 && pData->fUse0) ) Fxu_UpdateSingle( p ); else break; @@ -94,7 +94,7 @@ int Fxu_FastExtract( Fxu_Data_t * pData ) Weight2 = Fxu_HeapDoubleReadMaxWeight( p->pHeapDouble ); if ( pData->fVerbose ) printf( "Div %5d : Best double = %5d.\r", Counter++, Weight2 ); - if ( Weight2 > 0 || Weight2 == 0 && pData->fUse0 ) + if ( Weight2 > 0 || (Weight2 == 0 && pData->fUse0) ) Fxu_UpdateDouble( p ); else break; @@ -115,14 +115,14 @@ int Fxu_FastExtract( Fxu_Data_t * pData ) if ( Weight1 >= Weight2 ) { - if ( Weight1 > 0 || Weight1 == 0 && pData->fUse0 ) + if ( Weight1 > 0 || (Weight1 == 0 && pData->fUse0) ) Fxu_UpdateSingle( p ); else break; } else { - if ( Weight2 > 0 || Weight2 == 0 && pData->fUse0 ) + if ( Weight2 > 0 || (Weight2 == 0 && pData->fUse0) ) Fxu_UpdateDouble( p ); else break; @@ -144,7 +144,7 @@ int Fxu_FastExtract( Fxu_Data_t * pData ) printf( "Div %5d : Best double = %5d. Best single = %5d. Best complement = %5d.\r", Counter++, Weight2, Weight1, Weight3 ); - if ( Weight3 > 0 || Weight3 == 0 && pData->fUse0 ) + if ( Weight3 > 0 || (Weight3 == 0 && pData->fUse0) ) Fxu_Update( p, pSingle, pDouble ); else break; diff --git a/src/opt/fxu/fxuCreate.c b/src/opt/fxu/fxuCreate.c index 55026b27..21dfd419 100644 --- a/src/opt/fxu/fxuCreate.c +++ b/src/opt/fxu/fxuCreate.c @@ -71,7 +71,7 @@ Fxu_Matrix * Fxu_CreateMatrix( Fxu_Data_t * pData ) nPairsStore = 0; nBitsMax = -1; for ( i = 0; i < pData->nNodesOld; i++ ) - if ( pSopCover = pData->vSops->pArray[i] ) + if ( (pSopCover = pData->vSops->pArray[i]) ) { nCubes = Abc_SopGetCubeNum( pSopCover ); nFanins = Abc_SopGetVarNum( pSopCover ); @@ -109,7 +109,7 @@ Fxu_Matrix * Fxu_CreateMatrix( Fxu_Data_t * pData ) iCube = 0; iPair = 0; for ( i = 0; i < pData->nNodesOld; i++ ) - if ( pSopCover = pData->vSops->pArray[i] ) + if ( (pSopCover = pData->vSops->pArray[i]) ) { // get the number of cubes nCubes = Abc_SopGetCubeNum( pSopCover ); @@ -136,7 +136,7 @@ Fxu_Matrix * Fxu_CreateMatrix( Fxu_Data_t * pData ) pOrder = ALLOC( int, nBitsMax ); // create the rows for ( i = 0; i < pData->nNodesOld; i++ ) - if ( pSopCover = pData->vSops->pArray[i] ) + if ( (pSopCover = pData->vSops->pArray[i]) ) { // get the new var in the matrix pVar = p->ppVars[2*i+1]; @@ -272,7 +272,7 @@ void Fxu_CreateCovers( Fxu_Matrix * p, Fxu_Data_t * pData ) // go through the internal nodes for ( n = 0; n < pData->nNodesOld; n++ ) - if ( pSopCover = pData->vSops->pArray[n] ) + if ( (pSopCover = pData->vSops->pArray[n]) ) { // get the number of this node iNode = n; diff --git a/src/opt/fxu/fxuInt.h b/src/opt/fxu/fxuInt.h index ea85cb79..4e3d72eb 100644 --- a/src/opt/fxu/fxuInt.h +++ b/src/opt/fxu/fxuInt.h @@ -365,7 +365,7 @@ struct FxuSingle // 7 words #define Fxu_CubeForEachPair( pCube, pPair, i )\ for ( i = 0;\ i < pCube->pVar->nCubes &&\ - (((unsigned)(pPair = pCube->pVar->ppPairs[pCube->iCube][i])) >= 0);\ + (((unsigned)(PORT_PTRUINT_T)(pPair = pCube->pVar->ppPairs[pCube->iCube][i])) >= 0);\ i++ )\ if ( pPair ) diff --git a/src/opt/fxu/fxuPair.c b/src/opt/fxu/fxuPair.c index 3c031ce8..87645cc7 100644 --- a/src/opt/fxu/fxuPair.c +++ b/src/opt/fxu/fxuPair.c @@ -24,7 +24,7 @@ #define MAX_PRIMES 304 -static s_Primes[MAX_PRIMES] = +static int s_Primes[MAX_PRIMES] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, diff --git a/src/opt/fxu/fxuReduce.c b/src/opt/fxu/fxuReduce.c index 0ab8a157..38032bfa 100644 --- a/src/opt/fxu/fxuReduce.c +++ b/src/opt/fxu/fxuReduce.c @@ -55,9 +55,9 @@ int Fxu_PreprocessCubePairs( Fxu_Matrix * p, Vec_Ptr_t * vCovers, int nPairsTota Fxu_Cube * pCube1, * pCube2; Fxu_Var * pVar; int nCubes, nBitsMax, nSum; - int CutOffNum, CutOffQuant; + int CutOffNum = -1, CutOffQuant = -1; // Suppress "might be used uninitialized" int iPair, iQuant, k, c; - int clk = clock(); +// int clk = clock(); char * pSopCover; int nFanins; @@ -69,7 +69,7 @@ int Fxu_PreprocessCubePairs( Fxu_Matrix * p, Vec_Ptr_t * vCovers, int nPairsTota iPair = 0; nBitsMax = -1; for ( c = 0; c < vCovers->nSize; c++ ) - if ( pSopCover = vCovers->pArray[c] ) + if ( (pSopCover = vCovers->pArray[c]) ) { nFanins = Abc_SopGetVarNum(pSopCover); // precompute the differences @@ -135,7 +135,7 @@ int Fxu_PreprocessCubePairs( Fxu_Matrix * p, Vec_Ptr_t * vCovers, int nPairsTota // collect the corresponding pairs and add the divisors iPair = 0; for ( c = 0; c < vCovers->nSize; c++ ) - if ( pSopCover = vCovers->pArray[c] ) + if ( (pSopCover = vCovers->pArray[c]) ) { // get the var pVar = p->ppVars[2*c+1]; diff --git a/src/opt/fxu/fxuSingle.c b/src/opt/fxu/fxuSingle.c index 73d9a76c..d2e3607c 100644 --- a/src/opt/fxu/fxuSingle.c +++ b/src/opt/fxu/fxuSingle.c @@ -63,7 +63,7 @@ void Fxu_MatrixComputeSingles( Fxu_Matrix * p, int fUse0, int nSingleMax ) memset( pWeigtCounts, 0, sizeof(int) * 1000 ); for ( i = 2; i < Vec_PtrSize(vSingles); i += 3 ) { - Weight = (int)Vec_PtrEntry(vSingles, i); + Weight = (int)(PORT_PTRUINT_T)Vec_PtrEntry(vSingles, i); if ( Weight >= 999 ) pWeigtCounts[999]++; else @@ -82,7 +82,7 @@ void Fxu_MatrixComputeSingles( Fxu_Matrix * p, int fUse0, int nSingleMax ) k = 0; for ( i = 2; i < Vec_PtrSize(vSingles); i += 3 ) { - Weight = (int)Vec_PtrEntry(vSingles, i); + Weight = (int)(PORT_PTRUINT_T)Vec_PtrEntry(vSingles, i); if ( Weight < c ) continue; Vec_PtrWriteEntry( vSingles, k++, Vec_PtrEntry(vSingles, i-2) ); @@ -102,7 +102,7 @@ void Fxu_MatrixComputeSingles( Fxu_Matrix * p, int fUse0, int nSingleMax ) Fxu_MatrixAddSingle( p, Vec_PtrEntry(vSingles,i), Vec_PtrEntry(vSingles,i+1), - (int)Vec_PtrEntry(vSingles,i+2) ); + (int)(PORT_PTRUINT_T)Vec_PtrEntry(vSingles,i+2) ); } Vec_PtrFree( vSingles ); } @@ -159,7 +159,7 @@ void Fxu_MatrixComputeSinglesOneCollect( Fxu_Matrix * p, Fxu_Var * pVar, Vec_Ptr { Vec_PtrPush( vSingles, pVar2 ); Vec_PtrPush( vSingles, pVar ); - Vec_PtrPush( vSingles, (void *)WeightCur ); + Vec_PtrPush( vSingles, (void *)(PORT_PTRUINT_T)WeightCur ); } } diff --git a/src/opt/lpk/lpkAbcDec.c b/src/opt/lpk/lpkAbcDec.c index aa2d4bc0..c06f0bf1 100644 --- a/src/opt/lpk/lpkAbcDec.c +++ b/src/opt/lpk/lpkAbcDec.c @@ -143,7 +143,6 @@ Abc_Obj_t * Lpk_Implement( Lpk_Man_t * pMan, Abc_Ntk_t * pNtk, Vec_Ptr_t * vLeav ***********************************************************************/ int Lpk_Decompose_rec( Lpk_Man_t * pMan, Lpk_Fun_t * p ) { - static Lpk_Res_t Res0, * pRes0 = &Res0; Lpk_Res_t * pResMux, * pResDsd; Lpk_Fun_t * p2; int clk; diff --git a/src/opt/lpk/lpkAbcDsd.c b/src/opt/lpk/lpkAbcDsd.c index f4095914..46d9179a 100644 --- a/src/opt/lpk/lpkAbcDsd.c +++ b/src/opt/lpk/lpkAbcDsd.c @@ -43,7 +43,11 @@ ***********************************************************************/ int Lpk_FunComputeMinSuppSizeVar( Lpk_Fun_t * p, unsigned ** ppTruths, int nTruths, unsigned ** ppCofs, unsigned uNonDecSupp ) { - int i, Var, VarBest, nSuppSize0, nSuppSize1, nSuppTotalMin, nSuppTotalCur, nSuppMaxMin, nSuppMaxCur; + int i, Var, VarBest, nSuppSize0, nSuppSize1; + int nSuppTotalMin = -1; // Suppress "might be used uninitialized" + int nSuppTotalCur; + int nSuppMaxMin = -1; // Suppress "might be used uninitialized" + int nSuppMaxCur; assert( nTruths > 0 ); VarBest = -1; Lpk_SuppForEachVar( p->uSupp, Var ) diff --git a/src/opt/lpk/lpkCore.c b/src/opt/lpk/lpkCore.c index 4eb64aa2..78356d81 100644 --- a/src/opt/lpk/lpkCore.c +++ b/src/opt/lpk/lpkCore.c @@ -100,7 +100,7 @@ int Lpk_NodeHasChanged( Lpk_Man_t * p, int iNode ) Vec_PtrForEachEntry( vNodes, pTemp, i ) { // check if the node has changed - pTemp = Abc_NtkObj( p->pNtk, (int)pTemp ); + pTemp = Abc_NtkObj( p->pNtk, (int)(PORT_PTRUINT_T)pTemp ); if ( pTemp == NULL ) return 1; // check if the number of fanouts has changed @@ -233,7 +233,7 @@ p->timeMap += clock() - clk; ***********************************************************************/ int Lpk_ResynthesizeNode( Lpk_Man_t * p ) { - static int Count = 0; +// static int Count = 0; Kit_DsdNtk_t * pDsdNtk; Lpk_Cut_t * pCut; unsigned * pTruth; @@ -361,7 +361,7 @@ void Lpk_ComputeSupports( Lpk_Man_t * p, Lpk_Cut_t * pCut, unsigned * pTruth ) ***********************************************************************/ int Lpk_ResynthesizeNodeNew( Lpk_Man_t * p ) { - static int Count = 0; +// static int Count = 0; Abc_Obj_t * pObjNew, * pLeaf; Lpk_Cut_t * pCut; unsigned * pTruth; @@ -497,7 +497,7 @@ p->timeEval += clock() - clk; ***********************************************************************/ int Lpk_Resynthesize( Abc_Ntk_t * pNtk, Lpk_Par_t * pPars ) { - ProgressBar * pProgress; + ProgressBar * pProgress = NULL; // Suppress "might be used uninitialized" Lpk_Man_t * p; Abc_Obj_t * pObj; double Delta; diff --git a/src/opt/lpk/lpkCut.c b/src/opt/lpk/lpkCut.c index facd330b..a2f46b09 100644 --- a/src/opt/lpk/lpkCut.c +++ b/src/opt/lpk/lpkCut.c @@ -46,7 +46,7 @@ CloudNode * Lpk_CutTruthBdd_rec( CloudManager * dd, Hop_Man_t * pMan, Hop_Obj_t assert( !Hop_IsComplement(pObj) ); if ( pObj->pData ) { - assert( ((unsigned)pObj->pData) & 0xffff0000 ); + assert( ((unsigned)(PORT_PTRUINT_T)pObj->pData) & 0xffff0000 ); return pObj->pData; } // get the plan for a new truth table @@ -84,8 +84,8 @@ CloudNode * Lpk_CutTruthBdd( Lpk_Man_t * p, Lpk_Cut_t * pCut ) Hop_Man_t * pManHop = p->pNtk->pManFunc; Hop_Obj_t * pObjHop; Abc_Obj_t * pObj, * pFanin; - CloudNode * pTruth; - int i, k, iCount = 0; + CloudNode * pTruth = NULL; // Suppress "might be used uninitialized" + int i, k; // return NULL; // Lpk_NodePrintCut( p, pCut ); @@ -103,7 +103,7 @@ CloudNode * Lpk_CutTruthBdd( Lpk_Man_t * p, Lpk_Cut_t * pCut ) // set the initial truth tables at the fanins Abc_ObjForEachFanin( pObj, pFanin, k ) { - assert( ((unsigned)pFanin->pCopy) & 0xffff0000 ); + assert( ((unsigned)(PORT_PTRUINT_T)pFanin->pCopy) & 0xffff0000 ); Hop_ManPi( pManHop, k )->pData = pFanin->pCopy; } // compute the truth table of internal nodes @@ -138,7 +138,7 @@ unsigned * Lpk_CutTruth_rec( Hop_Man_t * pMan, Hop_Obj_t * pObj, int nVars, Vec_ assert( !Hop_IsComplement(pObj) ); if ( pObj->pData ) { - assert( ((unsigned)pObj->pData) & 0xffff0000 ); + assert( ((unsigned)(PORT_PTRUINT_T)pObj->pData) & 0xffff0000 ); return pObj->pData; } // get the plan for a new truth table @@ -173,8 +173,9 @@ unsigned * Lpk_CutTruth( Lpk_Man_t * p, Lpk_Cut_t * pCut, int fInv ) { Hop_Man_t * pManHop = p->pNtk->pManFunc; Hop_Obj_t * pObjHop; - Abc_Obj_t * pObj, * pFanin; - unsigned * pTruth; + Abc_Obj_t * pObj = NULL; // Suppress "might be used uninitialized" + Abc_Obj_t * pFanin; + unsigned * pTruth = NULL; // Suppress "might be used uninitialized" int i, k, iCount = 0; // Lpk_NodePrintCut( p, pCut ); assert( pCut->nNodes > 0 ); @@ -193,7 +194,7 @@ unsigned * Lpk_CutTruth( Lpk_Man_t * p, Lpk_Cut_t * pCut, int fInv ) // set the initial truth tables at the fanins Abc_ObjForEachFanin( pObj, pFanin, k ) { - assert( ((unsigned)pFanin->pCopy) & 0xffff0000 ); + assert( ((unsigned)(PORT_PTRUINT_T)pFanin->pCopy) & 0xffff0000 ); Hop_ManPi( pManHop, k )->pData = pFanin->pCopy; } // compute the truth table of internal nodes @@ -208,7 +209,7 @@ unsigned * Lpk_CutTruth( Lpk_Man_t * p, Lpk_Cut_t * pCut, int fInv ) if ( fInv == 0 ) { pTruth = Vec_PtrEntry( p->vTtNodes, iCount++ ); - Kit_TruthCopy( pTruth, (unsigned *)pObj->pCopy, pCut->nLeaves ); + Kit_TruthCopy( pTruth, (unsigned *)(PORT_PTRUINT_T)pObj->pCopy, pCut->nLeaves ); } assert( iCount <= Vec_PtrSize(p->vTtNodes) ); return pTruth; @@ -243,14 +244,14 @@ void Lpk_NodeRecordImpact( Lpk_Man_t * p ) if ( pNode->fMarkC ) continue; pNode->fMarkC = 1; - Vec_PtrPush( vNodes, (void *)pNode->Id ); - Vec_PtrPush( vNodes, (void *)Abc_ObjFanoutNum(pNode) ); + Vec_PtrPush( vNodes, (void *)(PORT_PTRUINT_T)pNode->Id ); + Vec_PtrPush( vNodes, (void *)(PORT_PTRUINT_T)Abc_ObjFanoutNum(pNode) ); } } // clear the marks Vec_PtrForEachEntry( vNodes, pNode, i ) { - pNode = Abc_NtkObj( p->pNtk, (int)pNode ); + pNode = Abc_NtkObj( p->pNtk, (int)(PORT_PTRUINT_T)pNode ); pNode->fMarkC = 0; i++; } @@ -280,7 +281,7 @@ int Lpk_NodeCutsCheckDsd( Lpk_Man_t * p, Lpk_Cut_t * pCut ) { assert( pObj->fMarkA == 0 ); pObj->fMarkA = 1; - pObj->pCopy = (void *)i; + pObj->pCopy = (void *)(PORT_PTRUINT_T)i; } // ref leaves pointed from the internal nodes nCands = 0; @@ -289,7 +290,7 @@ int Lpk_NodeCutsCheckDsd( Lpk_Man_t * p, Lpk_Cut_t * pCut ) fLeavesOnly = 1; Abc_ObjForEachFanin( pObj, pFanin, k ) if ( pFanin->fMarkA ) - p->pRefs[(int)pFanin->pCopy]++; + p->pRefs[(int)(PORT_PTRUINT_T)pFanin->pCopy]++; else fLeavesOnly = 0; if ( fLeavesOnly ) @@ -303,7 +304,7 @@ int Lpk_NodeCutsCheckDsd( Lpk_Man_t * p, Lpk_Cut_t * pCut ) Abc_ObjForEachFanin( pObj, pFanin, k ) { assert( pFanin->fMarkA == 1 ); - if ( p->pRefs[(int)pFanin->pCopy] > 1 ) + if ( p->pRefs[(int)(PORT_PTRUINT_T)pFanin->pCopy] > 1 ) break; } if ( k == Abc_ObjFaninNum(pObj) ) diff --git a/src/opt/lpk/lpkMap.c b/src/opt/lpk/lpkMap.c index 698aeea1..f959f8f9 100644 --- a/src/opt/lpk/lpkMap.c +++ b/src/opt/lpk/lpkMap.c @@ -41,7 +41,7 @@ ***********************************************************************/ If_Obj_t * Lpk_MapPrimeInternal( If_Man_t * pIfMan, Kit_Graph_t * pGraph ) { - Kit_Node_t * pNode; + Kit_Node_t * pNode = NULL; // Suppress "might be used uninitialized" If_Obj_t * pAnd0, * pAnd1; int i; // check for constant function diff --git a/src/opt/lpk/lpkMulti.c b/src/opt/lpk/lpkMulti.c index 82cf3578..3d2093e7 100644 --- a/src/opt/lpk/lpkMulti.c +++ b/src/opt/lpk/lpkMulti.c @@ -343,14 +343,31 @@ If_Obj_t * Lpk_MapTreeMulti_rec( Lpk_Man_t * p, Kit_DsdNtk_t ** ppNtks, int * pi ***********************************************************************/ If_Obj_t * Lpk_MapTreeMulti( Lpk_Man_t * p, unsigned * pTruth, int nVars, If_Obj_t ** ppLeaves ) { - static Counter = 0; + static int Counter = 0; If_Obj_t * pResult; Kit_DsdNtk_t * ppNtks[8] = {0}, * pTemp; Kit_DsdObj_t * pRoot; int piCofVar[4], pPrios[16], pFreqs[16] = {0}, piLits[16]; int i, k, nCBars, nSize, nMemSize; unsigned * ppCofs[4][8], uSupport; - char pTable[16][16] = {0}; + char pTable[16][16] = { + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + }; int fVerbose = p->pPars->fVeryVerbose; Counter++; @@ -422,10 +439,6 @@ If_Obj_t * Lpk_MapTreeMulti( Lpk_Man_t * p, unsigned * pTruth, int nVars, If_Obj if ( fVerbose ) printf( "After restructuring with priority:\n" ); - if ( Counter == 1 ) - { - int x = 0; - } // transform all networks according to the variable order for ( i = 0; i < nSize; i++ ) { diff --git a/src/opt/mfs/mfsCore.c b/src/opt/mfs/mfsCore.c index a941f153..0b2ba47d 100644 --- a/src/opt/mfs/mfsCore.c +++ b/src/opt/mfs/mfsCore.c @@ -267,7 +267,7 @@ int Abc_NtkMfs( Abc_Ntk_t * pNtk, Mfs_Par_t * pPars ) if ( p->pCare ) { Abc_NtkForEachCi( pNtk, pObj, i ) - pObj->pData = (void *)i; + pObj->pData = (void *)(PORT_PTRUINT_T)i; } // compute levels diff --git a/src/opt/mfs/mfsStrash.c b/src/opt/mfs/mfsStrash.c index 88f7554c..1153e4fd 100644 --- a/src/opt/mfs/mfsStrash.c +++ b/src/opt/mfs/mfsStrash.c @@ -193,14 +193,14 @@ Aig_Man_t * Abc_NtkConstructAig( Mfs_Man_t * p, Abc_Obj_t * pNode ) Aig_ManIncrementTravId( p->pCare ); Vec_PtrForEachEntry( p->vSupp, pFanin, i ) { - pPi = Aig_ManPi( p->pCare, (int)pFanin->pData ); + pPi = Aig_ManPi( p->pCare, (int)(PORT_PTRUINT_T)pFanin->pData ); Aig_ObjSetTravIdCurrent( p->pCare, pPi ); pPi->pData = pFanin->pCopy; } // construct the constraints Vec_PtrForEachEntry( p->vSupp, pFanin, i ) { - vOuts = Vec_PtrEntry( p->vSuppsInv, (int)pFanin->pData ); + vOuts = Vec_PtrEntry( p->vSuppsInv, (int)(PORT_PTRUINT_T)pFanin->pData ); Vec_IntForEachEntry( vOuts, iOut, k ) { pPo = Aig_ManPo( p->pCare, iOut ); @@ -280,7 +280,7 @@ Aig_Man_t * Abc_NtkAigForConstraints( Mfs_Man_t * p, Abc_Obj_t * pNode ) Aig_ManIncrementTravId( p->pCare ); Vec_PtrForEachEntry( p->vSupp, pFanin, i ) { - pPi = Aig_ManPi( p->pCare, (int)pFanin->pData ); + pPi = Aig_ManPi( p->pCare, (int)(PORT_PTRUINT_T)pFanin->pData ); Aig_ObjSetTravIdCurrent( p->pCare, pPi ); pPi->pData = Aig_ObjCreatePi(pMan); } @@ -288,7 +288,7 @@ Aig_Man_t * Abc_NtkAigForConstraints( Mfs_Man_t * p, Abc_Obj_t * pNode ) pObjRoot = Aig_ManConst1(pMan); Vec_PtrForEachEntry( p->vSupp, pFanin, i ) { - vOuts = Vec_PtrEntry( p->vSuppsInv, (int)pFanin->pData ); + vOuts = Vec_PtrEntry( p->vSuppsInv, (int)(PORT_PTRUINT_T)pFanin->pData ); Vec_IntForEachEntry( vOuts, iOut, k ) { pPo = Aig_ManPo( p->pCare, iOut ); diff --git a/src/opt/res/resSat.c b/src/opt/res/resSat.c index dd0e7a23..798e7abc 100644 --- a/src/opt/res/resSat.c +++ b/src/opt/res/resSat.c @@ -63,44 +63,44 @@ void * Res_SatProveUnsat( Abc_Ntk_t * pAig, Vec_Ptr_t * vFanins ) // assign unique numbers to each node nNodes = 0; - Abc_AigConst1(pAig)->pCopy = (void *)nNodes++; + Abc_AigConst1(pAig)->pCopy = (void *)(PORT_PTRUINT_T)nNodes++; Abc_NtkForEachPi( pAig, pObj, i ) - pObj->pCopy = (void *)nNodes++; + pObj->pCopy = (void *)(PORT_PTRUINT_T)nNodes++; Vec_PtrForEachEntry( vNodes, pObj, i ) - pObj->pCopy = (void *)nNodes++; + pObj->pCopy = (void *)(PORT_PTRUINT_T)nNodes++; Vec_PtrForEachEntry( vFanins, pObj, i ) // useful POs - pObj->pCopy = (void *)nNodes++; + pObj->pCopy = (void *)(PORT_PTRUINT_T)nNodes++; // start the solver pSat = sat_solver_new(); sat_solver_store_alloc( pSat ); // add clause for the constant node - Res_SatAddConst1( pSat, (int)Abc_AigConst1(pAig)->pCopy, 0 ); + Res_SatAddConst1( pSat, (int)(PORT_PTRUINT_T)Abc_AigConst1(pAig)->pCopy, 0 ); // add clauses for AND gates Vec_PtrForEachEntry( vNodes, pObj, i ) - Res_SatAddAnd( pSat, (int)pObj->pCopy, - (int)Abc_ObjFanin0(pObj)->pCopy, (int)Abc_ObjFanin1(pObj)->pCopy, Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) ); + Res_SatAddAnd( pSat, (int)(PORT_PTRUINT_T)pObj->pCopy, + (int)(PORT_PTRUINT_T)Abc_ObjFanin0(pObj)->pCopy, (int)(PORT_PTRUINT_T)Abc_ObjFanin1(pObj)->pCopy, Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) ); Vec_PtrFree( vNodes ); // add clauses for POs Vec_PtrForEachEntry( vFanins, pObj, i ) - Res_SatAddEqual( pSat, (int)pObj->pCopy, - (int)Abc_ObjFanin0(pObj)->pCopy, Abc_ObjFaninC0(pObj) ); + Res_SatAddEqual( pSat, (int)(PORT_PTRUINT_T)pObj->pCopy, + (int)(PORT_PTRUINT_T)Abc_ObjFanin0(pObj)->pCopy, Abc_ObjFaninC0(pObj) ); // add trivial clauses pObj = Vec_PtrEntry(vFanins, 0); - Res_SatAddConst1( pSat, (int)pObj->pCopy, 0 ); // care-set + Res_SatAddConst1( pSat, (int)(PORT_PTRUINT_T)pObj->pCopy, 0 ); // care-set pObj = Vec_PtrEntry(vFanins, 1); - Res_SatAddConst1( pSat, (int)pObj->pCopy, 0 ); // on-set + Res_SatAddConst1( pSat, (int)(PORT_PTRUINT_T)pObj->pCopy, 0 ); // on-set // bookmark the clauses of A sat_solver_store_mark_clauses_a( pSat ); // duplicate the clauses pObj = Vec_PtrEntry(vFanins, 1); - Sat_SolverDoubleClauses( pSat, (int)pObj->pCopy ); + Sat_SolverDoubleClauses( pSat, (int)(PORT_PTRUINT_T)pObj->pCopy ); // add the equality constraints Vec_PtrForEachEntryStart( vFanins, pObj, i, 2 ) - Res_SatAddEqual( pSat, (int)pObj->pCopy, ((int)pObj->pCopy) + nNodes, 0 ); + Res_SatAddEqual( pSat, (int)(PORT_PTRUINT_T)pObj->pCopy, ((int)(PORT_PTRUINT_T)pObj->pCopy) + nNodes, 0 ); // bookmark the roots sat_solver_store_mark_roots( pSat ); @@ -155,39 +155,39 @@ void * Res_SatSimulateConstr( Abc_Ntk_t * pAig, int fOnSet ) // assign unique numbers to each node nNodes = 0; - Abc_AigConst1(pAig)->pCopy = (void *)nNodes++; + Abc_AigConst1(pAig)->pCopy = (void *)(PORT_PTRUINT_T)nNodes++; Abc_NtkForEachPi( pAig, pObj, i ) - pObj->pCopy = (void *)nNodes++; + pObj->pCopy = (void *)(PORT_PTRUINT_T)nNodes++; Vec_PtrForEachEntry( vNodes, pObj, i ) - pObj->pCopy = (void *)nNodes++; + pObj->pCopy = (void *)(PORT_PTRUINT_T)nNodes++; Vec_PtrForEachEntry( vFanins, pObj, i ) // useful POs - pObj->pCopy = (void *)nNodes++; + pObj->pCopy = (void *)(PORT_PTRUINT_T)nNodes++; // start the solver pSat = sat_solver_new(); // add clause for the constant node - Res_SatAddConst1( pSat, (int)Abc_AigConst1(pAig)->pCopy, 0 ); + Res_SatAddConst1( pSat, (int)(PORT_PTRUINT_T)Abc_AigConst1(pAig)->pCopy, 0 ); // add clauses for AND gates Vec_PtrForEachEntry( vNodes, pObj, i ) - Res_SatAddAnd( pSat, (int)pObj->pCopy, - (int)Abc_ObjFanin0(pObj)->pCopy, (int)Abc_ObjFanin1(pObj)->pCopy, Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) ); + Res_SatAddAnd( pSat, (int)(PORT_PTRUINT_T)pObj->pCopy, + (int)(PORT_PTRUINT_T)Abc_ObjFanin0(pObj)->pCopy, (int)(PORT_PTRUINT_T)Abc_ObjFanin1(pObj)->pCopy, Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) ); Vec_PtrFree( vNodes ); // add clauses for the first PO pObj = Abc_NtkPo( pAig, 0 ); - Res_SatAddEqual( pSat, (int)pObj->pCopy, - (int)Abc_ObjFanin0(pObj)->pCopy, Abc_ObjFaninC0(pObj) ); + Res_SatAddEqual( pSat, (int)(PORT_PTRUINT_T)pObj->pCopy, + (int)(PORT_PTRUINT_T)Abc_ObjFanin0(pObj)->pCopy, Abc_ObjFaninC0(pObj) ); // add clauses for the second PO pObj = Abc_NtkPo( pAig, 1 ); - Res_SatAddEqual( pSat, (int)pObj->pCopy, - (int)Abc_ObjFanin0(pObj)->pCopy, Abc_ObjFaninC0(pObj) ); + Res_SatAddEqual( pSat, (int)(PORT_PTRUINT_T)pObj->pCopy, + (int)(PORT_PTRUINT_T)Abc_ObjFanin0(pObj)->pCopy, Abc_ObjFaninC0(pObj) ); // add trivial clauses pObj = Abc_NtkPo( pAig, 0 ); - Res_SatAddConst1( pSat, (int)pObj->pCopy, 0 ); // care-set + Res_SatAddConst1( pSat, (int)(PORT_PTRUINT_T)pObj->pCopy, 0 ); // care-set pObj = Abc_NtkPo( pAig, 1 ); - Res_SatAddConst1( pSat, (int)pObj->pCopy, !fOnSet ); // on-set + Res_SatAddConst1( pSat, (int)(PORT_PTRUINT_T)pObj->pCopy, !fOnSet ); // on-set Vec_PtrFree( vFanins ); return pSat; @@ -211,13 +211,14 @@ int Res_SatSimulate( Res_Sim_t * p, int nPatsLimit, int fOnSet ) Vec_Int_t * vLits; Vec_Ptr_t * vPats; sat_solver * pSat; - int RetValue, i, k, value, status, Lit, Var, iPat; + int RetValue = -1; // Suppress "might be used uninitialized" + int i, k, value, status, Lit, Var, iPat; int clk = clock(); //printf( "Looking for %s: ", fOnSet? "onset " : "offset" ); // decide what problem should be solved - Lit = toLitCond( (int)Abc_NtkPo(p->pAig,1)->pCopy, !fOnSet ); + Lit = toLitCond( (int)(PORT_PTRUINT_T)Abc_NtkPo(p->pAig,1)->pCopy, !fOnSet ); if ( fOnSet ) { iPat = p->nPats1; @@ -274,7 +275,7 @@ int Res_SatSimulate( Res_Sim_t * p, int nPatsLimit, int fOnSet ) Vec_IntClear( vLits ); for ( i = 0; i < p->nTruePis; i++ ) { - Var = (int)Abc_NtkPi(p->pAig,i)->pCopy; + Var = (int)(PORT_PTRUINT_T)Abc_NtkPi(p->pAig,i)->pCopy; value = (int)(pSat->model.ptr[Var] == l_True); if ( value ) Abc_InfoSetBit( Vec_PtrEntry(vPats, i), k ); diff --git a/src/opt/ret/retArea.c b/src/opt/ret/retArea.c index 5eec8e80..318147f5 100644 --- a/src/opt/ret/retArea.c +++ b/src/opt/ret/retArea.c @@ -75,7 +75,7 @@ int Abc_NtkRetimeMinArea( Abc_Ntk_t * pNtk, int fForwardOnly, int fBackwardOnly, if ( fOneFrame ) pNtkTotal = Abc_NtkRetimeMinAreaOne( pNtk, 0, fVerbose ); else - while ( pNtkBottom = Abc_NtkRetimeMinAreaOne( pNtk, 0, fVerbose ) ) + while ( (pNtkBottom = Abc_NtkRetimeMinAreaOne( pNtk, 0, fVerbose )) ) pNtkTotal = Abc_NtkAttachBottom( pNtkTotal, pNtkBottom ); } // compute initial values @@ -109,7 +109,6 @@ Abc_Ntk_t * Abc_NtkRetimeMinAreaOne( Abc_Ntk_t * pNtk, int fForward, int fVerbos { Abc_Ntk_t * pNtkNew = NULL; Vec_Ptr_t * vMinCut; - int nLatches = Abc_NtkLatchNum(pNtk); // mark current latches and TFI(POs) Abc_NtkRetimeMinAreaPrepare( pNtk, fForward ); // run the maximum forward flow @@ -265,22 +264,22 @@ int Abc_NtkRetimeMinAreaInitValues_rec( Abc_Obj_t * pObj ) int i; // skip visited nodes if ( Abc_NodeIsTravIdCurrent(pObj) ) - return (int)pObj->pCopy; + return (int)(PORT_PTRUINT_T)pObj->pCopy; Abc_NodeSetTravIdCurrent(pObj); // consider the case of a latch output if ( Abc_ObjIsBo(pObj) ) { assert( Abc_ObjIsLatch(Abc_ObjFanin0(pObj)) ); - pObj->pCopy = (void *)Abc_NtkRetimeMinAreaInitValues_rec( Abc_ObjFanin0(pObj) ); - return (int)pObj->pCopy; + pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_NtkRetimeMinAreaInitValues_rec( Abc_ObjFanin0(pObj) ); + return (int)(PORT_PTRUINT_T)pObj->pCopy; } assert( Abc_ObjIsNode(pObj) ); // visit the fanins Abc_ObjForEachFanin( pObj, pFanin, i ) Abc_NtkRetimeMinAreaInitValues_rec( pFanin ); // compute the value of the node - pObj->pCopy = (void *)Abc_ObjSopSimulate(pObj); - return (int)pObj->pCopy; + pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_ObjSopSimulate(pObj); + return (int)(PORT_PTRUINT_T)pObj->pCopy; } /**Function************************************************************* @@ -302,7 +301,7 @@ void Abc_NtkRetimeMinAreaInitValues( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMinCut ) Abc_NtkIncrementTravId(pNtk); Abc_NtkForEachLatch( pNtk, pObj, i ) { - pObj->pCopy = (void *)Abc_LatchIsInit1(pObj); + pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_LatchIsInit1(pObj); Abc_NodeSetTravIdCurrent( pObj ); } // propagate initial values @@ -479,7 +478,7 @@ void Abc_NtkRetimeMinAreaUpdateLatches( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMinCut, i Abc_ObjAddFanin( pLatch, pLatchIn ); if ( fForward ) { - pLatch->pData = (void *)(pObj->pCopy? ABC_INIT_ONE : ABC_INIT_ZERO); + pLatch->pData = (void *)(PORT_PTRUINT_T)(pObj->pCopy? ABC_INIT_ONE : ABC_INIT_ZERO); // redirect edges to the unvisited fanouts of the node Abc_NodeCollectFanouts( pObj, vNodes ); Vec_PtrForEachEntry( vNodes, pNext, k ) diff --git a/src/opt/ret/retDelay.c b/src/opt/ret/retDelay.c index bcfe3a2e..0f3c3daa 100644 --- a/src/opt/ret/retDelay.c +++ b/src/opt/ret/retDelay.c @@ -74,9 +74,11 @@ int Abc_NtkRetimeMinDelayTry( Abc_Ntk_t * pNtk, int fForward, int fInitial, int { Abc_Ntk_t * pNtkNew = NULL; Vec_Ptr_t * vCritical; - Vec_Int_t * vValues; + Vec_Int_t * vValues = NULL; // Suppress "might be used uninitialized" Abc_Obj_t * pObj; - int i, k, IterBest, DelayCur, DelayBest, DelayStart, LatchesBest; + int i, k, IterBest, DelayCur, DelayBest; + int DelayStart = -1; // Suppress "might be used uninitialized" + int LatchesBest; // transfer intitial values if ( fInitial ) { diff --git a/src/opt/ret/retFlow.c b/src/opt/ret/retFlow.c index 47ee8516..bad4b7e7 100644 --- a/src/opt/ret/retFlow.c +++ b/src/opt/ret/retFlow.c @@ -709,7 +709,8 @@ int Abc_NtkMaxFlowVerifyCut( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMinCut, int fForward ***********************************************************************/ void Abc_NtkMaxFlowPrintFlow( Abc_Ntk_t * pNtk, int fForward ) { - Abc_Obj_t * pLatch, * pNext, * pPrev; + Abc_Obj_t * pLatch, * pNext; + Abc_Obj_t * pPrev = NULL; // Suppress "might be used uninitialized" int i; if ( fForward ) { diff --git a/src/opt/ret/retIncrem.c b/src/opt/ret/retIncrem.c index ba8104be..140e5dcc 100644 --- a/src/opt/ret/retIncrem.c +++ b/src/opt/ret/retIncrem.c @@ -48,7 +48,8 @@ int Abc_NtkRetimeIncremental( Abc_Ntk_t * pNtk, int fForward, int fMinDelay, int st_table * tLatches; int nLatches = Abc_NtkLatchNum(pNtk); int nIdMaxStart = Abc_NtkObjNumMax(pNtk); - int RetValue, nIterLimit; + int RetValue; + int nIterLimit = -1; // Suppress "might be used uninitialized" if ( Abc_NtkNodeNum(pNtk) == 0 ) return 0; // reorder CI/CO/latch inputs @@ -112,7 +113,7 @@ st_table * Abc_NtkRetimePrepareLatches( Abc_Ntk_t * pNtk ) Abc_NtkForEachLatch( pNtk, pLatch, i ) { // map latch into its true number - st_insert( tLatches, (void *)pLatch, (void *)(i-nOffSet) ); + st_insert( tLatches, (void *)(PORT_PTRUINT_T)pLatch, (void *)(PORT_PTRUINT_T)(i-nOffSet) ); // disconnect LI pLatchIn = Abc_ObjFanin0(pLatch); pFanin = Abc_ObjFanin0(pLatchIn); @@ -220,8 +221,8 @@ int Abc_NtkRetimeFinalizeLatches( Abc_Ntk_t * pNtk, st_table * tLatches, int nId ***********************************************************************/ int Abc_NtkRetimeOneWay( Abc_Ntk_t * pNtk, int fForward, int fVerbose ) { - Abc_Ntk_t * pNtkNew; - Vec_Int_t * vValues; + Abc_Ntk_t * pNtkNew = NULL; // Suppress "might be used uninitialized" + Vec_Int_t * vValues = NULL; // Suppress "might be used uninitialized" Abc_Obj_t * pObj; int i, fChanges, nTotalMoves = 0, nTotalMovesLimit = 10000; if ( fForward ) @@ -319,7 +320,7 @@ void Abc_NtkRetimeNode( Abc_Obj_t * pObj, int fForward, int fInitial ) { // compute the initial value if ( fInitial ) - pObj->pCopy = (void *)Abc_ObjSopSimulate( pObj ); + pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_ObjSopSimulate( pObj ); // collect fanins Abc_NodeCollectFanins( pObj, vNodes ); // make the node point to the fanins fanins @@ -399,10 +400,10 @@ int Abc_NtkRetimeCheckCompatibleLatchFanouts( Abc_Obj_t * pObj ) continue; if ( Init == -1 ) { - Init = (int)pObj->pData; + Init = (int)(PORT_PTRUINT_T)pObj->pData; nLatches++; } - else if ( Init == (int)pObj->pData ) + else if ( Init == (int)(PORT_PTRUINT_T)pObj->pData ) nLatches++; } return nLatches; diff --git a/src/opt/ret/retInit.c b/src/opt/ret/retInit.c index dcb71c60..8de0ef47 100644 --- a/src/opt/ret/retInit.c +++ b/src/opt/ret/retInit.c @@ -100,9 +100,9 @@ int Abc_ObjSopSimulate( Abc_Obj_t * pObj ) Abc_CubeForEachVar( pCube, Value, v ) { if ( Value == '0' ) - ResVar = 1 ^ ((int)Abc_ObjFanin(pObj, v)->pCopy); + ResVar = 1 ^ ((int)(PORT_PTRUINT_T)Abc_ObjFanin(pObj, v)->pCopy); else if ( Value == '1' ) - ResVar = (int)Abc_ObjFanin(pObj, v)->pCopy; + ResVar = (int)(PORT_PTRUINT_T)Abc_ObjFanin(pObj, v)->pCopy; else continue; ResAnd &= ResVar; @@ -134,17 +134,17 @@ int Abc_NtkRetimeVerifyModel( Abc_Ntk_t * pNtkCone, Vec_Int_t * vValues, int * p assert( Abc_NtkIsSopLogic(pNtkCone) ); // set the PIs Abc_NtkForEachPi( pNtkCone, pObj, i ) - pObj->pCopy = (void *)pModel[i]; + pObj->pCopy = (void *)(PORT_PTRUINT_T)pModel[i]; // simulate the internal nodes vNodes = Abc_NtkDfs( pNtkCone, 0 ); Vec_PtrForEachEntry( vNodes, pObj, i ) - pObj->pCopy = (void *)Abc_ObjSopSimulate( pObj ); + pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_ObjSopSimulate( pObj ); Vec_PtrFree( vNodes ); // compare the outputs Abc_NtkForEachPo( pNtkCone, pObj, i ) pObj->pCopy = Abc_ObjFanin0(pObj)->pCopy; Abc_NtkForEachPo( pNtkCone, pObj, i ) - Counter += (Vec_IntEntry(vValues, i) != (int)pObj->pCopy); + Counter += (Vec_IntEntry(vValues, i) != (int)(PORT_PTRUINT_T)pObj->pCopy); if ( Counter > 0 ) printf( "%d outputs (out of %d) have a value mismatch.\n", Counter, Abc_NtkPoNum(pNtkCone) ); return 1; @@ -167,7 +167,7 @@ void Abc_NtkRetimeTranferToCopy( Abc_Ntk_t * pNtk ) int i; Abc_NtkForEachObj( pNtk, pObj, i ) if ( Abc_ObjIsLatch(pObj) ) - pObj->pCopy = (void *)Abc_LatchIsInit1(pObj); + pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_LatchIsInit1(pObj); } /**Function************************************************************* @@ -187,7 +187,7 @@ void Abc_NtkRetimeTranferFromCopy( Abc_Ntk_t * pNtk ) int i; Abc_NtkForEachObj( pNtk, pObj, i ) if ( Abc_ObjIsLatch(pObj) ) - pObj->pData = (void *)(pObj->pCopy? ABC_INIT_ONE : ABC_INIT_ZERO); + pObj->pData = (void *)(PORT_PTRUINT_T)(pObj->pCopy? ABC_INIT_ONE : ABC_INIT_ZERO); } /**Function************************************************************* @@ -230,10 +230,10 @@ void Abc_NtkRetimeInsertLatchValues( Abc_Ntk_t * pNtk, Vec_Int_t * vValues ) int i, Counter = 0; Abc_NtkForEachObj( pNtk, pObj, i ) if ( Abc_ObjIsLatch(pObj) ) - pObj->pCopy = (void *)Counter++; + pObj->pCopy = (void *)(PORT_PTRUINT_T)Counter++; Abc_NtkForEachObj( pNtk, pObj, i ) if ( Abc_ObjIsLatch(pObj) ) - pObj->pData = (void *)(vValues? (Vec_IntEntry(vValues,(int)pObj->pCopy)? ABC_INIT_ONE : ABC_INIT_ZERO) : ABC_INIT_DC); + pObj->pData = (void *)(PORT_PTRUINT_T)(vValues? (Vec_IntEntry(vValues,(int)(PORT_PTRUINT_T)pObj->pCopy)? ABC_INIT_ONE : ABC_INIT_ZERO) : ABC_INIT_DC); } /**Function************************************************************* @@ -316,22 +316,22 @@ void Abc_NtkCycleInitStateSop( Abc_Ntk_t * pNtk, int nFrames, int fVerbose ) srand( 0x12341234 ); // initialize the values Abc_NtkForEachPi( pNtk, pObj, i ) - pObj->pCopy = (void *)(rand() & 1); + pObj->pCopy = (void *)(PORT_PTRUINT_T)(rand() & 1); Abc_NtkForEachLatch( pNtk, pObj, i ) - pObj->pCopy = (void *)Abc_LatchIsInit1(pObj); + pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_LatchIsInit1(pObj); // simulate for the given number of timeframes vNodes = Abc_NtkDfs( pNtk, 0 ); for ( f = 0; f < nFrames; f++ ) { // simulate internal nodes Vec_PtrForEachEntry( vNodes, pObj, i ) - pObj->pCopy = (void *)Abc_ObjSopSimulate( pObj ); + pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_ObjSopSimulate( pObj ); // bring the results to the COs Abc_NtkForEachCo( pNtk, pObj, i ) pObj->pCopy = Abc_ObjFanin0(pObj)->pCopy; // assign PI values Abc_NtkForEachPi( pNtk, pObj, i ) - pObj->pCopy = (void *)(rand() & 1); + pObj->pCopy = (void *)(PORT_PTRUINT_T)(rand() & 1); // transfer the latch values Abc_NtkForEachLatch( pNtk, pObj, i ) Abc_ObjFanout0(pObj)->pCopy = Abc_ObjFanin0(pObj)->pCopy; @@ -339,7 +339,7 @@ void Abc_NtkCycleInitStateSop( Abc_Ntk_t * pNtk, int nFrames, int fVerbose ) Vec_PtrFree( vNodes ); // set the final values Abc_NtkForEachLatch( pNtk, pObj, i ) - pObj->pData = (void *)(Abc_ObjFanout0(pObj)->pCopy ? ABC_INIT_ONE : ABC_INIT_ZERO); + pObj->pData = (void *)(PORT_PTRUINT_T)(Abc_ObjFanout0(pObj)->pCopy ? ABC_INIT_ONE : ABC_INIT_ZERO); } //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/ret/retLvalue.c b/src/opt/ret/retLvalue.c index b4d9e946..26f51f09 100644 --- a/src/opt/ret/retLvalue.c +++ b/src/opt/ret/retLvalue.c @@ -37,8 +37,8 @@ static Vec_Ptr_t * Abc_ManCollectLatches( Abc_Ntk_t * pNtk ); static int Abc_NtkRetimeUsingLags( Abc_Ntk_t * pNtk, Vec_Int_t * vLags, int fVerbose ); static inline int Abc_NodeComputeLag( int LValue, int Fi ) { return (LValue + (1<<16)*Fi)/Fi - (1<<16) - (int)(LValue % Fi == 0); } -static inline int Abc_NodeGetLValue( Abc_Obj_t * pNode ) { return (int)pNode->pCopy; } -static inline void Abc_NodeSetLValue( Abc_Obj_t * pNode, int Value ) { pNode->pCopy = (void *)Value; } +static inline int Abc_NodeGetLValue( Abc_Obj_t * pNode ) { return (int)(PORT_PTRUINT_T)pNode->pCopy; } +static inline void Abc_NodeSetLValue( Abc_Obj_t * pNode, int Value ) { pNode->pCopy = (void *)(PORT_PTRUINT_T)Value; } //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// diff --git a/src/opt/rwr/rwrDec.c b/src/opt/rwr/rwrDec.c index ef7af34f..ae01b896 100644 --- a/src/opt/rwr/rwrDec.c +++ b/src/opt/rwr/rwrDec.c @@ -60,7 +60,7 @@ void Rwr_ManPreprocess( Rwr_Man_t * p ) for ( pNode = p->pTable[i]; pNode; pNode = pNode->pNext ) { assert( pNode->uTruth == p->pTable[i]->uTruth ); - assert( p->pMap[pNode->uTruth] >= 0 && p->pMap[pNode->uTruth] < 222 ); + assert( p->pMap[pNode->uTruth] < 222 ); // Guaranteed to be >=0 b/c unsigned Vec_VecPush( p->vClasses, p->pMap[pNode->uTruth], pNode ); p->pMapInv[ p->pMap[pNode->uTruth] ] = p->puCanons[pNode->uTruth]; } diff --git a/src/opt/rwr/rwrEva.c b/src/opt/rwr/rwrEva.c index 396a659c..42c370ab 100644 --- a/src/opt/rwr/rwrEva.c +++ b/src/opt/rwr/rwrEva.c @@ -58,9 +58,12 @@ int Rwr_NodeRewrite( Rwr_Man_t * p, Cut_Man_t * pManCut, Abc_Obj_t * pNode, int Dec_Graph_t * pGraph; Cut_Cut_t * pCut;//, * pTemp; Abc_Obj_t * pFanin; - unsigned uPhase, uTruthBest, uTruth; + unsigned uPhase; + unsigned uTruthBest = 0; // Suppress "might be used uninitialized" + unsigned uTruth; char * pPerm; - int Required, nNodesSaved, nNodesSaveCur; + int Required, nNodesSaved; + int nNodesSaveCur = -1; // Suppress "might be used uninitialized" int i, GainCur, GainBest = -1; int clk, clk2;//, Counter; @@ -92,14 +95,14 @@ clk = clock(); // get the fanin permutation uTruth = 0xFFFF & *Cut_CutReadTruth(pCut); - pPerm = p->pPerms4[ p->pPerms[uTruth] ]; + pPerm = p->pPerms4[ (int)p->pPerms[uTruth] ]; uPhase = p->pPhases[uTruth]; // collect fanins with the corresponding permutation/phase Vec_PtrClear( p->vFaninsCur ); Vec_PtrFill( p->vFaninsCur, (int)pCut->nLeaves, 0 ); for ( i = 0; i < (int)pCut->nLeaves; i++ ) { - pFanin = Abc_NtkObj( pNode->pNtk, pCut->pLeaves[pPerm[i]] ); + pFanin = Abc_NtkObj( pNode->pNtk, pCut->pLeaves[(int)pPerm[i]] ); if ( pFanin == NULL ) break; pFanin = Abc_ObjNotCond(pFanin, ((uPhase & (1<<i)) > 0) ); @@ -247,7 +250,8 @@ Dec_Graph_t * Rwr_CutEvaluate( Rwr_Man_t * p, Abc_Obj_t * pRoot, Cut_Cut_t * pCu { extern int Dec_GraphToNetworkCount( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, int NodeMax, int LevelMax ); Vec_Ptr_t * vSubgraphs; - Dec_Graph_t * pGraphBest, * pGraphCur; + Dec_Graph_t * pGraphBest = NULL; // Suppress "might be used uninitialized" + Dec_Graph_t * pGraphCur; Rwr_Node_t * pNode, * pFanin; int nNodesAdded, GainBest, i, k; unsigned uTruth; diff --git a/src/opt/rwr/rwrExp.c b/src/opt/rwr/rwrExp.c index 2d00bb1c..5729cdbc 100644 --- a/src/opt/rwr/rwrExp.c +++ b/src/opt/rwr/rwrExp.c @@ -199,7 +199,7 @@ void Rwt_Man5ExploreStart() void Rwt_Man5ExploreCount( unsigned uTruth ) { int * pCounter; - if ( !stmm_find_or_add( s_pManRwrExp5->tTableNN, (char *)uTruth, (char***)&pCounter ) ) + if ( !stmm_find_or_add( s_pManRwrExp5->tTableNN, (char *)(PORT_PTRUINT_T)uTruth, (char***)&pCounter ) ) *pCounter = 0; (*pCounter)++; } @@ -271,7 +271,7 @@ void Rwt_Man5ExplorePrint() pFile = fopen( "nnclass_stats5.txt", "w" ); Vec_IntForEachEntry( vClassesNN, uTruth, i ) { - if ( !stmm_lookup( s_pManRwrExp5->tTableNN, (char *)uTruth, (char **)&Counter ) ) + if ( !stmm_lookup( s_pManRwrExp5->tTableNN, (char *)(PORT_PTRUINT_T)uTruth, (char **)&Counter ) ) { assert( 0 ); } @@ -288,9 +288,9 @@ clk = clock(); { int * pCounter; uTruthC = Extra_TruthCanonNPN( uTruth, 5 ); - if ( !stmm_find_or_add( s_pManRwrExp5->tTableNPN, (char *)uTruthC, (char***)&pCounter ) ) + if ( !stmm_find_or_add( s_pManRwrExp5->tTableNPN, (char *)(PORT_PTRUINT_T)uTruthC, (char***)&pCounter ) ) *pCounter = 0; - if ( !stmm_lookup( s_pManRwrExp5->tTableNN, (char *)uTruth, (char **)&Counter ) ) + if ( !stmm_lookup( s_pManRwrExp5->tTableNN, (char *)(PORT_PTRUINT_T)uTruth, (char **)&Counter ) ) { assert( 0 ); } @@ -309,7 +309,7 @@ PRT( "Computing NPN classes", clock() - clk ); pFile = fopen( "npnclass_stats5.txt", "w" ); Vec_IntForEachEntry( vClassesNPN, uTruth, i ) { - if ( !stmm_lookup( s_pManRwrExp5->tTableNPN, (char *)uTruth, (char **)&Counter ) ) + if ( !stmm_lookup( s_pManRwrExp5->tTableNPN, (char *)(PORT_PTRUINT_T)uTruth, (char **)&Counter ) ) { assert( 0 ); } @@ -324,8 +324,6 @@ PRT( "Computing NPN classes", clock() - clk ); } - - //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/sim/simMan.c b/src/opt/sim/simMan.c index 3b50ad84..139a1a05 100644 --- a/src/opt/sim/simMan.c +++ b/src/opt/sim/simMan.c @@ -77,7 +77,7 @@ Sym_Man_t * Sym_ManStart( Abc_Ntk_t * pNtk, int fVerbose ) for ( i = 0; i < p->nOutputs; i++ ) for ( v = 0; v < p->nInputs; v++ ) if ( Sim_SuppFunHasVar( p->vSuppFun, i, v ) ) - Vec_VecPush( p->vSupports, i, (void *)v ); + Vec_VecPush( p->vSupports, i, (void *)(PORT_PTRUINT_T)v ); return p; } diff --git a/src/opt/sim/simSupp.c b/src/opt/sim/simSupp.c index f7048f4a..e6ba853c 100644 --- a/src/opt/sim/simSupp.c +++ b/src/opt/sim/simSupp.c @@ -319,7 +319,7 @@ void Sim_ComputeSuppSetTargets( Sim_Man_t * p ) // find vars in the structural support that are not in the functional support Sim_UtilInfoDetectNews( pSuppFun, pSuppStr, p->nSuppWords, p->vDiffs ); Vec_IntForEachEntry( p->vDiffs, Num, k ) - Vec_VecPush( p->vSuppTargs, Num, (void *)i ); + Vec_VecPush( p->vSuppTargs, Num, (void *)(PORT_PTRUINT_T)i ); } } @@ -460,7 +460,7 @@ void Sim_SolveTargetsUsingSat( Sim_Man_t * p, int Limit ) Vec_VecForEachEntryReverse( p->vSuppTargs, pEntry, Input, k ) { p->nSatRuns++; - Output = (int)pEntry; + Output = (int)(PORT_PTRUINT_T)pEntry; // set up the miter for the two cofactors of this output w.r.t. this input pMiter = Abc_NtkMiterForCofactors( p->pNtk, Output, Input, -1 ); @@ -545,7 +545,7 @@ int Sim_NtkSimTwoPats_rec( Abc_Obj_t * pNode ) { int Value0, Value1; if ( Abc_NodeIsTravIdCurrent( pNode ) ) - return (int)pNode->pCopy; + return (int)(PORT_PTRUINT_T)pNode->pCopy; Abc_NodeSetTravIdCurrent( pNode ); Value0 = Sim_NtkSimTwoPats_rec( Abc_ObjFanin0(pNode) ); Value1 = Sim_NtkSimTwoPats_rec( Abc_ObjFanin1(pNode) ); @@ -553,7 +553,7 @@ int Sim_NtkSimTwoPats_rec( Abc_Obj_t * pNode ) Value0 = ~Value0; if ( Abc_ObjFaninC1(pNode) ) Value1 = ~Value1; - pNode->pCopy = (Abc_Obj_t *)(Value0 & Value1); + pNode->pCopy = (Abc_Obj_t *)(PORT_PTRUINT_T)(Value0 & Value1); return Value0 & Value1; } diff --git a/src/opt/sim/simUtils.c b/src/opt/sim/simUtils.c index b0660001..b74f3abe 100644 --- a/src/opt/sim/simUtils.c +++ b/src/opt/sim/simUtils.c @@ -118,7 +118,7 @@ void Sim_UtilInfoDetectDiffs( unsigned * pInfo1, unsigned * pInfo2, int nWords, unsigned uMask; vDiffs->nSize = 0; for ( w = 0; w < nWords; w++ ) - if ( uMask = (pInfo2[w] ^ pInfo1[w]) ) + if ( (uMask = (pInfo2[w] ^ pInfo1[w])) ) for ( b = 0; b < 32; b++ ) if ( uMask & (1 << b) ) Vec_IntPush( vDiffs, 32*w + b ); @@ -141,7 +141,7 @@ void Sim_UtilInfoDetectNews( unsigned * pInfo1, unsigned * pInfo2, int nWords, V unsigned uMask; vDiffs->nSize = 0; for ( w = 0; w < nWords; w++ ) - if ( uMask = (pInfo2[w] & ~pInfo1[w]) ) + if ( (uMask = (pInfo2[w] & ~pInfo1[w])) ) for ( b = 0; b < 32; b++ ) if ( uMask & (1 << b) ) Vec_IntPush( vDiffs, 32*w + b ); |