diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2011-10-13 22:18:00 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2011-10-13 22:18:00 +0200 |
commit | 93e971ac54e94ad58b4199e5d635133e738c28a1 (patch) | |
tree | c8aa91255e47c605a4b9ac3150daab727782f5ce /svtools | |
parent | 64e3c3223e2b31a4fe85212f569f30e2abec0211 (diff) |
A cppcheck cleaning with some simplification
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/filter/jpeg/jpeg.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/svtools/source/filter/jpeg/jpeg.cxx b/svtools/source/filter/jpeg/jpeg.cxx index 14a6988893c4..f72d9fbd457c 100644 --- a/svtools/source/filter/jpeg/jpeg.cxx +++ b/svtools/source/filter/jpeg/jpeg.cxx @@ -193,7 +193,7 @@ extern "C" void init_source (j_decompress_ptr cinfo) long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize ) { - long nRead; + long nRead = 0; if( pSvStm->GetError() != ERRCODE_IO_PENDING ) { @@ -203,8 +203,6 @@ long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize ) if( pSvStm->GetError() == ERRCODE_IO_PENDING ) { - nRead = 0; - // Damit wir wieder an die alte Position // seeken koennen, setzen wir den Error temp.zurueck pSvStm->ResetError(); @@ -212,8 +210,6 @@ long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize ) pSvStm->SetError( ERRCODE_IO_PENDING ); } } - else - nRead = 0; return nRead; } @@ -225,7 +221,7 @@ extern "C" boolean fill_input_buffer (j_decompress_ptr cinfo) 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 */ ERREXIT(cinfo, JERR_INPUT_EMPTY); WARNMS(cinfo, JWRN_JPEG_EOF); |