[Libreoffice-commits] core.git: hwpfilter/source

Stephan Bergmann sbergman at redhat.com
Thu Mar 23 08:30:20 UTC 2017


 hwpfilter/source/hwpeq.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 0acd074861eedf1d5c8bda9bec3311e9e7890c70
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 23 09:29:48 2017 +0100

    std::istream::get() returns std::istream::traits_type::eof()
    
    Change-Id: I0461e8184e4ad2a9d2dff89879e141bd66555bf5

diff --git a/hwpfilter/source/hwpeq.cxx b/hwpfilter/source/hwpeq.cxx
index 170a68c81ed1..9120bc9573ca 100644
--- a/hwpfilter/source/hwpeq.cxx
+++ b/hwpfilter/source/hwpeq.cxx
@@ -491,7 +491,7 @@ static int next_token(MzString &white, MzString &token, istream *strm)
 
   token = nullptr;
   white = nullptr;
-  if( !strm->good() || (ch = strm->get()) == EOF )
+  if( !strm->good() || (ch = strm->get()) == std::istream::traits_type::eof() )
     return 0;
 
   // read preceding ws
@@ -508,7 +508,8 @@ static int next_token(MzString &white, MzString &token, istream *strm)
     do {
       token << (char) ch;
       ch = strm->get();
-    } while( ch != EOF && (ch & 0x80 || isalpha(ch)) ) ;
+    } while( ch != std::istream::traits_type::eof()
+             && (ch & 0x80 || isalpha(ch)) ) ;
     strm->putback(sal::static_int_cast<char>(ch));
     /* special treatment of sub, sub, over, atop
        The reason for this is that affect next_state().
@@ -722,7 +723,8 @@ static char eq2ltxconv(MzString& sstr, istream *strm, const char *sentinel)
           sstr.replace(pos, ' ');
       }
       sstr << token;
-      while( (ch = strm->get()) != EOF && IS_WS(ch) )
+      while( (ch = strm->get()) != std::istream::traits_type::eof()
+             && IS_WS(ch) )
         sstr << (char)ch;
       if( ch != '{' )
         sstr << "{}";


More information about the Libreoffice-commits mailing list