[CEC][SimGen][Warnings] Re-adjusted code to remove unused variables and avoid warnings compilation

This commit is contained in:
Carmine50 2024-12-21 16:19:47 +01:00
parent bd80d2e459
commit f407156de6
2 changed files with 9 additions and 5 deletions

View File

@ -68,7 +68,7 @@ int Gia_ObjCheckMffc_rec( Gia_Man_t * p,Gia_Obj_t * pObj, int Limit, Vec_Int_t *
return 0;
return 1;
}
inline int Gia_ObjCheckMffc( Gia_Man_t * p, Gia_Obj_t * pRoot, int Limit, Vec_Int_t * vNodes, Vec_Int_t * vLeaves, Vec_Int_t * vInners )
int Gia_ObjCheckMffc( Gia_Man_t * p, Gia_Obj_t * pRoot, int Limit, Vec_Int_t * vNodes, Vec_Int_t * vLeaves, Vec_Int_t * vInners )
{
int RetValue, iObj, i;
Vec_IntClear( vNodes );

View File

@ -2708,12 +2708,14 @@ void generateLutsRankings( Gia_Man_t * p){
Vec_Int_t * vLutsRankingsTmp = Vec_IntAlloc( Gia_ManLutNum(p) * 5 );
int LutId, iii, k, jjj;
char * pSop[2]; int nCubes[2]; int nFanins;
int * ranks, * fanins;
Gia_ManForEachLut( p, LutId )
{
nFanins = Gia_ObjLutSize(p, LutId);
Vec_PtrInsert( p->vLutsRankings, LutId, vLutsRankingsTmp->pArray + Vec_IntSize(vLutsRankingsTmp) );
int ranks[nFanins];
int fanins[nFanins];
assert( nFanins > 0 );
ranks = (int*) malloc( nFanins * sizeof(int) );
fanins = (int*) malloc( nFanins * sizeof(int) );
Gia_LutForEachFanin( p, LutId, k, iii ){
fanins[iii] = k;
ranks[iii] = 0;
@ -2736,6 +2738,8 @@ void generateLutsRankings( Gia_Man_t * p){
Vec_IntPush( vLutsRankingsTmp, fanins[positions[jjj]] );
}
free( positions );
free( ranks );
free( fanins );
}
//Vec_IntFree( vLutsRankingsTmp );
}
@ -3286,14 +3290,14 @@ int compute_quality_sop(Gia_Man_t * p , char * pSop, int ObjId ,int nFanins, int
int rouletteWheel( Vec_Int_t * vQualitySops, int numValid){
int i;
int i, max_int = 0xffffffff;
float totalSum;
totalSum = 0.0;
for ( i = 0; i < numValid; i++ )
totalSum += (float) Vec_IntEntry(vQualitySops, i);
unsigned int randValue = Gia_ManRandom(0);
float randValueNormalized = (float) ((float)randValue / __UINT32_MAX__);
float randValueNormalized = (float) ((float)randValue / max_int);
float randomNum = randValueNormalized * totalSum;
// Select the index based on inverse proportional probability