Kaydet (Commit) 93e971ac authored tarafından Julien Nabet's avatar Julien Nabet

A cppcheck cleaning with some simplification

üst 64e3c322
...@@ -193,7 +193,7 @@ extern "C" void init_source (j_decompress_ptr cinfo) ...@@ -193,7 +193,7 @@ extern "C" void init_source (j_decompress_ptr cinfo)
long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize ) long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize )
{ {
long nRead; long nRead = 0;
if( pSvStm->GetError() != ERRCODE_IO_PENDING ) if( pSvStm->GetError() != ERRCODE_IO_PENDING )
{ {
...@@ -203,8 +203,6 @@ long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize ) ...@@ -203,8 +203,6 @@ long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize )
if( pSvStm->GetError() == ERRCODE_IO_PENDING ) if( pSvStm->GetError() == ERRCODE_IO_PENDING )
{ {
nRead = 0;
// Damit wir wieder an die alte Position // Damit wir wieder an die alte Position
// seeken koennen, setzen wir den Error temp.zurueck // seeken koennen, setzen wir den Error temp.zurueck
pSvStm->ResetError(); pSvStm->ResetError();
...@@ -212,8 +210,6 @@ long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize ) ...@@ -212,8 +210,6 @@ long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize )
pSvStm->SetError( ERRCODE_IO_PENDING ); pSvStm->SetError( ERRCODE_IO_PENDING );
} }
} }
else
nRead = 0;
return nRead; return nRead;
} }
...@@ -225,7 +221,7 @@ extern "C" boolean fill_input_buffer (j_decompress_ptr cinfo) ...@@ -225,7 +221,7 @@ extern "C" boolean fill_input_buffer (j_decompress_ptr cinfo)
nbytes = StreamRead(src->infile, src->buffer, BUF_SIZE); nbytes = StreamRead(src->infile, src->buffer, BUF_SIZE);
if (nbytes <= 0) { if (!nbytes) {
if (src->start_of_file) /* Treat empty input file as fatal error */ if (src->start_of_file) /* Treat empty input file as fatal error */
ERREXIT(cinfo, JERR_INPUT_EMPTY); ERREXIT(cinfo, JERR_INPUT_EMPTY);
WARNMS(cinfo, JWRN_JPEG_EOF); WARNMS(cinfo, JWRN_JPEG_EOF);
......
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