Fixing some warnings by adding cast from 'int' to 'size_t' in memset, memcpy, etc.

This commit is contained in:
Alan Mishchenko 2019-03-05 15:57:50 -08:00
parent b632c8496c
commit 01569b8f5f
114 changed files with 263 additions and 263 deletions

View File

@ -631,7 +631,7 @@ void Aig_RManRecord( unsigned * pTruth, int nVarsInit )
// compute the number of words
nWords = Abc_TruthWordNum( nVars );
// copy the function
memcpy( s_pRMan->pTruthInit, Kit_DsdObjTruth(pObj), 4*nWords );
memcpy( s_pRMan->pTruthInit, Kit_DsdObjTruth(pObj), (size_t)(4*nWords) );
Kit_DsdNtkFree( pNtk );
// canonicize the output
if ( s_pRMan->pTruthInit[0] & 1 )

View File

@ -525,7 +525,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fGiaSi
{
pCur++;
vStr = Vec_StrStart( Gia_AigerReadInt(pCur) ); pCur += 4;
memcpy( Vec_StrArray(vStr), pCur, Vec_StrSize(vStr) );
memcpy( Vec_StrArray(vStr), pCur, (size_t)Vec_StrSize(vStr) );
pCur += Vec_StrSize(vStr);
pNew->pAigExtra = Gia_AigerReadFromMemory( Vec_StrArray(vStr), Vec_StrSize(vStr), 0, 0, 0 );
Vec_StrFree( vStr );
@ -552,7 +552,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fGiaSi
pCur++;
nInputs = Gia_AigerReadInt(pCur)/4; pCur += 4;
pNew->vInArrs = Vec_FltStart( nInputs );
memcpy( Vec_FltArray(pNew->vInArrs), pCur, 4*nInputs ); pCur += 4*nInputs;
memcpy( Vec_FltArray(pNew->vInArrs), pCur, (size_t)4*nInputs ); pCur += 4*nInputs;
if ( fVerbose ) printf( "Finished reading extension \"i\".\n" );
}
else if ( *pCur == 'o' )
@ -560,7 +560,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fGiaSi
pCur++;
nOutputs = Gia_AigerReadInt(pCur)/4; pCur += 4;
pNew->vOutReqs = Vec_FltStart( nOutputs );
memcpy( Vec_FltArray(pNew->vOutReqs), pCur, 4*nOutputs ); pCur += 4*nOutputs;
memcpy( Vec_FltArray(pNew->vOutReqs), pCur, (size_t)4*nOutputs ); pCur += 4*nOutputs;
if ( fVerbose ) printf( "Finished reading extension \"o\".\n" );
}
// read equivalence classes
@ -580,7 +580,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fGiaSi
pCur++;
assert( Gia_AigerReadInt(pCur) == 4*Gia_ManRegNum(pNew) ); pCur += 4;
pNew->vFlopClasses = Vec_IntStart( Gia_ManRegNum(pNew) );
memcpy( Vec_IntArray(pNew->vFlopClasses), pCur, 4*Gia_ManRegNum(pNew) ); pCur += 4*Gia_ManRegNum(pNew);
memcpy( Vec_IntArray(pNew->vFlopClasses), pCur, (size_t)4*Gia_ManRegNum(pNew) ); pCur += 4*Gia_ManRegNum(pNew);
if ( fVerbose ) printf( "Finished reading extension \"f\".\n" );
}
// read gate classes
@ -589,7 +589,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fGiaSi
pCur++;
assert( Gia_AigerReadInt(pCur) == 4*Gia_ManObjNum(pNew) ); pCur += 4;
pNew->vGateClasses = Vec_IntStart( Gia_ManObjNum(pNew) );
memcpy( Vec_IntArray(pNew->vGateClasses), pCur, 4*Gia_ManObjNum(pNew) ); pCur += 4*Gia_ManObjNum(pNew);
memcpy( Vec_IntArray(pNew->vGateClasses), pCur, (size_t)4*Gia_ManObjNum(pNew) ); pCur += 4*Gia_ManObjNum(pNew);
if ( fVerbose ) printf( "Finished reading extension \"g\".\n" );
}
// read hierarchy information
@ -597,7 +597,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fGiaSi
{
pCur++;
vStr = Vec_StrStart( Gia_AigerReadInt(pCur) ); pCur += 4;
memcpy( Vec_StrArray(vStr), pCur, Vec_StrSize(vStr) );
memcpy( Vec_StrArray(vStr), pCur, (size_t)Vec_StrSize(vStr) );
pCur += Vec_StrSize(vStr);
pNew->pManTime = Tim_ManLoad( vStr, 1 );
Vec_StrFree( vStr );
@ -653,7 +653,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fGiaSi
pCur++;
pCurTemp = pCur + Gia_AigerReadInt(pCur) + 4; pCur += 4;
pPlacement = ABC_ALLOC( Gia_Plc_t, Gia_ManObjNum(pNew) );
memcpy( pPlacement, pCur, 4*Gia_ManObjNum(pNew) ); pCur += 4*Gia_ManObjNum(pNew);
memcpy( pPlacement, pCur, (size_t)4*Gia_ManObjNum(pNew) ); pCur += 4*Gia_ManObjNum(pNew);
assert( pCur == pCurTemp );
pNew->pPlacement = pPlacement;
if ( fVerbose ) printf( "Finished reading extension \"p\".\n" );
@ -696,7 +696,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fGiaSi
nSize = nSize - strlen(pNew->pCellStr) - 1;
assert( nSize % 4 == 0 );
pNew->vConfigs = Vec_IntAlloc(nSize / 4);
// memcpy(Vec_IntArray(pNew->vConfigs), pCur, nSize); pCur += nSize;
// memcpy(Vec_IntArray(pNew->vConfigs), pCur, (size_t)nSize); pCur += nSize;
for ( i = 0; i < nSize / 4; i++ )
Vec_IntPush( pNew->vConfigs, Gia_AigerReadInt(pCur) ), pCur += 4;
assert( pCur == pCurTemp );
@ -728,7 +728,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fGiaSi
pCur++;
pCurTemp = pCur + Gia_AigerReadInt(pCur) + 4; pCur += 4;
pSwitching = ABC_ALLOC( unsigned char, Gia_ManObjNum(pNew) );
memcpy( pSwitching, pCur, Gia_ManObjNum(pNew) ); pCur += Gia_ManObjNum(pNew);
memcpy( pSwitching, pCur, (size_t)Gia_ManObjNum(pNew) ); pCur += Gia_ManObjNum(pNew);
assert( pCur == pCurTemp );
if ( fVerbose ) printf( "Finished reading extension \"s\".\n" );
}
@ -737,7 +737,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fGiaSi
{
pCur++;
vStr = Vec_StrStart( Gia_AigerReadInt(pCur) ); pCur += 4;
memcpy( Vec_StrArray(vStr), pCur, Vec_StrSize(vStr) ); pCur += Vec_StrSize(vStr);
memcpy( Vec_StrArray(vStr), pCur, (size_t)Vec_StrSize(vStr) ); pCur += Vec_StrSize(vStr);
pNew->pManTime = Tim_ManLoad( vStr, 0 );
Vec_StrFree( vStr );
if ( fVerbose ) printf( "Finished reading extension \"t\".\n" );
@ -747,7 +747,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fGiaSi
{
pCur++;
pNew->vObjClasses = Vec_IntStart( Gia_AigerReadInt(pCur)/4 ); pCur += 4;
memcpy( Vec_IntArray(pNew->vObjClasses), pCur, 4*Vec_IntSize(pNew->vObjClasses) );
memcpy( Vec_IntArray(pNew->vObjClasses), pCur, (size_t)4*Vec_IntSize(pNew->vObjClasses) );
pCur += 4*Vec_IntSize(pNew->vObjClasses);
if ( fVerbose ) printf( "Finished reading extension \"v\".\n" );
}

View File

@ -218,7 +218,7 @@ Vec_Str_t * Gia_AigerWriteMapping( Gia_Man_t * p )
***********************************************************************/
int * Gia_AigerReadMappingSimple( unsigned char ** ppPos, int nSize )
{
int * pMapping = ABC_ALLOC( int, nSize/4 );
int * pMapping = ABC_ALLOC( int, (size_t)nSize/4 );
memcpy( pMapping, *ppPos, nSize );
assert( nSize % 4 == 0 );
return pMapping;
@ -226,7 +226,7 @@ int * Gia_AigerReadMappingSimple( unsigned char ** ppPos, int nSize )
Vec_Str_t * Gia_AigerWriteMappingSimple( Gia_Man_t * p )
{
unsigned char * pBuffer = ABC_ALLOC( unsigned char, 4*Vec_IntSize(p->vMapping) );
memcpy( pBuffer, Vec_IntArray(p->vMapping), 4*Vec_IntSize(p->vMapping) );
memcpy( pBuffer, Vec_IntArray(p->vMapping), (size_t)4*Vec_IntSize(p->vMapping) );
assert( Vec_IntSize(p->vMapping) >= Gia_ManObjNum(p) );
return Vec_StrAllocArray( (char *)pBuffer, 4*Vec_IntSize(p->vMapping) );
}

View File

@ -165,7 +165,7 @@ void Gia_SortTest()
printf( "Sorting %d integers\n", nSize );
pArray = Gia_SortGetTest( nSize );
clk = Abc_Clock();
qsort( pArray, nSize, 4, (int (*)(const void *, const void *)) num_cmp1 );
qsort( pArray, (size_t)nSize, 4, (int (*)(const void *, const void *)) num_cmp1 );
ABC_PRT( "qsort ", Abc_Clock() - clk );
Gia_SortVerifySorted( pArray, nSize );
ABC_FREE( pArray );

View File

@ -53,7 +53,7 @@ void Gia_ManPrintStateEncoding( Vec_Vec_t * vCodes, int nBits )
Vec_VecForEachLevelInt( vCodes, vVec, i )
{
printf( "%6d : ", i+1 );
memset( pBuffer, '-', nBits );
memset( pBuffer, '-', (size_t)nBits );
Vec_IntForEachEntry( vVec, Bit, k )
{
assert( Bit < nBits );

View File

@ -178,7 +178,7 @@ void Gia_ManCheckUnateVecTest( Gia_Man_t * p, int fVerbose )
for ( o = 0; o < Gia_ManCoNum(p); o++ )
{
Vec_Int_t * vUnate = Vec_WecEntry( vUnates, o );
memset( pBuffer, ' ', nVars );
memset( pBuffer, ' ', (size_t)nVars );
Vec_IntForEachEntry( vUnate, Var, i )
if ( i+1 < Vec_IntSize(vUnate) && Abc_Lit2Var(Var) == Abc_Lit2Var(Vec_IntEntry(vUnate, i+1)) ) // both lits are present
pBuffer[Abc_Lit2Var(Var)] = '.', i++, nNonUnate++; // does not depend on this var

View File

@ -142,7 +142,7 @@ unsigned * Ivy_NodeCutElementary( Vec_Int_t * vStore, int nWords, int NodeId )
{
unsigned * pBitCut;
pBitCut = Vec_IntFetch( vStore, nWords );
memset( pBitCut, 0, 4 * nWords );
memset( pBitCut, 0, (size_t)(4 * nWords) );
Extra_TruthSetBit( pBitCut, NodeId );
return pBitCut;
}

View File

@ -572,7 +572,7 @@ Ivy_FraigMan_t * Ivy_FraigStart( Ivy_Man_t * pManAig, Ivy_FraigParams_t * pParam
// p->pSimWords = ABC_ALLOC( unsigned, Ivy_ManObjNum(pManAig) * p->nSimWords );
EntrySize = sizeof(Ivy_FraigSim_t) + sizeof(unsigned) * p->nSimWords;
p->pSimWords = (char *)ABC_ALLOC( char, Ivy_ManObjNum(pManAig) * EntrySize );
memset( p->pSimWords, 0, EntrySize );
memset( p->pSimWords, 0, (size_t)EntrySize );
k = 0;
Ivy_ManForEachObj( pManAig, pObj, i )
{

View File

@ -201,8 +201,8 @@ static inline void Ndr_DataPushArray( Ndr_Data_t * p, int Type, int nArray, int
return;
assert( nArray > 0 );
Ndr_DataResize( p, nArray );
memset( p->pHead + p->nSize, Type, nArray );
memcpy( p->pBody + p->nSize, pArray, 4*nArray );
memset( p->pHead + p->nSize, Type, (size_t)nArray );
memcpy( p->pBody + p->nSize, pArray, (size_t)4*nArray );
p->nSize += nArray;
}
static inline void Ndr_DataPushString( Ndr_Data_t * p, int Type, char * pFunc )

View File

@ -66,7 +66,7 @@ void Abc_NtkOrderFaninsById( Abc_Ntk_t * pNtk )
Vec_IntSelectSortCost( pOrder, nVars, &pNode->vFanins );
// copy the cover
Vec_StrGrow( vStore, Abc_SopGetCubeNum(pSop) * (nVars + 3) + 1 );
memcpy( Vec_StrArray(vStore), pSop, Abc_SopGetCubeNum(pSop) * (nVars + 3) + 1 );
memcpy( Vec_StrArray(vStore), pSop, (size_t)(Abc_SopGetCubeNum(pSop) * (nVars + 3) + 1) );
pSopNew = pCubeNew = pSop;
pSop = Vec_StrArray(vStore);
// generate permuted one
@ -168,7 +168,7 @@ void Abc_NtkOrderFaninsBySortingColumns( Abc_Ntk_t * pNtk )
pOrder = Vec_IntArray(vOrder);
// copy the cover
Vec_StrGrow( vStore, Abc_SopGetCubeNum(pSop) * (nVars + 3) + 1 );
memcpy( Vec_StrArray(vStore), pSop, Abc_SopGetCubeNum(pSop) * (nVars + 3) + 1 );
memcpy( Vec_StrArray(vStore), pSop, (size_t)(Abc_SopGetCubeNum(pSop) * (nVars + 3) + 1) );
pSopNew = pCubeNew = pSop;
pSop = Vec_StrArray(vStore);
// generate permuted one
@ -272,7 +272,7 @@ void Abc_NtkOrderFaninsByLitCount( Abc_Ntk_t * pNtk )
*/
// copy the cover
Vec_StrGrow( vStore, Abc_SopGetCubeNum(pSop) * (nVars + 3) + 1 );
memcpy( Vec_StrArray(vStore), pSop, Abc_SopGetCubeNum(pSop) * (nVars + 3) + 1 );
memcpy( Vec_StrArray(vStore), pSop, (size_t)(Abc_SopGetCubeNum(pSop) * (nVars + 3) + 1) );
pSopNew = pCubeNew = pSop;
pSop = Vec_StrArray(vStore);
// generate permuted one
@ -353,7 +353,7 @@ void Abc_NtkOrderFaninsByLitCountAndCubeCount( Abc_Ntk_t * pNtk )
Vec_IntSelectSortCost( pOrder, nVars, vCounts );
// copy the cover
Vec_StrGrow( vStore, Abc_SopGetCubeNum(pSop) * (nVars + 3) + 1 );
memcpy( Vec_StrArray(vStore), pSop, Abc_SopGetCubeNum(pSop) * (nVars + 3) + 1 );
memcpy( Vec_StrArray(vStore), pSop, (size_t)(Abc_SopGetCubeNum(pSop) * (nVars + 3) + 1) );
pSopNew = pCubeNew = pSop;
pSop = Vec_StrArray(vStore);
// generate permuted one
@ -485,10 +485,10 @@ void Abc_NodeSortCubes( Abc_Obj_t * pNode, Vec_Ptr_t * vCubes, Vec_Str_t * vStor
{
assert( pCube[nVars] == 0 );
pCube[nVars] = ' ';
memcpy( pPivot, pCube, nVars + 3 );
memcpy( pPivot, pCube, (size_t)(nVars + 3) );
pPivot += nVars + 3;
}
memcpy( pSop, Vec_StrArray(vStore), Vec_PtrSize(vCubes) * (nVars + 3) );
memcpy( pSop, Vec_StrArray(vStore), (size_t)(Vec_PtrSize(vCubes) * (nVars + 3)) );
}
void Abc_NtkSortCubes( Abc_Ntk_t * pNtk, int fWeight )
{
@ -581,7 +581,7 @@ int Abc_NodeMakeSCCFree( Abc_Obj_t * pNode )
{
if ( pCube[0] == 'z' )
continue;
memcpy( pSopNew, pCube, nVars + 3 );
memcpy( pSopNew, pCube, (size_t)(nVars + 3) );
pSopNew += nVars + 3;
}
*pSopNew = 0;

View File

@ -334,13 +334,13 @@ void Abc_NtkOrderObjsByName( Abc_Ntk_t * pNtk, int fComb )
Abc_NtkForEachBox( pNtk, pObj, i )
pObj->pCopy = (Abc_Obj_t *)Abc_ObjName(Abc_ObjFanout0(pObj));
// order objects alphabetically
qsort( (void *)Vec_PtrArray(pNtk->vPis), Vec_PtrSize(pNtk->vPis), sizeof(Abc_Obj_t *),
qsort( (void *)Vec_PtrArray(pNtk->vPis), (size_t)Vec_PtrSize(pNtk->vPis), sizeof(Abc_Obj_t *),
(int (*)(const void *, const void *)) Abc_NodeCompareNames );
qsort( (void *)Vec_PtrArray(pNtk->vPos), Vec_PtrSize(pNtk->vPos), sizeof(Abc_Obj_t *),
qsort( (void *)Vec_PtrArray(pNtk->vPos), (size_t)Vec_PtrSize(pNtk->vPos), sizeof(Abc_Obj_t *),
(int (*)(const void *, const void *)) Abc_NodeCompareNames );
// if the comparison if combinational (latches as PIs/POs), order them too
if ( fComb )
qsort( (void *)Vec_PtrArray(pNtk->vBoxes), Vec_PtrSize(pNtk->vBoxes), sizeof(Abc_Obj_t *),
qsort( (void *)Vec_PtrArray(pNtk->vBoxes), (size_t)Vec_PtrSize(pNtk->vBoxes), sizeof(Abc_Obj_t *),
(int (*)(const void *, const void *)) Abc_NodeCompareNames );
// order CIs/COs first PIs/POs(Asserts) then latches
Abc_NtkOrderCisCos( pNtk );
@ -428,14 +428,14 @@ void Abc_NtkTransferOrder( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkNew )
Abc_NamDeref( pStrsCi );
Abc_NamDeref( pStrsCo );
// order PI/PO
qsort( (void *)Vec_PtrArray(pNtkNew->vPis), Vec_PtrSize(pNtkNew->vPis), sizeof(Abc_Obj_t *),
qsort( (void *)Vec_PtrArray(pNtkNew->vPis), (size_t)Vec_PtrSize(pNtkNew->vPis), sizeof(Abc_Obj_t *),
(int (*)(const void *, const void *)) Abc_NodeCompareIndexes );
qsort( (void *)Vec_PtrArray(pNtkNew->vPos), Vec_PtrSize(pNtkNew->vPos), sizeof(Abc_Obj_t *),
qsort( (void *)Vec_PtrArray(pNtkNew->vPos), (size_t)Vec_PtrSize(pNtkNew->vPos), sizeof(Abc_Obj_t *),
(int (*)(const void *, const void *)) Abc_NodeCompareIndexes );
// order CI/CO
qsort( (void *)Vec_PtrArray(pNtkNew->vCis), Vec_PtrSize(pNtkNew->vCis), sizeof(Abc_Obj_t *),
qsort( (void *)Vec_PtrArray(pNtkNew->vCis), (size_t)Vec_PtrSize(pNtkNew->vCis), sizeof(Abc_Obj_t *),
(int (*)(const void *, const void *)) Abc_NodeCompareIndexes );
qsort( (void *)Vec_PtrArray(pNtkNew->vCos), Vec_PtrSize(pNtkNew->vCos), sizeof(Abc_Obj_t *),
qsort( (void *)Vec_PtrArray(pNtkNew->vCos), (size_t)Vec_PtrSize(pNtkNew->vCos), sizeof(Abc_Obj_t *),
(int (*)(const void *, const void *)) Abc_NodeCompareIndexes );
// order CIs/COs first PIs/POs(Asserts) then latches
//Abc_NtkOrderCisCos( pNtk );

View File

@ -2091,7 +2091,7 @@ int Abc_NodeCompareByFanoutCount( Abc_Obj_t ** pp1, Abc_Obj_t ** pp2 )
void Abc_NtkPermutePiUsingFanout( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pNode; int i;
qsort( (void *)Vec_PtrArray(pNtk->vPis), Vec_PtrSize(pNtk->vPis), sizeof(Abc_Obj_t *),
qsort( (void *)Vec_PtrArray(pNtk->vPis), (size_t)Vec_PtrSize(pNtk->vPis), sizeof(Abc_Obj_t *),
(int (*)(const void *, const void *)) Abc_NodeCompareByFanoutCount );
Vec_PtrClear( pNtk->vCis );
Vec_PtrForEachEntry( Abc_Obj_t *, pNtk->vPis, pNode, i )

View File

@ -81,7 +81,7 @@ char * Abc_SopStart( Mem_Flex_t * pMan, int nCubes, int nVars )
Length = nCubes * (nVars + 3);
pSopCover = Mem_FlexEntryFetch( pMan, Length + 1 );
memset( pSopCover, '-', Length );
memset( pSopCover, '-', (size_t)Length );
pSopCover[Length] = 0;
for ( i = 0; i < nCubes; i++ )

View File

@ -2139,7 +2139,7 @@ void Abc_NtkCompareCones( Abc_Ntk_t * pNtk )
pSupps[i] = Vec_PtrSize(vSupp);
Vec_PtrFree( vSupp );
}
qsort( (void *)pPerms, Abc_NtkCoNum(pNtk), sizeof(int), (int (*)(const void *, const void *)) Abc_NtkCompareConesCompare );
qsort( (void *)pPerms, (size_t)Abc_NtkCoNum(pNtk), sizeof(int), (int (*)(const void *, const void *)) Abc_NtkCompareConesCompare );
// consider COs in this order
Iter = 0;

View File

@ -375,7 +375,7 @@ Vec_Ptr_t * Abc_NtkCreateCoOrder( Abc_Ntk_t * pNtk, Vec_Wec_t * vSupps )
Vec_PtrPush( vNodes, pNode );
}
// order objects alphabetically
qsort( (void *)Vec_PtrArray(vNodes), Vec_PtrSize(vNodes), sizeof(Abc_Obj_t *),
qsort( (void *)Vec_PtrArray(vNodes), (size_t)Vec_PtrSize(vNodes), sizeof(Abc_Obj_t *),
(int (*)(const void *, const void *)) Abc_NodeCompareByTemp );
// cleanup
// Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )

View File

@ -755,7 +755,7 @@ Vec_Ptr_t * Abc_NtkFindGoodOrder( Abc_Ntk_t * pNtk )
}
// sort nodes in the increasing order of the flow
qsort( (Abc_Obj_t **)Vec_PtrArray(vCos), Abc_NtkCoNum(pNtk),
qsort( (Abc_Obj_t **)Vec_PtrArray(vCos), (size_t)Abc_NtkCoNum(pNtk),
sizeof(Abc_Obj_t *), (int (*)(const void *, const void *))Abc_ObjCompareFlow );
// verify sorting
pFanin0 = (Abc_Obj_t *)Vec_PtrEntry(vCos, 0);

View File

@ -678,7 +678,7 @@ int Abc_NodeDecomposeStep( Abc_ManScl_t * p )
/*
for ( v = 0; v < nVars; v++ )
p->pBSet[v] = v;
qsort( (void *)p->pBSet, nVars, sizeof(int),
qsort( (void *)p->pBSet, (size_t)nVars, sizeof(int),
(int (*)(const void *, const void *)) Abc_NodeCompareLevelsInc );
*/
Abc_NodeDecomposeSort( (Abc_Obj_t **)Vec_PtrArray(p->vLeaves), Vec_PtrSize(p->vLeaves), p->pBSet, p->nLutSize );

View File

@ -132,7 +132,7 @@ int Abc_TruthNpnCountUniqueSort( Abc_TtStore_t * p )
// sort them by value
nWords = p->nWords;
assert( nWords > 0 );
qsort( (void *)p->pFuncs, p->nFuncs, sizeof(word *), (int(*)(const void *,const void *))Abc_TruthCompare );
qsort( (void *)p->pFuncs, (size_t)p->nFuncs, sizeof(word *), (int(*)(const void *,const void *))Abc_TruthCompare );
// count the number of unqiue functions
for ( i = k = 1; i < p->nFuncs; i++ )
if ( memcmp( p->pFuncs[i-1], p->pFuncs[i], sizeof(word) * nWords ) )

View File

@ -1356,7 +1356,7 @@ void Abc_NtkRecDumpTt3( char * pFileName, int fBinary )
Vec_MemForEachEntry( p->vTtMem, pTruth, i )
Vec_StrPush( p->vSupps, (char)Abc_TtSupportSize(pTruth, nVars) );
vEntries = Vec_IntStartNatural( nEntries );
qsort( (void *)Vec_IntArray(vEntries), nEntries, sizeof(int), (int(*)(const void *,const void *))Abc_NtkRecTruthCompare );
qsort( (void *)Vec_IntArray(vEntries), (size_t)nEntries, sizeof(int), (int(*)(const void *,const void *))Abc_NtkRecTruthCompare );
Vec_StrFreeP( &p->vSupps );
// write the file
Vec_IntForEachEntry( vEntries, Entry, i )

View File

@ -98,7 +98,7 @@ void Acb_DeriveCnfForWindowOne( Acb_Ntk_t * p, int iObj )
assert( Vec_WecSize(vCnfs) == Acb_NtkObjNumMax(p) );
Acb_DeriveCnfFromTruth( Acb_ObjTruth(p, iObj), Acb_ObjFaninNum(p, iObj), &p->vCover, &p->vCnf );
Vec_StrGrow( vCnfBase, Vec_StrSize(&p->vCnf) );
memcpy( Vec_StrArray(vCnfBase), Vec_StrArray(&p->vCnf), Vec_StrSize(&p->vCnf) );
memcpy( Vec_StrArray(vCnfBase), Vec_StrArray(&p->vCnf), (size_t)Vec_StrSize(&p->vCnf) );
vCnfBase->nSize = Vec_StrSize(&p->vCnf);
}
Vec_Wec_t * Acb_DeriveCnfForWindow( Acb_Ntk_t * p, Vec_Int_t * vWin, int PivotVar )

View File

@ -87,14 +87,14 @@ int BacManReadBacNameAndNums( char * pBuffer, int * Num1, int * Num2, int * Num3
}
void Bac_ManReadBacVecStr( Vec_Str_t * vOut, int * pPos, Vec_Str_t * p, int nSize )
{
memcpy( Vec_StrArray(p), Vec_StrArray(vOut) + *pPos, nSize );
memcpy( Vec_StrArray(p), Vec_StrArray(vOut) + *pPos, (size_t)nSize );
*pPos += nSize;
p->nSize = nSize;
assert( Vec_StrSize(p) == Vec_StrCap(p) );
}
void Bac_ManReadBacVecInt( Vec_Str_t * vOut, int * pPos, Vec_Int_t * p, int nSize )
{
memcpy( Vec_IntArray(p), Vec_StrArray(vOut) + *pPos, nSize );
memcpy( Vec_IntArray(p), Vec_StrArray(vOut) + *pPos, (size_t)nSize );
*pPos += nSize;
p->nSize = nSize / 4;
assert( Vec_IntSize(p) == Vec_IntCap(p) );

View File

@ -576,7 +576,7 @@ void CmdCommandPrint( Abc_Frame_t * pAbc, int fPrintAll, int fDetails )
nCommands = i;
// sort command by group and then by name, alphabetically
qsort( (void *)ppCommands, nCommands, sizeof(Abc_Command *),
qsort( (void *)ppCommands, (size_t)nCommands, sizeof(Abc_Command *),
(int (*)(const void *, const void *)) CmdCommandPrintCompare );
assert( CmdCommandPrintCompare( ppCommands, ppCommands + nCommands - 1 ) <= 0 );
@ -734,7 +734,7 @@ void CmdPrintTable( st__table * tTable, int fAliases )
ppNames[nNames++] = key;
// sort array by name
qsort( (void *)ppNames, nNames, sizeof(char *),
qsort( (void *)ppNames, (size_t)nNames, sizeof(char *),
(int (*)(const void *, const void *))CmdNamePrintCompare );
// print in this order

View File

@ -113,7 +113,7 @@ int AllocateCover( int nCubes, int nWordsIn, int nWordsOut )
pp[0] = (Cube *)ABC_ALLOC( char, TotalSize );
if ( pp[0] == NULL )
return 0;
memset( pp[0], 0, TotalSize );
memset( pp[0], 0, (size_t)TotalSize );
// assign pointers to cubes and bit strings inside this piece
pp[0]->pCubeDataIn = (unsigned*)(pp[0] + 1);

View File

@ -153,7 +153,7 @@ static char * Ioa_ReadLoadFileBz2Aig( char * pFileName, int * pFileSize )
p = pContents = ABC_ALLOC( char, nFileSize + 10 );
buf = bufHead;
do {
memcpy(p+nBytes,buf->buf,buf->nBuf);
memcpy(p+nBytes,buf->buf,(size_t)buf->nBuf);
nBytes += buf->nBuf;
// } while((buf = buf->next));
pNext = buf->next;

View File

@ -585,7 +585,7 @@ char * Io_MvLoadFileBz2( char * pFileName, int * pnFileSize )
p = pContents = ABC_ALLOC( char, nFileSize + 10 );
buf = bufHead;
do {
memcpy(p+nBytes,buf->buf,buf->nBuf);
memcpy(p+nBytes,buf->buf,(size_t)buf->nBuf);
nBytes += buf->nBuf;
// } while((buf = buf->next));
pNext = buf->next;

View File

@ -76,8 +76,8 @@ int Io_WritePlaOne( FILE * pFile, Abc_Ntk_t * pNtk )
nOutputs = Abc_NtkCoNum(pNtk);
pCubeIn = ABC_ALLOC( char, nInputs + 1 );
pCubeOut = ABC_ALLOC( char, nOutputs + 1 );
memset( pCubeIn, '-', nInputs ); pCubeIn[nInputs] = 0;
memset( pCubeOut, '0', nOutputs ); pCubeOut[nOutputs] = 0;
memset( pCubeIn, '-', (size_t)nInputs ); pCubeIn[nInputs] = 0;
memset( pCubeOut, '0', (size_t)nOutputs ); pCubeOut[nOutputs] = 0;
// write the header
fprintf( pFile, ".i %d\n", nInputs );

View File

@ -131,7 +131,7 @@ void Ver_StreamReload( Ver_Stream_t * p )
// figure out how many chars are still not processed
nCharsUsed = p->pBufferEnd - p->pBufferCur;
// move the remaining data to the beginning of the buffer
memmove( p->pBuffer, p->pBufferCur, nCharsUsed );
memmove( p->pBuffer, p->pBufferCur, (size_t)nCharsUsed );
p->pBufferCur = p->pBuffer;
// determine how many chars we will read
nCharsToRead = VER_MINIMUM( p->nBufferSize - nCharsUsed, p->nFileSize - p->nFileRead );

View File

@ -524,9 +524,9 @@ DdNode * GetSingleOutputFunction( DdManager * dd, DdNode ** pbOuts, int nOuts, D
}
// order the outputs
qsort( (void*)Order, nOuts, sizeof(int), (int(*)(const void*, const void*)) CompareSupports );
qsort( (void*)Order, (size_t)nOuts, sizeof(int), (int(*)(const void*, const void*)) CompareSupports );
// order the outputs
// qsort( (void*)OrderMint, nOuts, sizeof(int), (int(*)(const void*, const void*)) CompareMinterms );
// qsort( (void*)OrderMint, (size_t)nOuts, sizeof(int), (int(*)(const void*, const void*)) CompareMinterms );
bResult = b0; Cudd_Ref( bResult );

View File

@ -755,7 +755,7 @@ ddGroupSifting(
}
}
qsort((void *)var,classes,sizeof(int),
qsort((void *)var,(size_t)classes,sizeof(int),
(DD_QSFP) ddUniqueCompareGroup);
if (lazyFlag) {

View File

@ -219,7 +219,7 @@ cuddLocalCacheInit(
manager->memused += cacheSize * cache->itemsize + sizeof(DdLocalCache);
/* Initialize the cache. */
memset(cache->item, 0, cacheSize * cache->itemsize);
memset(cache->item, 0, (size_t)(cacheSize * cache->itemsize));
/* Add to manager's list of local caches for GC. */
cuddLocalCacheAddToList(cache);
@ -407,7 +407,7 @@ cuddLocalCacheClearAll(
DdLocalCache *cache = manager->localCaches;
while (cache != NULL) {
memset(cache->item, 0, cache->slots * cache->itemsize);
memset(cache->item, 0, (size_t)(cache->slots * cache->itemsize));
cache = cache->next;
}
return;
@ -569,7 +569,7 @@ cuddHashTableInit(
ABC_FREE(hash);
return(NULL);
}
memset(hash->bucket, 0, hash->numBuckets * sizeof(DdHashItem *));
memset(hash->bucket, 0, (size_t)(hash->numBuckets * sizeof(DdHashItem *)));
hash->size = 0;
hash->maxsize = hash->numBuckets * DD_MAX_HASHTABLE_DENSITY;
#ifdef __osf__
@ -1140,7 +1140,7 @@ cuddLocalCacheResize(
cache->manager->memused += (slots - oldslots) * cache->itemsize;
/* Clear new cache. */
memset(item, 0, slots * cache->itemsize);
memset(item, 0, (size_t)(slots * cache->itemsize));
/* Copy from old cache to new one. */
for (i = 0; (unsigned) i < oldslots; i++) {

View File

@ -304,7 +304,7 @@ cuddLevelQueueEnqueue(
queue->freelist = item->next;
}
/* Initialize. */
memset(item, 0, queue->itemsize);
memset(item, 0, (size_t)queue->itemsize);
item->key = key;
/* Update stats. */
queue->size++;

View File

@ -295,7 +295,7 @@ cuddLinearAndSifting(
var[i] = i;
}
qsort((void *)var,size,sizeof(int),(DD_QSFP)ddLinearUniqueCompare);
qsort((void *)var,(size_t)size,sizeof(int),(DD_QSFP)ddLinearUniqueCompare);
/* Now sift. */
for (i = 0; i < ddMin(table->siftMaxVar,size); i++) {

View File

@ -541,7 +541,7 @@ cuddSifting(
var[i] = i;
}
qsort((void *)var,size,sizeof(int),(DD_QSFP)ddUniqueCompare);
qsort((void *)var,(size_t)size,sizeof(int),(DD_QSFP)ddUniqueCompare);
/* Now sift. */
for (i = 0; i < ddMin(table->siftMaxVar,size); i++) {

View File

@ -356,7 +356,7 @@ cuddSymmSifting(
var[i] = i;
}
qsort((void *)var,size,sizeof(int),(DD_QSFP)ddSymmUniqueCompare);
qsort((void *)var,(size_t)size,sizeof(int),(DD_QSFP)ddSymmUniqueCompare);
/* Initialize the symmetry of each subtable to itself. */
for (i = lower; i <= upper; i++) {
@ -480,7 +480,7 @@ cuddSymmSiftingConv(
var[i] = i;
}
qsort((void *)var,size,sizeof(int),(DD_QSFP)ddSymmUniqueCompare);
qsort((void *)var,(size_t)size,sizeof(int),(DD_QSFP)ddSymmUniqueCompare);
/* Initialize the symmetry of each subtable to itself
** for first pass of converging symmetric sifting.
@ -535,7 +535,7 @@ cuddSymmSiftingConv(
var[classes] = i;
}
qsort((void *)var,classes,sizeof(int),(DD_QSFP)ddSymmUniqueCompare);
qsort((void *)var,(size_t)classes,sizeof(int),(DD_QSFP)ddSymmUniqueCompare);
/* Now sift. */
for (i = 0; i < ddMin(table->siftMaxVar,classes); i++) {

View File

@ -682,7 +682,7 @@ zddGroupSifting(
}
}
qsort((void *)var,classes,sizeof(int),(DD_QSFP)zddUniqueCompareGroup);
qsort((void *)var,(size_t)classes,sizeof(int),(DD_QSFP)zddUniqueCompareGroup);
/* Now sift. */
for (i = 0; i < ddMin(table->siftMaxVar,classes); i++) {

View File

@ -189,7 +189,7 @@ cuddZddLinearSifting(
var[i] = i;
}
qsort((void *)var, size, sizeof(int), (DD_QSFP)cuddZddUniqueCompare);
qsort((void *)var, (size_t)size, sizeof(int), (DD_QSFP)cuddZddUniqueCompare);
/* Now sift. */
for (i = 0; i < ddMin(table->siftMaxVar, size); i++) {

View File

@ -899,7 +899,7 @@ cuddZddSifting(
var[i] = i;
}
qsort((void *)var, size, sizeof(int), (DD_QSFP)cuddZddUniqueCompare);
qsort((void *)var, (size_t)size, sizeof(int), (DD_QSFP)cuddZddUniqueCompare);
/* Now sift. */
for (i = 0; i < ddMin(table->siftMaxVar, size); i++) {

View File

@ -337,7 +337,7 @@ cuddZddSymmSifting(
var[i] = i;
}
qsort((void *)var, nvars, sizeof(int), (DD_QSFP)cuddZddUniqueCompare);
qsort((void *)var, (size_t)nvars, sizeof(int), (DD_QSFP)cuddZddUniqueCompare);
/* Initialize the symmetry of each subtable to itself. */
for (i = lower; i <= upper; i++)
@ -462,7 +462,7 @@ cuddZddSymmSiftingConv(
var[i] = i;
}
qsort((void *)var, nvars, sizeof(int), (DD_QSFP)cuddZddUniqueCompare);
qsort((void *)var, (size_t)nvars, sizeof(int), (DD_QSFP)cuddZddUniqueCompare);
/* Initialize the symmetry of each subtable to itself
** for first pass of converging symmetric sifting.
@ -519,7 +519,7 @@ cuddZddSymmSiftingConv(
var[classes] = i;
}
qsort((void *)var,classes,sizeof(int),(DD_QSFP)cuddZddUniqueCompare);
qsort((void *)var,(size_t)classes,sizeof(int),(DD_QSFP)cuddZddUniqueCompare);
/* Now sift. */
iteration = ddMin(table->siftMaxVar, nvars);

View File

@ -197,7 +197,7 @@ void Extra_UnateInfoPrint( Extra_UnateInfo_t * p )
char * pBuffer;
int i;
pBuffer = ABC_ALLOC( char, p->nVarsMax+1 );
memset( pBuffer, ' ', p->nVarsMax );
memset( pBuffer, ' ', (size_t)p->nVarsMax );
pBuffer[p->nVarsMax] = 0;
for ( i = 0; i < p->nVars; i++ )
if ( p->pVars[i].Neg )

View File

@ -95,7 +95,7 @@ Kit_DsdObj_t * Kit_DsdObjAlloc( Kit_DsdNtk_t * pNtk, Kit_Dsd_t Type, int nFans )
Kit_DsdObj_t * pObj;
int nSize = sizeof(Kit_DsdObj_t) + sizeof(unsigned) * (Kit_DsdObjOffset(nFans) + (Type == KIT_DSD_PRIME) * Kit_TruthWordNum(nFans));
pObj = (Kit_DsdObj_t *)ABC_ALLOC( char, nSize );
memset( pObj, 0, nSize );
memset( pObj, 0, (size_t)nSize );
pObj->Id = pNtk->nVars + pNtk->nNodes;
pObj->Type = Type;
pObj->nFans = nFans;

View File

@ -216,7 +216,7 @@ char * Kit_PlaStart( void * p, int nCubes, int nVars )
Length = nCubes * (nVars + 3);
pSopCover = Aig_MmFlexEntryFetch( pMan, Length + 1 );
memset( pSopCover, '-', Length );
memset( pSopCover, '-', (size_t)Length );
pSopCover[Length] = 0;
for ( i = 0; i < nCubes; i++ )

View File

@ -47,7 +47,7 @@ int memCompare(word* x, word* y, int nVars)
{
int i, count=1, WordsN = p->nFuncs;
word tempWord;
qsort(a,WordsN,sizeof(word),compareWords1);
qsort(a,(size_t)WordsN,sizeof(word),compareWords1);
tempWord = a[0];
for(i=1;i<WordsN;i++)
if(tempWord != a[i])
@ -302,25 +302,25 @@ int minimalFlip1(word* pInOut, word* pMinimal, word* PDuplicat, int nVars)
{
int i;
int blockSize = Kit_TruthWordNum_64bit( nVars )*sizeof(word);
memcpy(pMinimal, pInOut, blockSize);
memcpy(PDuplicat, pInOut, blockSize);
memcpy(pMinimal, pInOut, (size_t)blockSize);
memcpy(PDuplicat, pInOut, (size_t)blockSize);
Kit_TruthChangePhase_64bit( pInOut, nVars, 0 );
for(i=1;i<nVars;i++)
{
if( memCompare(pMinimal,pInOut,nVars) == 1)
{
memcpy(pMinimal, pInOut, blockSize);
memcpy(pMinimal, pInOut, (size_t)blockSize);
Kit_TruthChangePhase_64bit( pInOut, nVars, i );
}
else
{
memcpy(pInOut, pMinimal, blockSize);
memcpy(pInOut, pMinimal, (size_t)blockSize);
Kit_TruthChangePhase_64bit( pInOut, nVars, i );
}
}
if( memCompare(pMinimal,pInOut,nVars) == -1)
memcpy(pInOut, pMinimal, blockSize);
if(memcmp(pInOut,PDuplicat,blockSize) == 0)
memcpy(pInOut, pMinimal, (size_t)blockSize);
if(memcmp(pInOut,PDuplicat,(size_t)blockSize) == 0)
return 0;
else
return 1;
@ -333,25 +333,25 @@ int minimalSwap1(word* pInOut, word* pMinimal, word* PDuplicat, int nVars)
{
int i;
int blockSize = Kit_TruthWordNum_64bit( nVars )*sizeof(word);
memcpy(pMinimal, pInOut, blockSize);
memcpy(PDuplicat, pInOut, blockSize);
memcpy(pMinimal, pInOut, (size_t)blockSize);
memcpy(PDuplicat, pInOut, (size_t)blockSize);
Kit_TruthSwapAdjacentVars_64bit( pInOut, nVars, 0 );
for(i=1;i<nVars-1;i++)
{
if( memCompare(pMinimal,pInOut,nVars) == 1)
{
memcpy(pMinimal, pInOut, blockSize);
memcpy(pMinimal, pInOut, (size_t)blockSize);
Kit_TruthSwapAdjacentVars_64bit( pInOut, nVars, i );
}
else
{
memcpy(pInOut, pMinimal, blockSize);
memcpy(pInOut, pMinimal, (size_t)blockSize);
Kit_TruthSwapAdjacentVars_64bit( pInOut, nVars, i );
}
}
if( memCompare(pMinimal,pInOut,nVars) == -1)
memcpy(pInOut, pMinimal, blockSize);
if(memcmp(pInOut,PDuplicat,blockSize) == 0)
memcpy(pInOut, pMinimal, (size_t)blockSize);
if(memcmp(pInOut,PDuplicat,(size_t)blockSize) == 0)
return 0;
else
return 1;
@ -380,20 +380,20 @@ int minimalFlip(word* pInOut, word* pMinimal, word* PDuplicat, int nVars, unsig
int i;
unsigned minTemp = *p_uCanonPhase;
int blockSize = Kit_TruthWordNum_64bit( nVars )*sizeof(word);
memcpy(pMinimal, pInOut, blockSize);
memcpy(PDuplicat, pInOut, blockSize); //////////////need one more unsigned!!!!!!!!!!!!!
memcpy(pMinimal, pInOut, (size_t)blockSize);
memcpy(PDuplicat, pInOut, (size_t)blockSize); //////////////need one more unsigned!!!!!!!!!!!!!
Kit_TruthChangePhase_64bit( pInOut, nVars, 0 );
*p_uCanonPhase ^= (unsigned)1;
for(i=1;i<nVars;i++)
{
if( memCompare(pMinimal,pInOut,nVars) == 1)
{
memcpy(pMinimal, pInOut, blockSize);
memcpy(pMinimal, pInOut, (size_t)blockSize);
minTemp = *p_uCanonPhase;
}
else
{
memcpy(pInOut, pMinimal, blockSize);
memcpy(pInOut, pMinimal, (size_t)blockSize);
*p_uCanonPhase = minTemp;
}
Kit_TruthChangePhase_64bit( pInOut, nVars, i );
@ -401,10 +401,10 @@ int minimalFlip(word* pInOut, word* pMinimal, word* PDuplicat, int nVars, unsig
}
if( memCompare(pMinimal,pInOut,nVars) == -1)
{
memcpy(pInOut, pMinimal, blockSize);
memcpy(pInOut, pMinimal, (size_t)blockSize);
*p_uCanonPhase = minTemp;
}
if(memcmp(pInOut,PDuplicat,blockSize) == 0)
if(memcmp(pInOut,PDuplicat,(size_t)blockSize) == 0)
return 0;
else
return 1;
@ -478,24 +478,24 @@ int minimalSwap(word* pInOut, word* pMinimal, word* PDuplicat, int nVars, char
int blockSizeWord = Kit_TruthWordNum_64bit( nVars )*sizeof(word);
int blockSizeChar = nVars *sizeof(char);
unsigned TempuCanonPhase = *p_uCanonPhase;
memcpy(pMinimal, pInOut, blockSizeWord);
memcpy(PDuplicat, pInOut, blockSizeWord);
memcpy(tempArray, pCanonPerm, blockSizeChar);
memcpy(pMinimal, pInOut, (size_t)blockSizeWord);
memcpy(PDuplicat, pInOut, (size_t)blockSizeWord);
memcpy(tempArray, pCanonPerm, (size_t)blockSizeChar);
Kit_TruthSwapAdjacentVars_64bit( pInOut, nVars, 0 );
swapInfoAdjacentVars(0, pCanonPerm, p_uCanonPhase);
for(i=1;i<nVars-1;i++)
{
if( memCompare(pMinimal,pInOut,nVars) == 1)
{
memcpy(pMinimal, pInOut, blockSizeWord);
memcpy(tempArray, pCanonPerm, blockSizeChar);
memcpy(pMinimal, pInOut, (size_t)blockSizeWord);
memcpy(tempArray, pCanonPerm, (size_t)blockSizeChar);
TempuCanonPhase = *p_uCanonPhase;
}
else
{
memcpy(pInOut, pMinimal, blockSizeWord);
memcpy(pCanonPerm, tempArray, blockSizeChar);
memcpy(pInOut, pMinimal, (size_t)blockSizeWord);
memcpy(pCanonPerm, tempArray, (size_t)blockSizeChar);
*p_uCanonPhase = TempuCanonPhase;
}
Kit_TruthSwapAdjacentVars_64bit( pInOut, nVars, i );
@ -503,11 +503,11 @@ int minimalSwap(word* pInOut, word* pMinimal, word* PDuplicat, int nVars, char
}
if( memCompare(pMinimal,pInOut,nVars) == -1)
{
memcpy(pInOut, pMinimal, blockSizeWord);
memcpy(pCanonPerm, tempArray, blockSizeChar);
memcpy(pInOut, pMinimal, (size_t)blockSizeWord);
memcpy(pCanonPerm, tempArray, (size_t)blockSizeChar);
*p_uCanonPhase = TempuCanonPhase;
}
if(memcmp(pInOut,PDuplicat,blockSizeWord) == 0)
if(memcmp(pInOut,PDuplicat,(size_t)blockSizeWord) == 0)
return 0;
else
return 1;

View File

@ -285,13 +285,13 @@ void arrangeQuoters_superFast_iVar5(unsigned* pInOut, unsigned* temp, int start,
for(i=start-1;i>0;i-=shiftSize)
{
tempPtr -= 1;
memcpy(tempPtr, pInOut+i-iQ, blockSize);
memcpy(tempPtr, pInOut+i-iQ, (size_t)blockSize);
tempPtr -= 1;
memcpy(tempPtr, pInOut+i-jQ, blockSize);
memcpy(tempPtr, pInOut+i-jQ, (size_t)blockSize);
tempPtr -= 1;
memcpy(tempPtr, pInOut+i-kQ, blockSize);
memcpy(tempPtr, pInOut+i-kQ, (size_t)blockSize);
tempPtr -= 1;
memcpy(tempPtr, pInOut+i-lQ, blockSize);
memcpy(tempPtr, pInOut+i-lQ, (size_t)blockSize);
}
memcpy(pInOut, temp, start*sizeof(unsigned));
updataInfo(iQ, jQ, 5, pCanonPerm, pCanonPhase);
@ -462,13 +462,13 @@ void arrangeQuoters_superFast_moreThen5(word* pInOut, word* temp, int start, in
for(i=start-wordBlock;i>0;i-=shiftSize)
{
tempPtr -= wordBlock;
memcpy(tempPtr, pInOut+i-iQ*wordBlock, blockSize);
memcpy(tempPtr, pInOut+i-iQ*wordBlock, (size_t)blockSize);
tempPtr -= wordBlock;
memcpy(tempPtr, pInOut+i-jQ*wordBlock, blockSize);
memcpy(tempPtr, pInOut+i-jQ*wordBlock, (size_t)blockSize);
tempPtr -= wordBlock;
memcpy(tempPtr, pInOut+i-kQ*wordBlock, blockSize);
memcpy(tempPtr, pInOut+i-kQ*wordBlock, (size_t)blockSize);
tempPtr -= wordBlock;
memcpy(tempPtr, pInOut+i-lQ*wordBlock, blockSize);
memcpy(tempPtr, pInOut+i-lQ*wordBlock, (size_t)blockSize);
}
memcpy(pInOut, temp, start*sizeof(word));
updataInfo(iQ, jQ, iVar, pCanonPerm, pCanonPhase);

View File

@ -115,9 +115,9 @@ void Kit_TruthChangePhase_64bit( word * pInOut, int nVars, int iVar )
SizeOfBlock = sizeof(word)*Step;
for ( i = 0; i < nWords; i += 2*Step )
{
memcpy(Temp,pInOut,SizeOfBlock);
memcpy(pInOut,pInOut+Step,SizeOfBlock);
memcpy(pInOut+Step,Temp,SizeOfBlock);
memcpy(Temp,pInOut,(size_t)SizeOfBlock);
memcpy(pInOut,pInOut+Step,(size_t)SizeOfBlock);
memcpy(pInOut+Step,Temp,(size_t)SizeOfBlock);
// Temp = pInOut[i];
// pInOut[i] = pInOut[Step+i];
// pInOut[Step+i] = Temp;
@ -165,9 +165,9 @@ void Kit_TruthSwapAdjacentVars_64bit( word * pInOut, int nVars, int iVar )
pInOut += 2*Step;
for(i=2*Step; i<nWords; i+=4*Step)
{
memcpy(temp,pInOut-Step,SizeOfBlock);
memcpy(pInOut-Step,pInOut,SizeOfBlock);
memcpy(pInOut,temp,SizeOfBlock);
memcpy(temp,pInOut-Step,(size_t)SizeOfBlock);
memcpy(pInOut-Step,pInOut,(size_t)SizeOfBlock);
memcpy(pInOut,temp,(size_t)SizeOfBlock);
pInOut += 4*Step;
}
}

View File

@ -80,9 +80,9 @@ void swap_ij_case3( word* f,int totalVars, int i, int j)
for(y=wwj/2; y<WORDS_IN_TT; y+=wwj)
for(x=y-shift; x<y; x+=wwi)
{
memcpy(temp,&f[x],SizeOfBlock);
memcpy(&f[x],&f[x+shift],SizeOfBlock);
memcpy(&f[x+shift],temp,SizeOfBlock);
memcpy(temp,&f[x],(size_t)SizeOfBlock);
memcpy(&f[x],&f[x+shift],(size_t)SizeOfBlock);
memcpy(&f[x+shift],temp,(size_t)SizeOfBlock);
}
}
void swap_ij( word* f,int totalVars, int varI, int varJ)

View File

@ -221,7 +221,7 @@ Vec_Ptr_t * Amap_LibSortGatesByArea( Amap_Lib_t * pLib )
{
Vec_Ptr_t * vSorted;
vSorted = Vec_PtrDup( pLib->vGates );
qsort( (void *)Vec_PtrArray(vSorted), Vec_PtrSize(vSorted), sizeof(void *),
qsort( (void *)Vec_PtrArray(vSorted), (size_t)Vec_PtrSize(vSorted), sizeof(void *),
(int (*)(const void *, const void *)) Amap_LibCompareGatesByArea );
return vSorted;
}

View File

@ -47,7 +47,7 @@ Amap_Cut_t * Amap_ManDupCut( Amap_Man_t * p, Amap_Cut_t * pCut )
Amap_Cut_t * pNew;
int nBytes = sizeof(Amap_Cut_t) + sizeof(int) * pCut->nFans;
pNew = (Amap_Cut_t *)Aig_MmFlexEntryFetch( p->pMemCutBest, nBytes );
memcpy( pNew, pCut, nBytes );
memcpy( pNew, pCut, (size_t)nBytes );
return pNew;
}

View File

@ -396,7 +396,7 @@ if ( pLib->fVerbose )
pSet2->iGate = pGate->Id;
pSet2->fInv = Abc_LitIsCompl(iNod);
pSet2->nIns = pGate->nPins;
memcpy( pSet2->Ins, pSet->Ins, pGate->nPins );
memcpy( pSet2->Ins, pSet->Ins, (size_t)pGate->nPins );
// update inputs
pSet2->Ins[iThis] = Abc_Var2Lit( Abc_Lit2Var(pSet->Ins[iThat]), Abc_LitIsCompl(pSet->Ins[iThis]) );
pSet2->Ins[iThat] = Abc_Var2Lit( Abc_Lit2Var(pSet->Ins[iThis]), Abc_LitIsCompl(pSet->Ins[iThat]) );

View File

@ -1112,7 +1112,7 @@ Fpga_Cut_t * Fpga_CutSortCuts( Fpga_Man_t * pMan, Fpga_CutTable_t * p, Fpga_Cut_
nCuts = Fpga_CutList2Array( p->pCuts1, pList );
assert( nCuts <= FPGA_CUTS_MAX_COMPUTE );
// sort the cuts
qsort( (void *)p->pCuts1, nCuts, sizeof(void *),
qsort( (void *)p->pCuts1, (size_t)nCuts, sizeof(void *),
(int (*)(const void *, const void *)) Fpga_CutSortCutsCompare );
// move them back into the list
if ( nCuts > FPGA_CUTS_MAX_USE - 1 )

View File

@ -584,10 +584,10 @@ int Fpga_CompareNodesByLevelIncreasing( Fpga_Node_t ** ppS1, Fpga_Node_t ** ppS2
void Fpga_MappingSortByLevel( Fpga_Man_t * pMan, Fpga_NodeVec_t * vNodes, int fIncreasing )
{
if ( fIncreasing )
qsort( (void *)vNodes->pArray, vNodes->nSize, sizeof(Fpga_Node_t *),
qsort( (void *)vNodes->pArray, (size_t)vNodes->nSize, sizeof(Fpga_Node_t *),
(int (*)(const void *, const void *)) Fpga_CompareNodesByLevelIncreasing );
else
qsort( (void *)vNodes->pArray, vNodes->nSize, sizeof(Fpga_Node_t *),
qsort( (void *)vNodes->pArray, (size_t)vNodes->nSize, sizeof(Fpga_Node_t *),
(int (*)(const void *, const void *)) Fpga_CompareNodesByLevelDecreasing );
// assert( Fpga_CompareNodesByLevel( vNodes->pArray, vNodes->pArray + vNodes->nSize - 1 ) <= 0 );
}

View File

@ -288,7 +288,7 @@ int Fpga_NodeVecCompareLevels( Fpga_Node_t ** pp1, Fpga_Node_t ** pp2 )
***********************************************************************/
void Fpga_NodeVecSortByLevel( Fpga_NodeVec_t * p )
{
qsort( (void *)p->pArray, p->nSize, sizeof(Fpga_Node_t *),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(Fpga_Node_t *),
(int (*)(const void *, const void *)) Fpga_NodeVecCompareLevels );
}
@ -325,7 +325,7 @@ int Fpga_NodeVecCompareArrivals( Fpga_Node_t ** ppS1, Fpga_Node_t ** ppS2 )
***********************************************************************/
void Fpga_SortNodesByArrivalTimes( Fpga_NodeVec_t * p )
{
qsort( (void *)p->pArray, p->nSize, sizeof(Fpga_Node_t *),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(Fpga_Node_t *),
(int (*)(const void *, const void *)) Fpga_NodeVecCompareArrivals );
// assert( Fpga_CompareNodesByLevel( p->pArray, p->pArray + p->nSize - 1 ) <= 0 );
}

View File

@ -411,8 +411,8 @@ static inline int If_CutTruthWords( int nVarsMax ) { r
static inline int If_CutPermWords( int nVarsMax ) { return nVarsMax / sizeof(int) + ((nVarsMax % sizeof(int)) > 0); }
static inline int If_CutLeafBit( If_Cut_t * pCut, int i ) { return (pCut->uMaskFunc >> i) & 1; }
static inline char * If_CutPerm( If_Cut_t * pCut ) { return (char *)(pCut->pLeaves + pCut->nLeaves); }
static inline void If_CutCopy( If_Man_t * p, If_Cut_t * pDst, If_Cut_t * pSrc ) { memcpy( pDst, pSrc, p->nCutBytes ); }
static inline void If_CutSetup( If_Man_t * p, If_Cut_t * pCut ) { memset(pCut, 0, p->nCutBytes); pCut->nLimit = p->pPars->nLutSize; }
static inline void If_CutCopy( If_Man_t * p, If_Cut_t * pDst, If_Cut_t * pSrc ) { memcpy( pDst, pSrc, (size_t)p->nCutBytes ); }
static inline void If_CutSetup( If_Man_t * p, If_Cut_t * pCut ) { memset(pCut, 0, (size_t)p->nCutBytes); pCut->nLimit = p->pPars->nLutSize; }
static inline If_Cut_t * If_ObjCutBest( If_Obj_t * pObj ) { return &pObj->CutBest; }
static inline unsigned If_ObjCutSign( unsigned ObjId ) { return (1 << (ObjId % 31)); }

View File

@ -2074,7 +2074,7 @@ int If_DsdManCompute( If_DsdMan_t * p, word * pTruth, int nLeaves, unsigned char
//p->timeDsd += Abc_Clock() - clk;
if ( nSizeNonDec > 0 )
Abc_TtStretch6( pCopy, nSizeNonDec, p->nVars );
memset( pPerm, 0xFF, nLeaves );
memset( pPerm, 0xFF, (size_t)nLeaves );
//clk = Abc_Clock();
iDsd = If_DsdManAddDsd( p, pDsd, pCopy, pPerm, &nSupp );
//p->timeCanon += Abc_Clock() - clk;

View File

@ -1007,7 +1007,7 @@ Map_Cut_t * Map_CutSortCuts( Map_Man_t * pMan, Map_CutTable_t * p, Map_Cut_t * p
assert( nCuts <= MAP_CUTS_MAX_COMPUTE );
// sort the cuts
//clk = Abc_Clock();
qsort( (void *)p->pCuts1, nCuts, sizeof(Map_Cut_t *),
qsort( (void *)p->pCuts1, (size_t)nCuts, sizeof(Map_Cut_t *),
(int (*)(const void *, const void *)) Map_CutSortCutsCompare );
//pMan->time2 += Abc_Clock() - clk;
// move them back into the list

View File

@ -328,7 +328,7 @@ void Map_SuperTableSortSupergates( Map_HashTable_t * p, int nSupersMax )
ppSupers[nSupers++] = pSuper;
// sort by usage
qsort( (void *)ppSupers, nSupers, sizeof(Map_Super_t *),
qsort( (void *)ppSupers, (size_t)nSupers, sizeof(Map_Super_t *),
(int (*)(const void *, const void *)) Map_SuperTableCompareSupergates );
assert( Map_SuperTableCompareSupergates( ppSupers, ppSupers + nSupers - 1 ) <= 0 );
@ -383,7 +383,7 @@ void Map_SuperTableSortSupergatesByDelay( Map_HashTable_t * p, int nSupersMax )
if ( nSupers == 0 )
continue;
// sort the gates by delay
qsort( (void *)ppSupers, nSupers, sizeof(Map_Super_t *),
qsort( (void *)ppSupers, (size_t)nSupers, sizeof(Map_Super_t *),
(int (*)(const void *, const void *)) Map_SuperTableCompareGatesInList );
assert( Map_SuperTableCompareGatesInList( ppSupers, ppSupers + nSupers - 1 ) <= 0 );
// link them in the reverse order

View File

@ -543,7 +543,7 @@ int Map_CompareNodesByLevel( Map_Node_t ** ppS1, Map_Node_t ** ppS2 )
***********************************************************************/
void Map_MappingSortByLevel( Map_Man_t * pMan, Map_NodeVec_t * vNodes )
{
qsort( (void *)vNodes->pArray, vNodes->nSize, sizeof(Map_Node_t *),
qsort( (void *)vNodes->pArray, (size_t)vNodes->nSize, sizeof(Map_Node_t *),
(int (*)(const void *, const void *)) Map_CompareNodesByLevel );
// assert( Map_CompareNodesByLevel( vNodes->pArray, vNodes->pArray + vNodes->nSize - 1 ) <= 0 );
}

View File

@ -306,7 +306,7 @@ Map_Node_t * Map_NodeVecReadEntry( Map_NodeVec_t * p, int i )
***********************************************************************/
void Map_NodeVecSortByLevel( Map_NodeVec_t * p )
{
qsort( (void *)p->pArray, p->nSize, sizeof(Map_Node_t *),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(Map_Node_t *),
(int (*)(const void *, const void *)) Map_NodeVecCompareLevels );
}

View File

@ -595,7 +595,7 @@ void Mio_LibrarySortGates( Mio_Library_t * pLib )
pLib->ppGates0 = ABC_ALLOC( Mio_Gate_t *, pLib->nGates );
for ( i = 0; i < pLib->nGates; i++ )
pLib->ppGates0[i] = ppGates[i];
qsort( (void *)ppGates, pLib->nGates, sizeof(void *),
qsort( (void *)ppGates, (size_t)pLib->nGates, sizeof(void *),
(int (*)(const void *, const void *)) Mio_LibraryCompareGatesByName );
for ( i = 0; i < pLib->nGates; i++ )
ppGates[i]->pNext = (i < pLib->nGates-1)? ppGates[i+1] : NULL;

View File

@ -462,7 +462,7 @@ Mio_Gate_t ** Mio_CollectRoots( Mio_Library_t * pLib, int nInputs, float tDelay,
// sort by delay
if ( iGate > 0 )
{
qsort( (void *)ppGates, iGate, sizeof(Mio_Gate_t *),
qsort( (void *)ppGates, (size_t)iGate, sizeof(Mio_Gate_t *),
(int (*)(const void *, const void *)) Mio_DelayCompare );
assert( Mio_DelayCompare( ppGates, ppGates + iGate - 1 ) <= 0 );
}
@ -572,7 +572,7 @@ Mio_Cell_t * Mio_CollectRootsNew( Mio_Library_t * pLib, int nInputs, int * pnGat
// sort by delay
if ( iCell > 5 )
{
qsort( (void *)(ppCells + 4), iCell - 4, sizeof(Mio_Cell_t),
qsort( (void *)(ppCells + 4), (size_t)(iCell - 4), sizeof(Mio_Cell_t),
(int (*)(const void *, const void *)) Mio_AreaCompare );
assert( Mio_AreaCompare( ppCells + 4, ppCells + iCell - 1 ) <= 0 );
}
@ -729,7 +729,7 @@ Mio_Cell2_t * Mio_CollectRootsNew2( Mio_Library_t * pLib, int nInputs, int * pnG
// sort by delay
if ( iCell > 5 )
{
qsort( (void *)(ppCells + 4), iCell - 4, sizeof(Mio_Cell2_t),
qsort( (void *)(ppCells + 4), (size_t)(iCell - 4), sizeof(Mio_Cell2_t),
(int (*)(const void *, const void *)) Mio_AreaCompare2 );
assert( Mio_AreaCompare2( ppCells + 4, ppCells + iCell - 1 ) <= 0 );
}
@ -818,7 +818,7 @@ int Mio_CollectRootsNewDefault3( int nInputs, Vec_Ptr_t ** pvNames, Vec_Wrd_t **
pTruth[1] = pTruth[3] = pGate0->pTruth[1];
}
else if ( pGate0->nInputs == 8 )
memcpy( pTruth, pGate0->pTruth, 4*sizeof(word) );
memcpy( pTruth, pGate0->pTruth, (size_t)(4*sizeof(word)) );
}
assert( iGate == nGates );
assert( Vec_WrdEntry(*pvTruths, 0) == 0 );

View File

@ -292,7 +292,7 @@ void Abc_SclLinkCells( SC_Lib * p )
Vec_PtrClear( vList );
SC_RingForEachCell( pRepr, pCell, i )
Vec_PtrPush( vList, pCell );
qsort( (void *)Vec_PtrArray(vList), Vec_PtrSize(vList), sizeof(void *), (int(*)(const void *,const void *))Abc_SclCompareCells );
qsort( (void *)Vec_PtrArray(vList), (size_t)Vec_PtrSize(vList), sizeof(void *), (int(*)(const void *,const void *))Abc_SclCompareCells );
// create new representative
pRepr = (SC_Cell *)Vec_PtrEntry( vList, 0 );
pRepr->pNext = pRepr->pPrev = pRepr;

View File

@ -475,7 +475,7 @@ clk = Abc_Clock();
// sort the supergates by truth table
s_uMaskBit = pLib->uMaskBit;
s_uMaskAll = SUPER_MASK(pLib->nMints);
qsort( (void *)pLib->pGates, pLib->nGates, sizeof(Super2_Gate_t *),
qsort( (void *)pLib->pGates, (size_t)pLib->nGates, sizeof(Super2_Gate_t *),
(int (*)(const void *, const void *)) Super2_LibCompareGates );
assert( Super2_LibCompareGates( pLib->pGates, pLib->pGates + pLib->nGates - 1 ) < 0 );
ABC_PRT( "Sorting", Abc_Clock() - clk );

View File

@ -368,7 +368,7 @@ Super_Man_t * Super_Compute( Super_Man_t * pMan, Mio_Gate_t ** ppGates, int nGat
printf( "Sorting array of %d supergates...\r", pMan->nGates );
fflush( stdout );
}
qsort( (void *)pMan->pGates, pMan->nGates, sizeof(Super_Gate_t *),
qsort( (void *)pMan->pGates, (size_t)pMan->nGates, sizeof(Super_Gate_t *),
(int (*)(const void *, const void *)) Super_DelayCompare );
assert( Super_DelayCompare( pMan->pGates, pMan->pGates + pMan->nGates - 1 ) <= 0 );
if ( pMan->nGates > 10000 )
@ -424,7 +424,7 @@ Super_Man_t * Super_Compute( Super_Man_t * pMan, Mio_Gate_t ** ppGates, int nGat
// all the gates beyond this point can be skipped because their area can be only larger
if ( nGatesLimit > 10000 )
printf( "Sorting array of %d supergates...\r", nGatesLimit );
qsort( (void *)ppGatesLimit, nGatesLimit, sizeof(Super_Gate_t *),
qsort( (void *)ppGatesLimit, (size_t)nGatesLimit, sizeof(Super_Gate_t *),
(int (*)(const void *, const void *)) Super_AreaCompare );
assert( Super_AreaCompare( ppGatesLimit, ppGatesLimit + nGatesLimit - 1 ) <= 0 );
if ( nGatesLimit > 10000 )
@ -1021,7 +1021,7 @@ Vec_Str_t * Super_Write( Super_Man_t * pMan )
clk = Abc_Clock();
// sort the supergates by truth table
qsort( (void *)pMan->pGates, pMan->nGates, sizeof(Super_Gate_t *),
qsort( (void *)pMan->pGates, (size_t)pMan->nGates, sizeof(Super_Gate_t *),
(int (*)(const void *, const void *)) Super_WriteCompare );
assert( Super_WriteCompare( pMan->pGates, pMan->pGates + pMan->nGates - 1 ) <= 0 );
if ( pMan->fVerbose )

View File

@ -844,7 +844,7 @@ void Bbl_ManSortCubes( char ** pCubes, int nCubes, int nVars )
{
best_i = i;
for (j = i+1; j < nCubes; j++)
if ( memcmp( pCubes[j], pCubes[best_i], nVars ) < 0 )
if ( memcmp( pCubes[j], pCubes[best_i], (size_t)nVars ) < 0 )
best_i = j;
pTemp = pCubes[i]; pCubes[i] = pCubes[best_i]; pCubes[best_i] = pTemp;
}
@ -871,7 +871,7 @@ char * Bbl_ManSortSop( char * pSop, int nVars )
if ( nCubes < 2 )
{
pSopNew = BBLIF_ALLOC( char, Length + 1 );
memcpy( pSopNew, pSop, Length + 1 );
memcpy( pSopNew, pSop, (size_t)(Length + 1) );
return pSopNew;
}
pCubes = BBLIF_ALLOC( char *, nCubes );
@ -881,7 +881,7 @@ char * Bbl_ManSortSop( char * pSop, int nVars )
Bbl_ManSortCubes( pCubes, nCubes, nVars );
pSopNew = BBLIF_ALLOC( char, Length + 1 );
for ( c = 0; c < nCubes; c++ )
memcpy( pSopNew + c * (nVars + 3), pCubes[c], nVars + 3 );
memcpy( pSopNew + c * (nVars + 3), pCubes[c], (size_t)(nVars + 3) );
BBLIF_FREE( pCubes );
pSopNew[nCubes * (nVars + 3)] = 0;
return pSopNew;
@ -933,7 +933,7 @@ int Bbl_ManSopCheckUnique( Bbl_Man_t * p, char * pSop, int nVars, int nCubes, in
pEnt = Bbl_VecEnt( p->pEnts, h );
pFnc = Bbl_VecFnc( p->pFncs, pEnt->iFunc );
assert( nVars == 16 || nCubes == 16 || pFnc->nWords == nWords );
if ( pFnc->nWords == nWords && memcmp( pFnc->pWords, pSop, Length ) == 0 )
if ( pFnc->nWords == nWords && memcmp( pFnc->pWords, pSop, (size_t)Length ) == 0 )
return pEnt->iFunc;
}
p->SopMap[nVars][nCubes] = Bbl_ManCreateEntry( p, iFunc, p->SopMap[nVars][nCubes] );

View File

@ -372,7 +372,7 @@ pcube *T;
(void) set_copy(cube.temp[0], T[0]); /* retrieve cofactor */
ncubes = CUBELISTSIZE(T);
qsort((char *) (T+2), ncubes, sizeof(pset), (int (*)()) d1_order);
qsort((char *) (T+2), (size_t)ncubes, sizeof(pset), (int (*)()) d1_order);
Tdest = T+2;
/* *Tdest++ = T[2]; */

View File

@ -200,8 +200,8 @@ int lifting; /* whether to perform lifting or not */
/* Sort the arrays for a distance-1 merge */
(void) set_copy(cube.temp[0], cube.var_mask[var]);
qsort((char *) (L1 = sf_list(L)), L->count, sizeof(pset), (int (*)()) d1_order);
qsort((char *) (R1 = sf_list(R)), R->count, sizeof(pset), (int (*)()) d1_order);
qsort((char *) (L1 = sf_list(L)), (size_t)L->count, sizeof(pset), (int (*)()) d1_order);
qsort((char *) (R1 = sf_list(R)), (size_t)R->count, sizeof(pset), (int (*)()) d1_order);
/* Perform distance-1 merge */
compl_d1merge(L1, R1);

View File

@ -342,7 +342,7 @@ IN int (*compare)();
*pdest = NULL; /* Sentinel -- never seen by sort */
/* Sort cubes by size */
qsort((char *) A1, A->count, sizeof(pset), compare);
qsort((char *) A1, (size_t)A->count, sizeof(pset), compare);
return A1;
}

View File

@ -161,7 +161,7 @@ int (*compare)();
FREE(count);
/* use qsort to sort the array */
qsort((char *) (F1 = sf_list(F)), F->count, sizeof(pcube), compare);
qsort((char *) (F1 = sf_list(F)), (size_t)F->count, sizeof(pcube), compare);
F_sorted = sf_unlist(F1, F->count, F->sf_size);
free_cover(F);
@ -189,7 +189,7 @@ IN pcover T;
foreach_set(T, last, p)
PUTSIZE(p, ((n - cdist(largest,p)) << 7) + MIN(set_ord(p),127));
qsort((char *) (T1 = sf_list(T)), T->count, sizeof(pcube), (int (*)()) descend);
qsort((char *) (T1 = sf_list(T)), (size_t)T->count, sizeof(pcube), (int (*)()) descend);
T_sorted = sf_unlist(T1, T->count, T->sf_size);
free_cover(T);

View File

@ -808,7 +808,7 @@ void Extra_FileSort( char * pFileName, char * pFileNameOut )
Begin = i + 1;
}
// sort the lines
qsort( pLines, nLines, sizeof(char *), (int(*)(const void *,const void *))Extra_StringCompare );
qsort( pLines, (size_t)nLines, sizeof(char *), (int(*)(const void *,const void *))Extra_StringCompare );
// write a new file
pFile = fopen( pFileNameOut, "wb" );
for ( i = 0; i < nLines; i++ )

View File

@ -2493,7 +2493,7 @@ void Extra_NpnTest()
// read functions
pFuncs = Extra_NpnRead( "C:\\_projects\\abc\\_TEST\\allan\\lib6var5M.txt", nFuncs );
// pFuncs = Extra_NpnRead( "C:\\_projects\\abc\\_TEST\\allan\\lib6var5M_out_Total_minimal.txt", nFuncs );
qsort( (void *)pFuncs, nFuncs, sizeof(word), (int(*)(const void *,const void *))CompareWords );
qsort( (void *)pFuncs, (size_t)nFuncs, sizeof(word), (int(*)(const void *,const void *))CompareWords );
// count unique
k = 1;
@ -2517,7 +2517,7 @@ void Extra_NpnTest()
printf( "Finished deriving minimum form\n" );
/*
// sort them by value
qsort( (void *)pFuncs, nFuncs, sizeof(word), (int(*)(const void *,const void *))CompareWords );
qsort( (void *)pFuncs, (size_t)nFuncs, sizeof(word), (int(*)(const void *,const void *))CompareWords );
// count unique
nUnique = nFuncs;
for ( i = 1; i < nFuncs; i++ )

View File

@ -369,7 +369,7 @@ void Extra_FileReaderReload( Extra_FileReader_t * p )
// figure out how many chars are still not processed
nCharsUsed = p->pBufferEnd - p->pBufferCur;
// move the remaining data to the beginning of the buffer
memmove( p->pBuffer, p->pBufferCur, nCharsUsed );
memmove( p->pBuffer, p->pBufferCur, (size_t)nCharsUsed );
p->pBufferCur = p->pBuffer;
// determine how many chars we will read
nCharsToRead = EXTRA_MINIMUM( p->nBufferSize - nCharsUsed, p->nFileSize - p->nFileRead );

View File

@ -256,13 +256,13 @@ typedef ABC_INT64_T iword;
#define ABC_PRMn(a,f) (Abc_Print(1, "%s =", (a)), Abc_Print(1, "%10.3f MB ", 1.0*(f)/(1<<20)))
#define ABC_PRMP(a,f,F) (Abc_Print(1, "%s =", (a)), Abc_Print(1, "%10.3f MB (%6.2f %%)\n", (1.0*(f)/(1<<20)), ((F)? 100.0*(f)/(F) : 0.0) ) )
#define ABC_ALLOC(type, num) ((type *) malloc(sizeof(type) * (num)))
#define ABC_CALLOC(type, num) ((type *) calloc((num), sizeof(type)))
#define ABC_FALLOC(type, num) ((type *) memset(malloc(sizeof(type) * (num)), 0xff, sizeof(type) * (num)))
#define ABC_ALLOC(type, num) ((type *) malloc(sizeof(type) * (size_t)(num)))
#define ABC_CALLOC(type, num) ((type *) calloc((size_t)(num), sizeof(type)))
#define ABC_FALLOC(type, num) ((type *) memset(malloc(sizeof(type) * (size_t)(num)), 0xff, sizeof(type) * (size_t)(num)))
#define ABC_FREE(obj) ((obj) ? (free((char *) (obj)), (obj) = 0) : 0)
#define ABC_REALLOC(type, obj, num) \
((obj) ? ((type *) realloc((char *)(obj), sizeof(type) * (num))) : \
((type *) malloc(sizeof(type) * (num))))
((obj) ? ((type *) realloc((char *)(obj), sizeof(type) * (size_t)(num))) : \
((type *) malloc(sizeof(type) * (size_t)(num))))
static inline int Abc_AbsInt( int a ) { return a < 0 ? -a : a; }
static inline int Abc_MaxInt( int a, int b ) { return a > b ? a : b; }

View File

@ -153,7 +153,7 @@ static void Vec_MemSort( Vec_Mem_t * p, int (*Vec_MemSortCompare)() )
{
if ( p->nSize < 2 )
return;
qsort( (void *)p->pArray, p->nSize, sizeof(void *),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(void *),
(int (*)(const void *, const void *)) Vec_MemSortCompare );
}

View File

@ -434,7 +434,7 @@ void Abc_SortTest()
else
{
clk = Abc_Clock();
qsort( (void *)pArray, nSize, sizeof(int), (int (*)(const void *, const void *)) Abc_SortNumCompare );
qsort( (void *)pArray, (size_t)nSize, sizeof(int), (int (*)(const void *, const void *)) Abc_SortNumCompare );
Abc_PrintTime( 1, "Old sort", Abc_Clock() - clk );
// check
for ( i = 1; i < nSize; i++ )
@ -479,14 +479,14 @@ void Abc_QuickSort1( word * pData, int nSize, int fDecrease )
int i, fVerify = 0;
if ( fDecrease )
{
qsort( (void *)pData, nSize, sizeof(word), (int (*)(const void *, const void *))Abc_QuickSort1CompareDec );
qsort( (void *)pData, (size_t)nSize, sizeof(word), (int (*)(const void *, const void *))Abc_QuickSort1CompareDec );
if ( fVerify )
for ( i = 1; i < nSize; i++ )
assert( (unsigned)pData[i-1] >= (unsigned)pData[i] );
}
else
{
qsort( (void *)pData, nSize, sizeof(word), (int (*)(const void *, const void *))Abc_QuickSort1CompareInc );
qsort( (void *)pData, (size_t)nSize, sizeof(word), (int (*)(const void *, const void *))Abc_QuickSort1CompareInc );
if ( fVerify )
for ( i = 1; i < nSize; i++ )
assert( (unsigned)pData[i-1] <= (unsigned)pData[i] );

View File

@ -807,10 +807,10 @@ static int Vec_FltSortCompare2( float * pp1, float * pp2 )
static inline void Vec_FltSort( Vec_Flt_t * p, int fReverse )
{
if ( fReverse )
qsort( (void *)p->pArray, p->nSize, sizeof(float),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(float),
(int (*)(const void *, const void *)) Vec_FltSortCompare2 );
else
qsort( (void *)p->pArray, p->nSize, sizeof(float),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(float),
(int (*)(const void *, const void *)) Vec_FltSortCompare1 );
}

View File

@ -1381,20 +1381,20 @@ static int Vec_IntSortCompare2( int * pp1, int * pp2 )
static inline void Vec_IntSort( Vec_Int_t * p, int fReverse )
{
if ( fReverse )
qsort( (void *)p->pArray, p->nSize, sizeof(int),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(int),
(int (*)(const void *, const void *)) Vec_IntSortCompare2 );
else
qsort( (void *)p->pArray, p->nSize, sizeof(int),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(int),
(int (*)(const void *, const void *)) Vec_IntSortCompare1 );
}
static inline void Vec_IntSortMulti( Vec_Int_t * p, int nMulti, int fReverse )
{
assert( Vec_IntSize(p) % nMulti == 0 );
if ( fReverse )
qsort( (void *)p->pArray, p->nSize/nMulti, nMulti*sizeof(int),
qsort( (void *)p->pArray, (size_t)(p->nSize/nMulti), nMulti*sizeof(int),
(int (*)(const void *, const void *)) Vec_IntSortCompare2 );
else
qsort( (void *)p->pArray, p->nSize/nMulti, nMulti*sizeof(int),
qsort( (void *)p->pArray, (size_t)(p->nSize/nMulti), nMulti*sizeof(int),
(int (*)(const void *, const void *)) Vec_IntSortCompare1 );
}
@ -1638,7 +1638,7 @@ static inline int Vec_IntSortCompareUnsigned( unsigned * pp1, unsigned * pp2 )
***********************************************************************/
static inline void Vec_IntSortUnsigned( Vec_Int_t * p )
{
qsort( (void *)p->pArray, p->nSize, sizeof(int),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(int),
(int (*)(const void *, const void *)) Vec_IntSortCompareUnsigned );
}

View File

@ -910,10 +910,10 @@ static void Vec_PtrSort( Vec_Ptr_t * p, int (*Vec_PtrSortCompare)() )
if ( p->nSize < 2 )
return;
if ( Vec_PtrSortCompare == NULL )
qsort( (void *)p->pArray, p->nSize, sizeof(void *),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(void *),
(int (*)(const void *, const void *)) Vec_PtrSortComparePtr );
else
qsort( (void *)p->pArray, p->nSize, sizeof(void *),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(void *),
(int (*)(const void *, const void *)) Vec_PtrSortCompare );
}
@ -1067,7 +1067,7 @@ static inline void Vec_PtrDoubleSimInfo( Vec_Ptr_t * vInfo )
nWords = (unsigned *)Vec_PtrEntry(vInfo,1) - (unsigned *)Vec_PtrEntry(vInfo,0);
vInfoNew = Vec_PtrAllocSimInfo( 2*Vec_PtrSize(vInfo), nWords );
// copy the simulation info
memcpy( Vec_PtrEntry(vInfoNew,0), Vec_PtrEntry(vInfo,0), Vec_PtrSize(vInfo) * nWords * 4 );
memcpy( Vec_PtrEntry(vInfoNew,0), Vec_PtrEntry(vInfo,0), (size_t)(Vec_PtrSize(vInfo) * nWords * 4) );
// replace the array
ABC_FREE( vInfo->pArray );
vInfo->pArray = vInfoNew->pArray;
@ -1099,7 +1099,7 @@ static inline void Vec_PtrReallocSimInfo( Vec_Ptr_t * vInfo )
vInfoNew = Vec_PtrAllocSimInfo( Vec_PtrSize(vInfo), 2*nWords );
// copy the simulation info
for ( i = 0; i < vInfo->nSize; i++ )
memcpy( Vec_PtrEntry(vInfoNew,i), Vec_PtrEntry(vInfo,i), nWords * 4 );
memcpy( Vec_PtrEntry(vInfoNew,i), Vec_PtrEntry(vInfo,i), (size_t)(nWords * 4) );
// replace the array
ABC_FREE( vInfo->pArray );
vInfo->pArray = vInfoNew->pArray;

View File

@ -565,7 +565,7 @@ static inline void Vec_StrPushBuffer( Vec_Str_t * p, char * pBuffer, int nSize )
{
if ( p->nSize + nSize > p->nCap )
Vec_StrGrow( p, 2 * (p->nSize + nSize) );
memcpy( p->pArray + p->nSize, pBuffer, nSize );
memcpy( p->pArray + p->nSize, pBuffer, (size_t)nSize );
p->nSize += nSize;
}
@ -916,10 +916,10 @@ static int Vec_StrSortCompare2( char * pp1, char * pp2 )
static inline void Vec_StrSort( Vec_Str_t * p, int fReverse )
{
if ( fReverse )
qsort( (void *)p->pArray, p->nSize, sizeof(char),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(char),
(int (*)(const void *, const void *)) Vec_StrSortCompare2 );
else
qsort( (void *)p->pArray, p->nSize, sizeof(char),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(char),
(int (*)(const void *, const void *)) Vec_StrSortCompare1 );
}
@ -940,7 +940,7 @@ static inline int Vec_StrCompareVec( Vec_Str_t * p1, Vec_Str_t * p2 )
return (p1 != NULL) - (p2 != NULL);
if ( Vec_StrSize(p1) != Vec_StrSize(p2) )
return Vec_StrSize(p1) - Vec_StrSize(p2);
return memcmp( Vec_StrArray(p1), Vec_StrArray(p2), Vec_StrSize(p1) );
return memcmp( Vec_StrArray(p1), Vec_StrArray(p2), (size_t)Vec_StrSize(p1) );
}

View File

@ -554,10 +554,10 @@ static int Vec_VecSortCompare2( Vec_Ptr_t ** pp1, Vec_Ptr_t ** pp2 )
static inline void Vec_VecSort( Vec_Vec_t * p, int fReverse )
{
if ( fReverse )
qsort( (void *)p->pArray, p->nSize, sizeof(void *),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(void *),
(int (*)(const void *, const void *)) Vec_VecSortCompare2 );
else
qsort( (void *)p->pArray, p->nSize, sizeof(void *),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(void *),
(int (*)(const void *, const void *)) Vec_VecSortCompare1 );
}
@ -603,10 +603,10 @@ static int Vec_VecSortCompare4( Vec_Int_t ** pp1, Vec_Int_t ** pp2 )
static inline void Vec_VecSortByFirstInt( Vec_Vec_t * p, int fReverse )
{
if ( fReverse )
qsort( (void *)p->pArray, p->nSize, sizeof(void *),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(void *),
(int (*)(const void *, const void *)) Vec_VecSortCompare4 );
else
qsort( (void *)p->pArray, p->nSize, sizeof(void *),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(void *),
(int (*)(const void *, const void *)) Vec_VecSortCompare3 );
}

View File

@ -454,10 +454,10 @@ static int Vec_WecSortCompare2( Vec_Int_t * p1, Vec_Int_t * p2 )
static inline void Vec_WecSort( Vec_Wec_t * p, int fReverse )
{
if ( fReverse )
qsort( (void *)p->pArray, p->nSize, sizeof(Vec_Int_t),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(Vec_Int_t),
(int (*)(const void *, const void *)) Vec_WecSortCompare2 );
else
qsort( (void *)p->pArray, p->nSize, sizeof(Vec_Int_t),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(Vec_Int_t),
(int (*)(const void *, const void *)) Vec_WecSortCompare1 );
}
@ -492,10 +492,10 @@ static int Vec_WecSortCompare4( Vec_Int_t * p1, Vec_Int_t * p2 )
static inline void Vec_WecSortByFirstInt( Vec_Wec_t * p, int fReverse )
{
if ( fReverse )
qsort( (void *)p->pArray, p->nSize, sizeof(Vec_Int_t),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(Vec_Int_t),
(int (*)(const void *, const void *)) Vec_WecSortCompare4 );
else
qsort( (void *)p->pArray, p->nSize, sizeof(Vec_Int_t),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(Vec_Int_t),
(int (*)(const void *, const void *)) Vec_WecSortCompare3 );
}
@ -529,10 +529,10 @@ static int Vec_WecSortCompare6( Vec_Int_t * p1, Vec_Int_t * p2 )
static inline void Vec_WecSortByLastInt( Vec_Wec_t * p, int fReverse )
{
if ( fReverse )
qsort( (void *)p->pArray, p->nSize, sizeof(Vec_Int_t),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(Vec_Int_t),
(int (*)(const void *, const void *)) Vec_WecSortCompare6 );
else
qsort( (void *)p->pArray, p->nSize, sizeof(Vec_Int_t),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(Vec_Int_t),
(int (*)(const void *, const void *)) Vec_WecSortCompare5 );
}

View File

@ -1084,10 +1084,10 @@ static int Vec_WrdSortCompare2( word * pp1, word * pp2 )
static inline void Vec_WrdSort( Vec_Wrd_t * p, int fReverse )
{
if ( fReverse )
qsort( (void *)p->pArray, p->nSize, sizeof(word),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(word),
(int (*)(const void *, const void *)) Vec_WrdSortCompare2 );
else
qsort( (void *)p->pArray, p->nSize, sizeof(word),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(word),
(int (*)(const void *, const void *)) Vec_WrdSortCompare1 );
}
@ -1171,7 +1171,7 @@ static int Vec_WrdSortCompareUnsigned( word * pp1, word * pp2 )
***********************************************************************/
static inline void Vec_WrdSortUnsigned( Vec_Wrd_t * p )
{
qsort( (void *)p->pArray, p->nSize, sizeof(word),
qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(word),
(int (*)(const void *, const void *)) Vec_WrdSortCompareUnsigned );
}

View File

@ -1232,7 +1232,7 @@ local void check_match(deflate_state *s, IPos start, IPos match, int length)
{
/* check that the match is indeed a match */
if (zmemcmp(s->window + match,
s->window + start, length) != EQUAL) {
s->window + start, (size_t)length) != EQUAL) {
fprintf(stderr, " start %u, match %u, length %d\n",
start, match, length);
do {

View File

@ -128,7 +128,7 @@ local int gz_zero(gz_statep state, z_off64_t len)
n = GT_OFF(state->size) || (z_off64_t)state->size > len ?
(unsigned)len : state->size;
if (first) {
memset(state->in, 0, n);
memset(state->in, 0, (size_t)n);
first = 0;
}
strm->avail_in = n;

View File

@ -239,11 +239,11 @@ ABC_NAMESPACE_HEADER_START
# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
# define zmemcpy _fmemcpy
# define zmemcmp _fmemcmp
# define zmemzero(dest, len) _fmemset(dest, 0, len)
# define zmemzero(dest, len) _fmemset(dest, 0, (size_t)len)
# else
# define zmemcpy memcpy
# define zmemcmp memcmp
# define zmemzero(dest, len) memset(dest, 0, len)
# define zmemzero(dest, len) memset(dest, 0, (size_t)len)
# endif
#else
void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));

View File

@ -126,7 +126,7 @@ Cut_Cut_t * Cut_CutDupList( Cut_Man_t * p, Cut_Cut_t * pList )
Cut_ListForEachCut( pList, pTemp )
{
pCopy = (Cut_Cut_t *)Extra_MmFixedEntryFetch( p->pMmCuts );
memcpy( pCopy, pTemp, p->EntrySize );
memcpy( pCopy, pTemp, (size_t)p->EntrySize );
*ppTail = pCopy;
ppTail = &pCopy->pNext;
}

View File

@ -1456,7 +1456,7 @@ unsigned Abc_TtCanonicizeWrap(TtCanonicizeFunc func, Abc_TtHieMan_t * p, word *
if (Abc_TtCompareRev(pTruth, pTruth2, nWords) <= 0)
return uCanonPhase1;
Abc_TtCopy(pTruth, pTruth2, nWords, 0);
memcpy(pCanonPerm, pCanonPerm2, nVars);
memcpy(pCanonPerm, pCanonPerm2, (size_t)nVars);
return uCanonPhase2;
}

View File

@ -237,7 +237,7 @@ void Dau_DsdNormalize_rec( char * pStr, char ** p, int * pMatches )
for ( i = 0; i < nMarks; i++ )
pStore = Dau_DsdNormalizeCopy( pStore, pStr, pMarks, pPerm[i] );
assert( pStore - pBuffer == *p - pOld );
memcpy( pOld, pBuffer, pStore - pBuffer );
memcpy( pOld, pBuffer, (size_t)(pStore - pBuffer) );
return;
}
if ( **p == '<' || **p == '{' ) // mux

View File

@ -524,9 +524,9 @@ word Dua_DsdRangeVars( word * pTruth, int nVars, int iVar, int jVar, int fPerfor
pCof0 = pCof1 = NULL;
for ( Mint = 0; Mint < nMints; Mint++, iWord += nWordsF )
{
if ( !pCof0 || !memcmp(pCof0, pTruth + iWord, nBytes) )
if ( !pCof0 || !memcmp(pCof0, pTruth + iWord, (size_t)nBytes) )
pCof0 = pTruth + iWord;
else if ( !pCof1 || !memcmp(pCof1, pTruth + iWord, nBytes) )
else if ( !pCof1 || !memcmp(pCof1, pTruth + iWord, (size_t)nBytes) )
{
pCof1 = pTruth + iWord;
MaskOne |= ((word)1) << Mint;
@ -541,8 +541,8 @@ word Dua_DsdRangeVars( word * pTruth, int nVars, int iVar, int jVar, int fPerfor
if ( fPerform )
{
assert( pCof0 && pCof1 );
memcpy( pTruth + (2 * Part + 0) * nWordsF, pCof0, nBytes );
memcpy( pTruth + (2 * Part + 1) * nWordsF, pCof1, nBytes );
memcpy( pTruth + (2 * Part + 0) * nWordsF, pCof0, (size_t)nBytes );
memcpy( pTruth + (2 * Part + 1) * nWordsF, pCof1, (size_t)nBytes );
}
}
}

View File

@ -860,7 +860,7 @@ unsigned * Dss_ObjHashLookup( Dss_Man_t * p, int Type, Vec_Int_t * vFaninLits, w
if ( (int)pObj->Type == Type &&
(int)pObj->nFans == Vec_IntSize(vFaninLits) &&
!memcmp(pObj->pFans, Vec_IntArray(vFaninLits), sizeof(int)*pObj->nFans) &&
(pTruth == NULL || !memcmp(Dss_ObjTruth(pObj), pTruth, Abc_TtByteNum(pObj->nFans))) ) // equal
(pTruth == NULL || !memcmp(Dss_ObjTruth(pObj), pTruth, (size_t)Abc_TtByteNum(pObj->nFans))) ) // equal
return pSpot;
}
return pSpot;

View File

@ -152,7 +152,7 @@ Fxu_Matrix * Fxu_CreateMatrix( Fxu_Data_t * pData )
for ( v = 0; v < nFanins; v++ )
pOrder[v] = v;
// reorder the fanins
qsort( (void *)pOrder, nFanins, sizeof(int),(int (*)(const void *, const void *))Fxu_CreateMatrixLitCompare);
qsort( (void *)pOrder, (size_t)nFanins, sizeof(int),(int (*)(const void *, const void *))Fxu_CreateMatrixLitCompare);
assert( s_pLits[ pOrder[0] ] < s_pLits[ pOrder[nFanins-1] ] );
// create the corresponding cubes in the matrix
pCubeFirst = NULL;

View File

@ -588,7 +588,7 @@ void Fxu_UpdatePairsSort( Fxu_Matrix * p, Fxu_Double * pDouble )
if ( p->vPairs->nSize < 2 )
return;
// sort
qsort( (void *)p->vPairs->pArray, p->vPairs->nSize, sizeof(Fxu_Pair *),
qsort( (void *)p->vPairs->pArray, (size_t)p->vPairs->nSize, sizeof(Fxu_Pair *),
(int (*)(const void *, const void *)) Fxu_UpdatePairCompare );
assert( Fxu_UpdatePairCompare( (Fxu_Pair**)p->vPairs->pArray, (Fxu_Pair**)p->vPairs->pArray + p->vPairs->nSize - 1 ) < 0 );
}

View File

@ -314,7 +314,7 @@ void Res_SimSetDerivedBytes( Res_Sim_t * p, int fUseWalk )
if ( i == p->nTruePis )
break;
pInfo = (unsigned char *)Vec_PtrEntry( p->vPats, pObj->Id );
memset( pInfo + nPats, 0, p->nBytesIn - nPats );
memset( pInfo + nPats, 0, (size_t)(p->nBytesIn - nPats) );
}
}
/*

View File

@ -566,7 +566,7 @@ void Rwr_ScoresReport( Rwr_Man_t * p )
Gains[i] += pNode->nGain;
}
// sort the gains
qsort( Perm, 222, sizeof(int), (int (*)(const void *, const void *))Rwr_ScoresCompare );
qsort( Perm, (size_t)222, sizeof(int), (int (*)(const void *, const void *))Rwr_ScoresCompare );
// print classes
for ( i = 0; i < p->vClasses->nSize; i++ )

View File

@ -89,7 +89,7 @@ void Rwr_Temp()
for ( i = 0; i < 13719; i++ )
pPerm[i] = i;
qsort( (void *)pPerm, 13719, sizeof(int),
qsort( (void *)pPerm, (size_t)13719, sizeof(int),
(int (*)(const void *, const void *)) Rwr_TempCompare );

View File

@ -132,7 +132,7 @@ Vec_Wec_t * Sfm_CreateCnf( Sfm_Ntk_t * p )
nCubes = Sfm_TruthToCnf( uTruth, Sfm_ObjFaninNum(p, i), p->vCover, vCnf );
vCnfBase = (Vec_Str_t *)Vec_WecEntry( vCnfs, i );
Vec_StrGrow( vCnfBase, Vec_StrSize(vCnf) );
memcpy( Vec_StrArray(vCnfBase), Vec_StrArray(vCnf), Vec_StrSize(vCnf) );
memcpy( Vec_StrArray(vCnfBase), Vec_StrArray(vCnf), (size_t)Vec_StrSize(vCnf) );
vCnfBase->nSize = Vec_StrSize(vCnf);
}
Vec_StrFree( vCnf );

View File

@ -110,7 +110,7 @@ void Sfm_DecCreateCnf( Vec_Int_t * vGateSizes, Vec_Wrd_t * vGateFuncs, Vec_Wec_t
nCubes = Sfm_TruthToCnf( uTruth, Vec_IntEntry(vGateSizes, i), vCover, vCnf );
vCnfBase = (Vec_Str_t *)Vec_WecEntry( vGateCnfs, i );
Vec_StrGrow( vCnfBase, Vec_StrSize(vCnf) );
memcpy( Vec_StrArray(vCnfBase), Vec_StrArray(vCnf), Vec_StrSize(vCnf) );
memcpy( Vec_StrArray(vCnfBase), Vec_StrArray(vCnf), (size_t)Vec_StrSize(vCnf) );
vCnfBase->nSize = Vec_StrSize(vCnf);
}
Vec_IntFree( vCover );

View File

@ -82,7 +82,7 @@ void spreadDensityX(int numBins, float maxMovement) {
}
// spread X
qsort(allCells, moveableCells, sizeof(ConcreteCell*), cellSortByY);
qsort(allCells, (size_t)moveableCells, sizeof(ConcreteCell*), cellSortByY);
y = 0;
@ -96,7 +96,7 @@ void spreadDensityX(int numBins, float maxMovement) {
// have we filled up a y-bin?
if (yCumArea >= totalArea*(y+1)/numBins && yBinArea > 0) {
memcpy(binCells, &(allCells[yBinStart]), sizeof(ConcreteCell*)*yBinCount);
qsort(binCells, yBinCount, sizeof(ConcreteCell*), cellSortByX);
qsort(binCells, (size_t)yBinCount, sizeof(ConcreteCell*), cellSortByX);
#if defined(DEBUG)
printf("y-bin %d count=%d area=%f\n",y,yBinCount, yBinArea);
@ -217,7 +217,7 @@ void spreadDensityY(int numBins, float maxMovement) {
// have we filled up an x-bin?
if (xCumArea >= totalArea*(x+1)/numBins && xBinArea > 0) {
memcpy(binCells, &(allCells[xBinStart]), sizeof(ConcreteCell*)*xBinCount);
qsort(binCells, xBinCount, sizeof(ConcreteCell*), cellSortByY);
qsort(binCells, (size_t)xBinCount, sizeof(ConcreteCell*), cellSortByY);
// printf("x-bin %d count=%d area=%f\n",y,yBinCount, yBinArea);

View File

@ -107,14 +107,14 @@ void presortNets() {
allNetsR2 = (ConcreteNet**)realloc(allNetsR2, sizeof(ConcreteNet*)*g_place_numNets);
allNetsB2 = (ConcreteNet**)realloc(allNetsB2, sizeof(ConcreteNet*)*g_place_numNets);
allNetsT2 = (ConcreteNet**)realloc(allNetsT2, sizeof(ConcreteNet*)*g_place_numNets);
memcpy(allNetsL2, g_place_concreteNets, sizeof(ConcreteNet*)*g_place_numNets);
memcpy(allNetsR2, g_place_concreteNets, sizeof(ConcreteNet*)*g_place_numNets);
memcpy(allNetsB2, g_place_concreteNets, sizeof(ConcreteNet*)*g_place_numNets);
memcpy(allNetsT2, g_place_concreteNets, sizeof(ConcreteNet*)*g_place_numNets);
qsort(allNetsL2, g_place_numNets, sizeof(ConcreteNet*), netSortByL);
qsort(allNetsR2, g_place_numNets, sizeof(ConcreteNet*), netSortByR);
qsort(allNetsB2, g_place_numNets, sizeof(ConcreteNet*), netSortByB);
qsort(allNetsT2, g_place_numNets, sizeof(ConcreteNet*), netSortByT);
memcpy(allNetsL2, (size_t)g_place_concreteNets, sizeof(ConcreteNet*)*g_place_numNets);
memcpy(allNetsR2, (size_t)g_place_concreteNets, sizeof(ConcreteNet*)*g_place_numNets);
memcpy(allNetsB2, (size_t)g_place_concreteNets, sizeof(ConcreteNet*)*g_place_numNets);
memcpy(allNetsT2, (size_t)g_place_concreteNets, sizeof(ConcreteNet*)*g_place_numNets);
qsort(allNetsL2, (size_t)g_place_numNets, sizeof(ConcreteNet*), netSortByL);
qsort(allNetsR2, (size_t)g_place_numNets, sizeof(ConcreteNet*), netSortByR);
qsort(allNetsB2, (size_t)g_place_numNets, sizeof(ConcreteNet*), netSortByB);
qsort(allNetsT2, (size_t)g_place_numNets, sizeof(ConcreteNet*), netSortByT);
}
// --------------------------------------------------------------------
@ -838,10 +838,10 @@ void partitionEqualArea(Partition *parent) {
// which way to sort?
if (parent->m_vertical)
// sort by X position
qsort(parent->m_members, parent->m_numMembers, sizeof(ConcreteCell*), cellSortByX);
qsort(parent->m_members, (size_t)parent->m_numMembers, sizeof(ConcreteCell*), cellSortByX);
else
// sort by Y position
qsort(parent->m_members, parent->m_numMembers, sizeof(ConcreteCell*), cellSortByY);
qsort(parent->m_members, (size_t)parent->m_numMembers, sizeof(ConcreteCell*), cellSortByY);
// split the list
halfArea = parent->m_area*0.5;
@ -1109,9 +1109,9 @@ void incrementalPartition() {
assert(g_place_rootPartition);
// update cell list of root partition
memcpy(allCells, g_place_concreteCells, sizeof(ConcreteCell*)*g_place_numCells);
qsort(allCells, g_place_numCells, sizeof(ConcreteCell*), cellSortByID);
qsort(g_place_rootPartition->m_members, g_place_rootPartition->m_numMembers,
memcpy(allCells, (size_t)g_place_concreteCells, sizeof(ConcreteCell*)*g_place_numCells);
qsort(allCells, (size_t)g_place_numCells, sizeof(ConcreteCell*), cellSortByID);
qsort(g_place_rootPartition->m_members, (size_t)g_place_rootPartition->m_numMembers,
sizeof(ConcreteCell*), cellSortByID);
// scan sorted lists and collect cells not in partitions

View File

@ -438,10 +438,10 @@ Vec_Int_t * Gia_ManDetectFullAdders( Gia_Man_t * p, int fVerbose, Vec_Int_t ** p
{
Vec_Int_t * vCutsXor, * vCutsMaj, * vFadds;
Dtc_ManComputeCuts( p, pvCutsXor2, &vCutsXor, &vCutsMaj, fVerbose );
qsort( Vec_IntArray(vCutsXor), Vec_IntSize(vCutsXor)/4, 16, (int (*)(const void *, const void *))Dtc_ManCompare );
qsort( Vec_IntArray(vCutsMaj), Vec_IntSize(vCutsMaj)/4, 16, (int (*)(const void *, const void *))Dtc_ManCompare );
qsort( Vec_IntArray(vCutsXor), (size_t)(Vec_IntSize(vCutsXor)/4), 16, (int (*)(const void *, const void *))Dtc_ManCompare );
qsort( Vec_IntArray(vCutsMaj), (size_t)(Vec_IntSize(vCutsMaj)/4), 16, (int (*)(const void *, const void *))Dtc_ManCompare );
vFadds = Dtc_ManFindCommonCuts( p, vCutsXor, vCutsMaj );
qsort( Vec_IntArray(vFadds), Vec_IntSize(vFadds)/5, 20, (int (*)(const void *, const void *))Dtc_ManCompare2 );
qsort( Vec_IntArray(vFadds), (size_t)(Vec_IntSize(vFadds)/5), 20, (int (*)(const void *, const void *))Dtc_ManCompare2 );
if ( fVerbose )
printf( "XOR3 cuts = %d. MAJ cuts = %d. Full-adders = %d.\n", Vec_IntSize(vCutsXor)/4, Vec_IntSize(vCutsMaj)/4, Vec_IntSize(vFadds)/5 );
if ( fVerbose )

View File

@ -361,7 +361,7 @@ Vec_Wec_t * Gia_PolynGetResult( Hsh_VecMan_t * pHashC, Hsh_VecMan_t * pHashM, Ve
Vec_WecForEachLevel( vSorted, vClass, i )
{
// sort monomials by the index of the first variable
qsort( Vec_IntArray(vClass), Vec_IntSize(vClass)/3, 12, (int (*)(const void *, const void *))Gia_PolynGetResultCompare );
qsort( Vec_IntArray(vClass), (size_t)(Vec_IntSize(vClass)/3), 12, (int (*)(const void *, const void *))Gia_PolynGetResultCompare );
Vec_IntForEachEntryTriple( vClass, iConst, iMono, iFirst, k )
{
vArray = Hsh_VecReadEntry( pHashC, iConst );

View File

@ -139,7 +139,7 @@ void Pln_ManPrintFinal( Pln_Man_t * p, int fVerbose, int fVeryVerbose )
Vec_IntPushTwo( vPairs, iConst, iMono );
}
// sort triples
qsort( Vec_IntArray(vPairs), Vec_IntSize(vPairs)/4, 16, (int (*)(const void *, const void *))Pln_ManCompare3 );
qsort( Vec_IntArray(vPairs), (size_t)(Vec_IntSize(vPairs)/4), 16, (int (*)(const void *, const void *))Pln_ManCompare3 );
// print
if ( fVerbose )
Vec_IntForEachEntryDouble( vPairs, iConst, iMono, i )

Some files were not shown because too many files have changed in this diff Show More