X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fsysmacs.lisp;h=60f18d751abd861436e9f5bd1eea2a7696548106;hb=672b2f6cb751566526c7f3bb3de6b7d8424760e2;hp=ad91f85c249d8d5c3c0ed670cc3522c2eaca7c18;hpb=b5c69cfe906a31ae57bb0f18c67af9d2eaa1dfef;p=sbcl.git diff --git a/src/code/sysmacs.lisp b/src/code/sysmacs.lisp index ad91f85..60f18d7 100644 --- a/src/code/sysmacs.lisp +++ b/src/code/sysmacs.lisp @@ -72,7 +72,6 @@ maintained." (,without-gcing-body)) (when (or *gc-pending* #!+sb-thread *stop-for-gc-pending*) (sb!unix::receive-pending-interrupt)))))))) - ;;; EOF-OR-LOSE is a useful macro that handles EOF. (defmacro eof-or-lose (stream eof-error-p eof-value) @@ -167,14 +166,19 @@ maintained." ;;; within the scope of a PREPARE-FOR-FAST-READ-CHAR. (defmacro fast-read-char (&optional (eof-error-p t) (eof-value ())) `(cond - ((not %frc-buffer%) - (funcall %frc-method% %frc-stream% ,eof-error-p ,eof-value)) - ((= %frc-index% +ansi-stream-in-buffer-length+) - (prog1 (fast-read-char-refill %frc-stream% ,eof-error-p ,eof-value) - (setq %frc-index% (ansi-stream-in-index %frc-stream%)))) - (t - (prog1 (aref %frc-buffer% %frc-index%) - (incf %frc-index%))))) + ((not %frc-buffer%) + (funcall %frc-method% %frc-stream% ,eof-error-p ,eof-value)) + ((= %frc-index% +ansi-stream-in-buffer-length+) + (multiple-value-bind (eof-p index-or-value) + (fast-read-char-refill %frc-stream% ,eof-error-p ,eof-value) + (if eof-p + index-or-value + (progn + (setq %frc-index% (1+ index-or-value)) + (aref %frc-buffer% index-or-value))))) + (t + (prog1 (aref %frc-buffer% %frc-index%) + (incf %frc-index%))))) ;;;; And these for the fasloader...