]> git.lyx.org Git - lyx.git/blobdiff - boost/boost/format/alt_sstream_impl.hpp
Don't allow newline characters in document settings.
[lyx.git] / boost / boost / format / alt_sstream_impl.hpp
index ee9c3abd1eabca3812a5d84e76c4e7e4bbda2093..9975e4f96b0a325b28b7ad65441b1d38deb56fd3 100644 (file)
@@ -37,7 +37,12 @@ namespace boost {
         str (const string_type& s) {
             size_type sz=s.size();
             if(sz != 0 && mode_ & (::std::ios_base::in | ::std::ios_base::out) ) {
+#ifdef _RWSTD_NO_CLASS_PARTIAL_SPEC
+                void *vd_ptr = alloc_.allocate(sz, is_allocated_? eback() : 0);
+                Ch *new_ptr = static_cast<Ch *>(vd_ptr);
+#else
                 Ch *new_ptr = alloc_.allocate(sz, is_allocated_? eback() : 0);
+#endif
                 // if this didnt throw, we're safe, update the buffer
                 dealloc();
                 sz = s.copy(new_ptr, sz);
@@ -107,7 +112,7 @@ namespace boost {
                     return pos_type(off_type(-1));
                 if(eback() <= off+gptr() && off+gptr() <= putend_ ) {
                     // set gptr
-                    streambuf_t::gbump(off);
+                    streambuf_t::gbump(static_cast<int>(off));
                     if(which & ::std::ios_base::out && pptr() != NULL)
                         // update pptr to match gptr
                         streambuf_t::pbump(static_cast<int>(gptr()-pptr()));
@@ -125,7 +130,7 @@ namespace boost {
                     return pos_type(off_type(-1));                    
                 if(pbase() <= off+pptr() && off+pptr() <= putend_)
                     // set pptr
-                    streambuf_t::pbump(off); 
+                    streambuf_t::pbump(static_cast<int>(off)); 
                 else
                     off = off_type(-1);
             }
@@ -140,7 +145,7 @@ namespace boost {
         typename basic_altstringbuf<Ch, Tr, Alloc>::pos_type 
         basic_altstringbuf<Ch, Tr, Alloc>:: 
         seekpos (pos_type pos, ::std::ios_base::openmode which) {
-            off_type off = off_type(pos); // operation guaranteed by ยง27.4.3.2 table 88
+            off_type off = off_type(pos); // operation guaranteed by 27.4.3.2 table 88
             if(pptr() != NULL && putend_ < pptr())
                 putend_ = pptr();
             if(off != off_type(-1)) {
@@ -221,6 +226,10 @@ namespace boost {
         typename basic_altstringbuf<Ch, Tr, Alloc>::int_type 
         basic_altstringbuf<Ch, Tr, Alloc>:: 
         overflow (int_type meta) {
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4996)
+#endif
             if(compat_traits_type::eq_int_type(compat_traits_type::eof(), meta))
                 return compat_traits_type::not_eof(meta); // nothing to do
             else if(pptr() != NULL && pptr() < epptr()) {
@@ -245,7 +254,12 @@ namespace boost {
                     add_size /= 2;
                 if(0 < add_size) {
                     new_size += add_size;
+#ifdef _RWSTD_NO_CLASS_PARTIAL_SPEC
+                    void *vdptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);
+                    newptr = static_cast<Ch *>(vdptr);
+#else
                     newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);
+#endif
                 }
 
                 if(0 < prev_size)
@@ -276,6 +290,9 @@ namespace boost {
                 streambuf_t::sputc(compat_traits_type::to_char_type(meta));
                 return meta;
             }
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
         }
         // -end overflow(..)