diff options
-rw-r--r-- | src/aig/gia/giaAiger.c | 15 | ||||
-rw-r--r-- | src/base/abc/abcHieGia.c | 7 | ||||
-rw-r--r-- | src/misc/util/abc_global.h | 4 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/aig/gia/giaAiger.c b/src/aig/gia/giaAiger.c index 645f0585..1f6ba03b 100644 --- a/src/aig/gia/giaAiger.c +++ b/src/aig/gia/giaAiger.c @@ -655,11 +655,12 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS // read register classes else if ( *pCur == 'r' ) { - int nRegs; + int i, nRegs; pCur++; - nRegs = Gia_AigerReadInt(pCur); pCur += 4; - pNew->vRegClasses = Vec_IntStart( nRegs ); - memcpy(Vec_IntArray(pNew->vRegClasses), pCur, 4*nRegs); pCur += 4*nRegs; + nRegs = Gia_AigerReadInt(pCur)/4; pCur += 4; + pNew->vRegClasses = Vec_IntAlloc( nRegs ); + for ( i = 0; i < nRegs; i++ ) + Vec_IntPush( pNew->vRegClasses, Gia_AigerReadInt(pCur) ), pCur += 4; if ( fVerbose ) printf( "Finished reading extension \"r\".\n" ); } // read choices @@ -1252,9 +1253,11 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int // write register classes if ( p->vRegClasses ) { + int i; fprintf( pFile, "r" ); - Gia_FileWriteBufferSize( pFile, Vec_IntSize(p->vRegClasses) ); - fwrite( Vec_IntArray(p->vRegClasses), 1, 4*Vec_IntSize(p->vRegClasses), pFile ); + Gia_FileWriteBufferSize( pFile, 4*Vec_IntSize(p->vRegClasses) ); + for ( i = 0; i < Vec_IntSize(p->vRegClasses); i++ ) + Gia_FileWriteBufferSize( pFile, Vec_IntEntry(p->vRegClasses, i) ); } // write choices if ( Gia_ManHasChoices(p) ) diff --git a/src/base/abc/abcHieGia.c b/src/base/abc/abcHieGia.c index cffa95ba..930bfd2a 100644 --- a/src/base/abc/abcHieGia.c +++ b/src/base/abc/abcHieGia.c @@ -332,13 +332,6 @@ box = array containing model name, instance name, followed by pairs of formal */ -static inline int Abc_Ptr2Int( void * p ) { return (int)(ABC_PTRINT_T)p; } -static inline void * Abc_Int2Ptr( int i ) { return (void *)(ABC_PTRINT_T)i; } - -static inline word Abc_Ptr2Wrd( void * p ) { return (word)(ABC_PTRUINT_T)p; } -static inline void * Abc_Wrd2Ptr( word i ) { return (void *)(ABC_PTRUINT_T)i; } - - /**Function************************************************************* Synopsis [Node type conversions.] diff --git a/src/misc/util/abc_global.h b/src/misc/util/abc_global.h index b2b6ec91..b798961e 100644 --- a/src/misc/util/abc_global.h +++ b/src/misc/util/abc_global.h @@ -269,6 +269,10 @@ static inline int Abc_LitRegular( int Lit ) { return Lit & ~01 static inline int Abc_Lit2LitV( int * pMap, int Lit ) { return Abc_Var2Lit( pMap[Abc_Lit2Var(Lit)], Abc_LitIsCompl(Lit) ); } static inline int Abc_Lit2LitL( int * pMap, int Lit ) { return Abc_LitNotCond( pMap[Abc_Lit2Var(Lit)], Abc_LitIsCompl(Lit) ); } +static inline int Abc_Ptr2Int( void * p ) { return (int)(ABC_PTRINT_T)p; } +static inline void * Abc_Int2Ptr( int i ) { return (void *)(ABC_PTRINT_T)i; } +static inline word Abc_Ptr2Wrd( void * p ) { return (word)(ABC_PTRUINT_T)p; } +static inline void * Abc_Wrd2Ptr( word i ) { return (void *)(ABC_PTRUINT_T)i; } // time counting typedef ABC_INT64_T abctime; |