[Libreoffice-commits] .: svtools/source

Julien Nabet serval2412 at kemper.freedesktop.org
Thu Oct 13 13:18:27 PDT 2011


 svtools/source/filter/jpeg/jpeg.cxx |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 93e971ac54e94ad58b4199e5d635133e738c28a1
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Thu Oct 13 22:18:00 2011 +0200

    A cppcheck cleaning with some simplification

diff --git a/svtools/source/filter/jpeg/jpeg.cxx b/svtools/source/filter/jpeg/jpeg.cxx
index 14a6988..f72d9fb 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);


More information about the Libreoffice-commits mailing list