Unverified Commit 0e88e273 by alanminko Committed by GitHub

Merge pull request #177 from mmicko/fix_large_liberty

Enable loading of large liberty files
parents 1cd5a2ce 7543778f
...@@ -70,7 +70,7 @@ struct Scl_Tree_t_ ...@@ -70,7 +70,7 @@ struct Scl_Tree_t_
{ {
char * pFileName; // input Liberty file name char * pFileName; // input Liberty file name
char * pContents; // file contents char * pContents; // file contents
int nContents; // file size long nContents; // file size
int nLines; // line counter int nLines; // line counter
int nItems; // number of items int nItems; // number of items
int nItermAlloc; // number of items allocated int nItermAlloc; // number of items allocated
...@@ -521,10 +521,10 @@ void Scl_LibertyFixFileName( char * pFileName ) ...@@ -521,10 +521,10 @@ void Scl_LibertyFixFileName( char * pFileName )
if ( *pHead == '>' ) if ( *pHead == '>' )
*pHead = '\\'; *pHead = '\\';
} }
int Scl_LibertyFileSize( char * pFileName ) long Scl_LibertyFileSize( char * pFileName )
{ {
FILE * pFile; FILE * pFile;
int nFileSize; long nFileSize;
pFile = fopen( pFileName, "rb" ); pFile = fopen( pFileName, "rb" );
if ( pFile == NULL ) if ( pFile == NULL )
{ {
...@@ -536,7 +536,7 @@ int Scl_LibertyFileSize( char * pFileName ) ...@@ -536,7 +536,7 @@ int Scl_LibertyFileSize( char * pFileName )
fclose( pFile ); fclose( pFile );
return nFileSize; return nFileSize;
} }
char * Scl_LibertyFileContents( char * pFileName, int nContents ) char * Scl_LibertyFileContents( char * pFileName, long nContents )
{ {
FILE * pFile = fopen( pFileName, "rb" ); FILE * pFile = fopen( pFileName, "rb" );
char * pContents = ABC_ALLOC( char, nContents+1 ); char * pContents = ABC_ALLOC( char, nContents+1 );
...@@ -573,7 +573,7 @@ void Scl_LibertyStringDump( char * pFileName, Vec_Str_t * vStr ) ...@@ -573,7 +573,7 @@ void Scl_LibertyStringDump( char * pFileName, Vec_Str_t * vStr )
Scl_Tree_t * Scl_LibertyStart( char * pFileName ) Scl_Tree_t * Scl_LibertyStart( char * pFileName )
{ {
Scl_Tree_t * p; Scl_Tree_t * p;
int RetValue; long RetValue;
// read the file into the buffer // read the file into the buffer
Scl_LibertyFixFileName( pFileName ); Scl_LibertyFixFileName( pFileName );
RetValue = Scl_LibertyFileSize( pFileName ); RetValue = Scl_LibertyFileSize( pFileName );
......
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