Changes to OTF:
- fixed even more Coverity warnings This commit was SVN r28198.
Этот коммит содержится в:
родитель
7d4be1cb81
Коммит
4fbc105b83
@ -221,6 +221,8 @@ OTFAUX_ThumbnailReader_read( OTFAUX_ThumbnailReader* tn_reader,
|
||||
const uint32_t* /* function tokens */ ),
|
||||
void* data )
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
unsigned long long process;
|
||||
uint32_t* functions;
|
||||
int status;
|
||||
@ -256,15 +258,15 @@ OTFAUX_ThumbnailReader_read( OTFAUX_ThumbnailReader* tn_reader,
|
||||
}
|
||||
}
|
||||
|
||||
if ( fgetc( tn_reader->file ) != EOF )
|
||||
if ( fgetc( tn_reader->file ) == EOF )
|
||||
{
|
||||
return 0;
|
||||
ret = ( i == tn_reader->nprocs
|
||||
&& j == tn_reader->width
|
||||
&& feof( tn_reader->file ) );
|
||||
}
|
||||
|
||||
out:
|
||||
free( functions );
|
||||
|
||||
return i == tn_reader->nprocs
|
||||
&& j == tn_reader->width
|
||||
&& feof( tn_reader->file );
|
||||
return ret;
|
||||
}
|
||||
|
@ -595,10 +595,6 @@ int OTF_File_close( OTF_File* file ) {
|
||||
int status;
|
||||
#endif /* HAVE_ZLIB */
|
||||
|
||||
if ( NULL != file->iofsl ) {
|
||||
return OTF_File_iofsl_close( file );
|
||||
}
|
||||
|
||||
if ( NULL == file ) {
|
||||
|
||||
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
|
||||
@ -608,6 +604,9 @@ int OTF_File_close( OTF_File* file ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( NULL != file->iofsl ) {
|
||||
return OTF_File_iofsl_close( file );
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
|
||||
@ -1098,17 +1097,6 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
|
||||
uint32_t len;
|
||||
OTF_File* ret;
|
||||
|
||||
if ( OTF_FileManager_isIofsl( manager ) ) {
|
||||
/* open all files except *.otf and global definitions/markers with iofsl */
|
||||
if ( OTF_File_nameSuffixCmp( filename, ".otf" )
|
||||
&& OTF_File_nameSuffixCmp( filename, ".0.def" )
|
||||
&& OTF_File_nameSuffixCmp( filename, ".0.def.z" )
|
||||
&& OTF_File_nameSuffixCmp( filename, ".0.marker" )
|
||||
&& OTF_File_nameSuffixCmp( filename, ".0.marker.z" ) ) {
|
||||
return OTF_File_iofsl_open_zlevel( filename, manager, mode, zlevel );
|
||||
}
|
||||
}
|
||||
|
||||
/* Check input parameters */
|
||||
if( NULL == filename ) {
|
||||
|
||||
@ -1127,6 +1115,17 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( OTF_FileManager_isIofsl( manager ) ) {
|
||||
/* open all files except *.otf and global definitions/markers with iofsl */
|
||||
if ( OTF_File_nameSuffixCmp( filename, ".otf" )
|
||||
&& OTF_File_nameSuffixCmp( filename, ".0.def" )
|
||||
&& OTF_File_nameSuffixCmp( filename, ".0.def.z" )
|
||||
&& OTF_File_nameSuffixCmp( filename, ".0.marker" )
|
||||
&& OTF_File_nameSuffixCmp( filename, ".0.marker.z" ) ) {
|
||||
return OTF_File_iofsl_open_zlevel( filename, manager, mode, zlevel );
|
||||
}
|
||||
}
|
||||
|
||||
ret= (OTF_File*) malloc( sizeof(OTF_File) );
|
||||
if( NULL == ret ) {
|
||||
|
||||
|
@ -207,6 +207,7 @@ int OTF_MasterControl_read( OTF_MasterControl* mc, const char* namestub ) {
|
||||
if ( ! OTF_RBuffer_testChar( buffer, ':') ) {
|
||||
OTF_Error( "OTF_MasterControl_read() "
|
||||
"ERROR: missing expected character ':'" );
|
||||
free( buffer );
|
||||
return 0;
|
||||
}
|
||||
mode = (OTF_IofslMode)OTF_RBuffer_readUint32( buffer );
|
||||
@ -214,12 +215,14 @@ int OTF_MasterControl_read( OTF_MasterControl* mc, const char* namestub ) {
|
||||
&& mode != OTF_IOFSL_MULTIFILE ) {
|
||||
OTF_Error( "OTF_MasterControl_read() "
|
||||
"ERROR: invalid IofslMode." );
|
||||
free( buffer );
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( ! OTF_RBuffer_testChar( buffer, ':') ) {
|
||||
OTF_Error( "OTF_MasterControl_read() "
|
||||
"ERROR: missing expected character ':'" );
|
||||
free( buffer );
|
||||
return 0;
|
||||
}
|
||||
streamid_bits = OTF_RBuffer_readUint32( buffer );
|
||||
|
@ -28,10 +28,14 @@
|
||||
#include "OTF_KeyValue.h"
|
||||
|
||||
/* *** some macros *** ****************************************** */
|
||||
#define PARSE_ERROR( buffer ) \
|
||||
OTF_Error( "Parse error in function %s, file: %s, line: %i:\n %s\n", \
|
||||
__FUNCTION__, __FILE__, __LINE__, OTF_RBuffer_printRecord( buffer ) );
|
||||
|
||||
#define PARSE_ERROR( buffer ) { \
|
||||
char* record = OTF_RBuffer_printRecord( buffer ); \
|
||||
if ( NULL != record ) { \
|
||||
OTF_Error( "Parse error in function %s, file: %s, line: %i:\n %s\n", \
|
||||
__FUNCTION__, __FILE__, __LINE__, record ); \
|
||||
free( record ); \
|
||||
} \
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -1033,6 +1033,8 @@ int OTF_Reader_init( OTF_Reader* reader ) {
|
||||
reader->statisticsHeap= NULL;
|
||||
reader->markerHeap= NULL;
|
||||
|
||||
reader->mc= NULL;
|
||||
|
||||
reader->minTime= 0;
|
||||
reader->maxTime= (uint64_t) -1;
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user