0.8.1.46:
authorChristophe Rhodes <csr21@cam.ac.uk>
Fri, 18 Jul 2003 17:01:33 +0000 (17:01 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Fri, 18 Jul 2003 17:01:33 +0000 (17:01 +0000)
Merge patch from David Lichteblau (sbcl-devel 2003-06-01) for
(signed-byte 8) streams.
... no real insight, so merge it and hope for the best

NEWS
src/code/fd-stream.lisp
tests/stream.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 337069c..47b6ad0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1924,6 +1924,10 @@ changes in sbcl-0.8.2 relative to sbcl-0.8.1:
     provide helpful disassembly notes.
   * SB-MOP:CLASS-PROTOTYPE on built-in-classes returns an instance of
     the class in more cases than previously.
+  * bug fix: FILE-POSITION now understands :START and :END for
+    STRING-INPUT-STREAMs.  (thanks to Nikodemus Siivola)
+  * bug fix: (SIGNED-BYTE 8) streams no longer return (UNSIGNED-BYTE
+    8) data.  (thanks to David Lichteblau)
   * fixed some bugs revealed by Paul Dietz' test suite:
     ** LAST and [N]BUTLAST should accept a bignum.
     ** condition slot accessors are methods.
index 91b8f86..309febd 100644 (file)
                  (fd-stream-bin fd-stream) routine))
        (when (eql size 1)
          (setf (fd-stream-n-bin fd-stream) #'fd-stream-read-n-bytes)
-         (when buffer-p
+         (when (and buffer-p
+                    ;; We only create this buffer for streams of type
+                    ;; (unsigned-byte 8).  Because there's no buffer, the
+                    ;; other element-types will dispatch to the appropriate
+                    ;; input (output) routine in fast-read-byte.
+                    (or (eq type 'unsigned-byte)
+                        (eq type :default)))
            (setf (ansi-stream-in-buffer fd-stream)
                  (make-array +ansi-stream-in-buffer-length+
                              :element-type '(unsigned-byte 8)))))
index d2891f4..d3f3adf 100644 (file)
                '(sb-impl::string-output-stream string-stream stream)))
 
 \f
+;;; improper buffering on (SIGNED-BYTE 8) streams (fixed by David Lichteblau):
+(let ((p "signed-byte-8-test.data"))
+  (with-open-file (s p
+                    :direction :output
+                    :element-type '(unsigned-byte 8)
+                    :if-exists :supersede)
+    (write-byte 255 s))
+  (with-open-file (s p :element-type '(signed-byte 8))
+    (assert (= (read-byte s) -1)))
+  (delete-file p))
+\f
 ;;; success
 (quit :unix-status 104)
index 40c8a8b..ecf4f07 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.1.45"
+"0.8.1.46"