]> git.lyx.org Git - features.git/commitdiff
Use correct types when working with stream::pos_type.
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 22 Oct 2003 22:22:55 +0000 (22:22 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 22 Oct 2003 22:22:55 +0000 (22:22 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7958 a592a061-630c-0410-9148-cb99ea01b6c8

boost/ChangeLog
boost/libs/regex/src/cpp_regex_traits.cpp
src/ChangeLog
src/lyxlex_pimpl.C
src/paragraph_pimpl.C

index 5cdc6555d8edb5ea0aece372dde51c8312e0ee7a..624bd12ec6b1ce37d179922ac4c100225bb7e444 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-23  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * libs/regex/src/cpp_regex_traits.cpp (seekpos): use correct
+       types. same patch sent to boost list and accepted there.
+
 2003-10-07  Angus Leeming  <leeming@lyx.org>
 
        * boost/any.hpp: change the throw to boost::throw_exception.
index 00b8c4a49e1d430908fb0d3ea4437d601eb30def..8e4908c4dd51c3cad45e6a9fce1e78ec25ed0c96 100644 (file)
@@ -8,11 +8,11 @@
  * provided that the above copyright notice appear in all copies and
  * that both that copyright notice and this permission notice appear
  * in supporting documentation.  Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.  
+ * about the suitability of this software for any purpose.
  * It is provided "as is" without express or implied warranty.
  *
  */
+
  /*
   *   LOCATION:    see http://www.boost.org for most recent version.
   *   FILE:        c_regex_traits.cpp
@@ -161,9 +161,9 @@ parser_buf<charT, traits>::seekpos(pos_type sp, ::std::ios_base::openmode which)
       return pos_type(off_type(-1));
    std::ptrdiff_t size = this->egptr() - this->eback();
    charT* g = this->eback();
-   if(sp <= size)
+   if(off_type(sp) <= size)
    {
-      this->setg(g, g + ::std::streamsize(sp), g + size);
+      this->setg(g, g + off_type(sp), g + size);
    }
    return pos_type(off_type(-1));
 }
@@ -218,7 +218,7 @@ message_data<char>::message_data(const std::locale& l, const std::string& regex_
 #else
       BOOST_REGEX_NOEH_ASSERT(cat >= 0);
 #endif
-   } 
+   }
 #endif
    std::memset(syntax_map, cpp_regex_traits<char>::syntax_char, 256);
    unsigned i;
@@ -691,7 +691,7 @@ message_data<wchar_t>::message_data(const std::locale& l, const std::string& reg
 
    if((int)cat >= 0)
       msgs.close(cat);
-#endif      
+#endif
 }
 
 } // namespace re_detail
@@ -876,5 +876,3 @@ std::size_t BOOST_REGEX_CALL cpp_regex_traits<wchar_t>::strwiden(wchar_t *s1, st
 } // namespace boost
 
 #endif
-
-
index c438cc39c1d24d382a4be54f4d86ab892747caa5..0f1f11aa1b02e14bbdd214bd2e4762c4a05810e3 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-23  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * lyxlex_pimpl.C (setFile,setStream): be sure to use correct types
+       when woring with stream::pos_type
+       * paragraph_pimpl.C (simpleTeXSpecialChars): ditto
 
 2003-10-22  André Pönitz  <poenitz@gmx.net>
 
@@ -24,7 +29,7 @@
 
 2003-10-22  Martin Vermeer  <martin.vermeer@hut.fi>
 
-       * text.C: fixed an "oops" in the "is a bit silly" 
+       * text.C: fixed an "oops" in the "is a bit silly"
        bug fix
 
 2003-10-21  André Pönitz  <poenitz@gmx.net>
@@ -52,7 +57,7 @@
 2003-10-20  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * text.C: re-introduce display() for insets, fixing the
-       various bugs (stretch of line above, math inset 
+       various bugs (stretch of line above, math inset
        positioning, ...)
 
 2003-10-20  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
index 7b8c580e852af363f2ba437ede14c3c709361c7c..4d582a54f36475bca9fcae67605cbb20eadf1091 100644 (file)
@@ -138,7 +138,7 @@ bool LyXLex::Pimpl::setFile(string const & filename)
                // The check only outputs a debug message, because it triggers
                // a bug in compaq cxx 6.2, where is_open() returns 'true' for
                // a fresh new filebuf.  (JMarc)
-               if (gz__.is_open() || is.tellg() > 0)
+               if (gz__.is_open() || istream::off_type(is.tellg()) > -1)
                        lyxerr[Debug::LYXLEX] << "Error in LyXLex::setFile: "
                                "file or stream already set." << endl;
                gz__.open(filename.c_str(), ios::in);
@@ -152,7 +152,7 @@ bool LyXLex::Pimpl::setFile(string const & filename)
                // The check only outputs a debug message, because it triggers
                // a bug in compaq cxx 6.2, where is_open() returns 'true' for
                // a fresh new filebuf.  (JMarc)
-               if (fb__.is_open() || is.tellg() > 0)
+               if (fb__.is_open() || istream::off_type(is.tellg()) > 0)
                        lyxerr[Debug::LYXLEX] << "Error in LyXLex::setFile: "
                                "file or stream already set." << endl;
                fb__.open(filename.c_str(), ios::in);
@@ -166,7 +166,7 @@ bool LyXLex::Pimpl::setFile(string const & filename)
 
 void LyXLex::Pimpl::setStream(istream & i)
 {
-       if (fb__.is_open() || is.tellg() > 0)
+       if (fb__.is_open() || istream::off_type(is.tellg()) > 0)
                lyxerr[Debug::LYXLEX]  << "Error in LyXLex::setStream: "
                        "file or stream already set." << endl;
        is.rdbuf(i.rdbuf());
index 700c2420ddd2851fa8742e52aaff1871bfba006a..ab6c0080d7c17c645a4a50cd7bd9a448fee179e0 100644 (file)
@@ -523,8 +523,8 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                }
 
                bool close = false;
-               int const len = os.tellp();
-               //ostream::pos_type const len = os.tellp();
+               ostream::pos_type const len = os.tellp();
+
                if ((inset->lyxCode() == InsetOld::GRAPHICS_CODE
                     || inset->lyxCode() == InsetOld::MATH_CODE
                     || inset->lyxCode() == InsetOld::URL_CODE)
@@ -562,7 +562,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                        texrow.start(owner_->id(), i + 1);
                        column = 0;
                } else {
-                       column += int(os.tellp()) - len;
+                       column += os.tellp() - len;
                }
        }
        break;