From 791b107e7a225103ee76c921c3c4a96d0e1adae2 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 16 Feb 2012 21:53:16 -0800 Subject: Silencing some of the gcc warnings. --- src/misc/bbl/bblif.c | 3 ++- src/misc/extra/extraUtilFile.c | 3 ++- src/misc/extra/extraUtilReader.c | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/misc') diff --git a/src/misc/bbl/bblif.c b/src/misc/bbl/bblif.c index fc227760..47190fb7 100644 --- a/src/misc/bbl/bblif.c +++ b/src/misc/bbl/bblif.c @@ -667,10 +667,11 @@ char * Bbl_ManFileRead( char * pFileName ) FILE * pFile; char * pContents; int nFileSize; + int RetValue; nFileSize = Bbl_ManFileSize( pFileName ); pFile = fopen( pFileName, "rb" ); pContents = BBLIF_ALLOC( char, nFileSize ); - fread( pContents, nFileSize, 1, pFile ); + RetValue = fread( pContents, nFileSize, 1, pFile ); fclose( pFile ); return pContents; } diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c index b38befd6..e2c32ec3 100644 --- a/src/misc/extra/extraUtilFile.c +++ b/src/misc/extra/extraUtilFile.c @@ -235,6 +235,7 @@ char * Extra_FileRead( FILE * pFile ) { int nFileSize; char * pBuffer; + int RetValue; // get the file size, in bytes fseek( pFile, 0, SEEK_END ); nFileSize = ftell( pFile ); @@ -242,7 +243,7 @@ char * Extra_FileRead( FILE * pFile ) rewind( pFile ); // load the contents of the file into memory pBuffer = ABC_ALLOC( char, nFileSize + 3 ); - fread( pBuffer, nFileSize, 1, pFile ); + RetValue = fread( pBuffer, nFileSize, 1, pFile ); // terminate the string with '\0' pBuffer[ nFileSize + 0] = '\n'; pBuffer[ nFileSize + 1] = '\0'; diff --git a/src/misc/extra/extraUtilReader.c b/src/misc/extra/extraUtilReader.c index 41e02a27..44fc080b 100644 --- a/src/misc/extra/extraUtilReader.c +++ b/src/misc/extra/extraUtilReader.c @@ -91,6 +91,7 @@ Extra_FileReader_t * Extra_FileReaderAlloc( char * pFileName, FILE * pFile; char * pChar; int nCharsToRead; + int RetValue; // check if the file can be opened pFile = fopen( pFileName, "rb" ); if ( pFile == NULL ) @@ -122,7 +123,7 @@ Extra_FileReader_t * Extra_FileReaderAlloc( char * pFileName, // determine how many chars to read nCharsToRead = EXTRA_MINIMUM(p->nFileSize, EXTRA_BUFFER_SIZE); // load the first part into the buffer - fread( p->pBuffer, nCharsToRead, 1, p->pFile ); + RetValue = fread( p->pBuffer, nCharsToRead, 1, p->pFile ); p->nFileRead = nCharsToRead; // set the ponters to the end and the stopping point p->pBufferEnd = p->pBuffer + nCharsToRead; @@ -361,6 +362,7 @@ void * Extra_FileReaderGetTokens_int( Extra_FileReader_t * p ) void Extra_FileReaderReload( Extra_FileReader_t * p ) { int nCharsUsed, nCharsToRead; + int RetValue; assert( !p->fStop ); assert( p->pBufferCur > p->pBufferStop ); assert( p->pBufferCur < p->pBufferEnd ); @@ -372,7 +374,7 @@ void Extra_FileReaderReload( Extra_FileReader_t * p ) // determine how many chars we will read nCharsToRead = EXTRA_MINIMUM( p->nBufferSize - nCharsUsed, p->nFileSize - p->nFileRead ); // read the chars - fread( p->pBuffer + nCharsUsed, nCharsToRead, 1, p->pFile ); + RetValue = fread( p->pBuffer + nCharsUsed, nCharsToRead, 1, p->pFile ); p->nFileRead += nCharsToRead; // set the ponters to the end and the stopping point p->pBufferEnd = p->pBuffer + nCharsUsed + nCharsToRead; -- cgit v1.2.3