From 01569b8f5f2394c534c3aba7276caf22493fce82 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Tue, 5 Mar 2019 15:57:50 -0800 Subject: Fixing some warnings by adding cast from 'int' to 'size_t' in memset, memcpy, etc. --- src/opt/dau/dauCanon.c | 2 +- src/opt/dau/dauDsd.c | 2 +- src/opt/dau/dauDsd2.c | 8 ++++---- src/opt/dau/dauTree.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/opt/dau') diff --git a/src/opt/dau/dauCanon.c b/src/opt/dau/dauCanon.c index ce0d1857..739dd373 100644 --- a/src/opt/dau/dauCanon.c +++ b/src/opt/dau/dauCanon.c @@ -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; } diff --git a/src/opt/dau/dauDsd.c b/src/opt/dau/dauDsd.c index 8469da4b..b1e7e0d8 100644 --- a/src/opt/dau/dauDsd.c +++ b/src/opt/dau/dauDsd.c @@ -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 diff --git a/src/opt/dau/dauDsd2.c b/src/opt/dau/dauDsd2.c index cf7dea0b..69c91a09 100644 --- a/src/opt/dau/dauDsd2.c +++ b/src/opt/dau/dauDsd2.c @@ -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 ); } } } diff --git a/src/opt/dau/dauTree.c b/src/opt/dau/dauTree.c index f8508d53..81bd51bc 100644 --- a/src/opt/dau/dauTree.c +++ b/src/opt/dau/dauTree.c @@ -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; -- cgit v1.2.3