Update of /cvsroot/boost/boost/libs/iostreams/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3406/libs/iostreams/src

Modified Files:
      Tag: RC_1_34_0
        bzip2.cpp file_descriptor.cpp mapped_file.cpp zlib.cpp 
Log Message:
Applied Kim Barret's patches to bring the iostreams library into line with 
133.1: http://svn.boost.org/trac/boost/ticket/971

Index: bzip2.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/iostreams/src/bzip2.cpp,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -d -r1.7 -r1.7.2.1
--- bzip2.cpp   3 Aug 2005 18:36:04 -0000       1.7
+++ bzip2.cpp   23 May 2007 08:27:32 -0000      1.7.2.1
@@ -15,7 +15,8 @@
 
 #include <boost/iostreams/detail/config/dyn_link.hpp>
 #include <boost/iostreams/filter/bzip2.hpp> 
-#include "bzlib.h"  // To configure Boost to work with libbz2, see the 
+#include "bzlib.h"  // Julian Seward's "bzip.h" header.
+                    // To configure Boost to work with libbz2, see the 
                     // installation instructions here:
                     // http://boost.org/libs/iostreams/doc/index.html?path=7
                     

Index: file_descriptor.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/iostreams/src/file_descriptor.cpp,v
retrieving revision 1.9
retrieving revision 1.9.4.1
diff -u -d -r1.9 -r1.9.4.1
--- file_descriptor.cpp 2 May 2005 22:50:34 -0000       1.9
+++ file_descriptor.cpp 23 May 2007 08:27:32 -0000      1.9.4.1
@@ -175,17 +175,14 @@
     return n;
 }
 
-stream_offset file_descriptor::seek
+std::streampos file_descriptor::seek
     (stream_offset off, BOOST_IOS::seekdir way)
 {
     using namespace std;
 #ifdef BOOST_IOSTREAMS_WINDOWS
     if (pimpl_->flags_ & impl::has_handle) {
         LONG lDistanceToMove = static_cast<LONG>(off & 0xffffffff);
-        LONG lDistanceToMoveHigh =
-            off < 0xffffffff ?
-                static_cast<LONG>(off >> 32) :
-                0;
+        LONG lDistanceToMoveHigh = static_cast<LONG>(off >> 32);
         DWORD dwResultLow =
             ::SetFilePointer( pimpl_->handle_,
                               lDistanceToMove,
@@ -198,8 +195,7 @@
         if (::GetLastError() != NO_ERROR) {
             throw detail::bad_seek();
         } else {
-            return (static_cast<boost::intmax_t>(lDistanceToMoveHigh) << 32) +
-                   dwResultLow;
+           return offset_to_position((lDistanceToMoveHigh << 32) + 
dwResultLow);
         }
     }
 #endif // #ifdef BOOST_IOSTREAMS_WINDOWS
@@ -231,7 +227,7 @@
                           SEEK_END );
     if (result == -1)
         throw detail::bad_seek();
-    return result;
+    return offset_to_position(result);
 }
 
 void file_descriptor::close() { close_impl(*pimpl_); }

Index: mapped_file.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/iostreams/src/mapped_file.cpp,v
retrieving revision 1.19
retrieving revision 1.19.2.1
diff -u -d -r1.19 -r1.19.2.1
--- mapped_file.cpp     16 Feb 2006 12:23:18 -0000      1.19
+++ mapped_file.cpp     23 May 2007 08:27:32 -0000      1.19.2.1
@@ -181,7 +181,9 @@
                        (p.new_file_size != 0 && !readonly) ? 
                            CREATE_ALWAYS : 
                            OPEN_EXISTING,
-                       FILE_ATTRIBUTE_TEMPORARY,
+                       readonly ?
+                           FILE_ATTRIBUTE_READONLY :
+                           FILE_ATTRIBUTE_TEMPORARY,
                        NULL );
 
     if (pimpl_->handle_ == INVALID_HANDLE_VALUE)
@@ -289,7 +291,7 @@
     if (impl.handle_ != 0)
         ::close(impl.handle_);
     impl.clear(true);
-    throw_system_failure( msg );
+    throw_system_failure(msg);
 }
 
 } // End namespace detail.

Index: zlib.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/iostreams/src/zlib.cpp,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -d -r1.8 -r1.8.2.1
--- zlib.cpp    3 Aug 2005 18:36:05 -0000       1.8
+++ zlib.cpp    23 May 2007 08:27:32 -0000      1.8.2.1
@@ -15,7 +15,8 @@
 
 #include <boost/iostreams/detail/config/dyn_link.hpp>
 #include <boost/iostreams/filter/zlib.hpp> 
-#include "zlib.h"   // To configure Boost to work with zlib, see the 
+#include "zlib.h"   // Jean-loup Gailly's and Mark Adler's "zlib.h" header.
+                    // To configure Boost to work with zlib, see the 
                     // installation instructions here:
                     // http://boost.org/libs/iostreams/doc/index.html?path=7
 
@@ -79,6 +80,7 @@
         throw std::bad_alloc();
     default:
         throw zlib_error(error);
+        ;
     }
 }
 
@@ -105,8 +107,8 @@
 void zlib_base::after(const char*& src_begin, char*& dest_begin, bool compress)
 {
     z_stream* s = static_cast<z_stream*>(stream_);
-    char*& next_in = reinterpret_cast<char*&>(s->next_in);
-    char*& next_out = reinterpret_cast<char*&>(s->next_out);
+    char* next_in = reinterpret_cast<char*>(s->next_in);
+    char* next_out = reinterpret_cast<char*>(s->next_out);
     if (calculate_crc_) {
         const zlib::byte* buf = compress ?
             reinterpret_cast<const zlib::byte*>(src_begin) :
@@ -121,7 +123,7 @@
     }
     total_in_ = s->total_in;
     total_out_ = s->total_out;
-    src_begin = const_cast<const char*&>(next_in);
+    src_begin = const_cast<const char*>(next_in);
     dest_begin = next_out;
 }
 
@@ -138,11 +140,14 @@
 void zlib_base::reset(bool compress, bool realloc)
 {
     z_stream* s = static_cast<z_stream*>(stream_);
-    zlib_error::check(
+    // Undiagnosed bug:
+    // deflateReset(), etc., return Z_DATA_ERROR
+    //zlib_error::check(
         realloc ?
             (compress ? deflateReset(s) : inflateReset(s)) :
             (compress ? deflateEnd(s) : inflateEnd(s))
-    );
+                ;
+    //);
 }
 
 void zlib_base::do_init


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to