Navigation Menu

Skip to content

Commit

Permalink
Moved debug test from %STREAM-UNREAD-CHAR to STREAM-UNREAD-CHAR.
Browse files Browse the repository at this point in the history
Signed-off-by: Stelian Ionescu <sionescu@common-lisp.net>
  • Loading branch information
sionescu committed Apr 26, 2007
1 parent ab02af6 commit 2992c83
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions sockets/gray-stream-methods.lisp
Expand Up @@ -450,14 +450,7 @@
(char str 0)))))

(defun %stream-unread-char (stream)
;; unreading anything but the latest character is wrong,
;; but checking is not mandated by the standard
(declare (type active-socket stream))
#+iolib-debug
(progn
(%stream-unread-char stream)
(unless (ignore-errors (eql (stream-read-char stream) character))
(error "Trying to unread wrong character ~S" character)))
(with-accessors ((ib input-buffer-of)
(unread-index ibuf-unread-index-of)) stream
(symbol-macrolet ((start (iobuf-start ib)))
Expand All @@ -469,7 +462,16 @@
nil)

(defmethod stream-unread-char ((stream active-socket) character)
;; unreading anything but the latest character is wrong,
;; but checking is not mandated by the standard
#+iolib-debug
(progn
(%stream-unread-char stream)
(unless (ignore-errors (eql (stream-read-char stream) character))
(error "Trying to unread wrong character ~S" character)))
#-iolib-debug
(declare (ignore character))
#-iolib-debug
(%stream-unread-char stream))

(defmethod stream-peek-char ((stream active-socket))
Expand Down

0 comments on commit 2992c83

Please sign in to comment.