diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-06-04 09:12:01 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-06-04 09:12:01 -0700 |
commit | ab1e4ed7f1570adfab8807d743328166f1df52f9 (patch) | |
tree | 90ce98491bf4398b6a5ee3a36dd8acf4590b9c58 /src/base | |
parent | 802377ed4e76de8074ec072506b01f9eadf7ee1f (diff) | |
parent | 5c0c8e1ae2e6e6a1f23684b699d2bcdb6730edb6 (diff) | |
download | abc-ab1e4ed7f1570adfab8807d743328166f1df52f9.tar.gz abc-ab1e4ed7f1570adfab8807d743328166f1df52f9.tar.bz2 abc-ab1e4ed7f1570adfab8807d743328166f1df52f9.zip |
Merging two branches.
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/io/ioReadPla.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/base/io/ioReadPla.c b/src/base/io/ioReadPla.c index 46ab811e..1bd88bd9 100644 --- a/src/base/io/ioReadPla.c +++ b/src/base/io/ioReadPla.c @@ -99,9 +99,10 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros ) // go through the lines of the file nCubes = 0; pProgress = Extra_ProgressBarStart( stdout, Extra_FileReaderGetFileSize(p) ); - for ( iLine = 0; (vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p)); iLine++ ) + while ( (vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p)) ) { Extra_ProgressBarUpdate( pProgress, Extra_FileReaderGetCurPosition(p), NULL ); + iLine = Extra_FileReaderGetLineNumber( p, 0 ); // if it is the end of file, quit the loop if ( strncmp( (char *)vTokens->pArray[0], ".e", 2 ) == 0 ) @@ -118,7 +119,7 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros ) if ( vTokens->nSize == 1 ) { printf( "%s (line %d): Wrong number of token.\n", - Extra_FileReaderGetFileName(p), iLine+1 ); + Extra_FileReaderGetFileName(p), iLine ); Abc_NtkDelete( pNtk ); Extra_ProgressBarStop( pProgress ); ABC_FREE( ppSops ); @@ -203,7 +204,7 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros ) if ( vTokens->nSize != 2 ) { printf( "%s (line %d): Input and output cubes are not specified.\n", - Extra_FileReaderGetFileName(p), iLine+1 ); + Extra_FileReaderGetFileName(p), iLine ); Abc_NtkDelete( pNtk ); Extra_ProgressBarStop( pProgress ); ABC_FREE( ppSops ); @@ -214,14 +215,14 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros ) if ( strlen(pCubeIn) != (unsigned)nInputs ) { printf( "%s (line %d): Input cube length (%zu) differs from the number of inputs (%d).\n", - Extra_FileReaderGetFileName(p), iLine+1, strlen(pCubeIn), nInputs ); + Extra_FileReaderGetFileName(p), iLine, strlen(pCubeIn), nInputs ); Abc_NtkDelete( pNtk ); return NULL; } if ( strlen(pCubeOut) != (unsigned)nOutputs ) { printf( "%s (line %d): Output cube length (%zu) differs from the number of outputs (%d).\n", - Extra_FileReaderGetFileName(p), iLine+1, strlen(pCubeOut), nOutputs ); + Extra_FileReaderGetFileName(p), iLine, strlen(pCubeOut), nOutputs ); Abc_NtkDelete( pNtk ); Extra_ProgressBarStop( pProgress ); ABC_FREE( ppSops ); |