Commit 85ea8e95 by Alan Mishchenko

Fixing the way packing information is written.

parent 30cfee7d
...@@ -301,17 +301,20 @@ Vec_Str_t * Gia_AigerWriteMappingDoc( Gia_Man_t * p ) ...@@ -301,17 +301,20 @@ Vec_Str_t * Gia_AigerWriteMappingDoc( Gia_Man_t * p )
***********************************************************************/ ***********************************************************************/
Vec_Int_t * Gia_AigerReadPacking( unsigned char ** ppPos, int nSize ) Vec_Int_t * Gia_AigerReadPacking( unsigned char ** ppPos, int nSize )
{ {
Vec_Int_t * vPacking = Vec_IntStart( nSize/4 ); Vec_Int_t * vPacking = Vec_IntAlloc( nSize/4 );
int i;
assert( nSize % 4 == 0 ); assert( nSize % 4 == 0 );
memcpy( Vec_IntArray(vPacking), *ppPos, nSize ); for ( i = 0; i < nSize/4; i++, *ppPos += 4 )
*ppPos += nSize; Vec_IntPush( vPacking, Gia_AigerReadInt( *ppPos ) );
return vPacking; return vPacking;
} }
Vec_Str_t * Gia_WritePacking( Vec_Int_t * vPacking ) Vec_Str_t * Gia_WritePacking( Vec_Int_t * vPacking )
{ {
Vec_Str_t * vBuffer = Vec_StrStart( 4*Vec_IntSize(vPacking) ); unsigned char * pBuffer = ABC_ALLOC( unsigned char, 4*Vec_IntSize(vPacking) );
memcpy( Vec_StrArray(vBuffer), Vec_IntArray(vPacking), 4*Vec_IntSize(vPacking) ); int i, Entry, nSize = 0;
return vBuffer; Vec_IntForEachEntry( vPacking, Entry, i )
Gia_AigerWriteInt( pBuffer + 4 * nSize++, Entry );
return Vec_StrAllocArray( (char *)pBuffer, 4*Vec_IntSize(vPacking) );
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment