master: Remove debugging and unused code

stassats via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  eb111dddf1e898a1731714ab8adaae0610cd7171 (commit)
      from  6cbab77cdb3f3674f423980eb749dbeab2c406cb (commit)

- Log -----------------------------------------------------------------
commit eb111dddf1e898a1731714ab8adaae0610cd7171
Author: Stas Boukarev <[email protected]>
Date:   Sat Aug 8 01:46:27 2026 +0300

    Remove debugging and unused code
---
 src/code/external-formats/enc-basic.lisp | 30 +-----------------------------
 src/code/fd-stream.lisp                  |  8 +-------
 2 files changed, 2 insertions(+), 36 deletions(-)

diff --git a/src/code/external-formats/enc-basic.lisp b/src/code/external-formats/enc-basic.lisp
index c6b28401f..3b41ea060 100644
--- a/src/code/external-formats/enc-basic.lisp
+++ b/src/code/external-formats/enc-basic.lisp
@@ -1171,24 +1171,6 @@
   :handle-size nil
   :count-chars count-utf8-byte-to-chars)
 
-(DEFUN COUNT-CHARS/UTF-8/CR (STREAM)
-   (LET* ((IBUF (FD-STREAM-IBUF STREAM))
-          (SAP (BUFFER-SAP IBUF))
-          (TAIL (BUFFER-TAIL IBUF))
-          (HEAD (ANSI-STREAM-CHAR-BUFFER-BYTE-POSITION STREAM))
-          (CODEPOINT (ANSI-STREAM-CHAR-BUFFER-BYTE-POSITION-AT STREAM))
-          (TARGET-CODEPOINT (ANSI-STREAM-IN-INDEX STREAM)))
-     (DECLARE (INDEX HEAD CODEPOINT)
-              (IGNORABLE TAIL))
-     (BLOCK DECODE-BREAK-REASON
-       (LOOP (WHEN (>= CODEPOINT TARGET-CODEPOINT) (RETURN HEAD))
-             (LET ((BYTE (SAP-REF-8 SAP HEAD)))
-               (INCF HEAD (COND ((< BYTE 128) 1) ((< BYTE 194) (RETURN-FROM DECODE-BREAK-REASON 1)) ((< BYTE 224) 2) ((< BYTE 240) 3) (T 4))))
-             (INCF CODEPOINT)))))
-
-(DEFUN %COUNT-CHARS/UTF-8/CR (STREAM)
-  (COUNT-CHARS/UTF-8/CR STREAM))
-
 (define-external-format/variable-width (:utf-8) t
   #+sb-unicode (code-char #xfffd) #-sb-unicode #\?
   (let ((bits (char-code |ch|)))
@@ -1252,8 +1234,7 @@
   string/cr->utf8
   :char-encodable-p (let ((bits (char-code |ch|))) (not (<= #xd800 bits #xdfff)))
   :newline-variant :cr
-  :handle-size nil
-  :count-chars %COUNT-CHARS/UTF-8/CR)
+  :handle-size nil)
 
 (define-external-format/variable-width (:utf-8 :utf8) t
   #+sb-unicode (code-char #xfffd) #-sb-unicode #\?
@@ -1468,15 +1449,6 @@
       (when (zerop (char-code |ch|)) (return count))))
   (error "~s modified while validating UTF-8" sap))
 
-(declaim (inline word-has-zero-bytes))
-(defun word-has-zero-bytes (word)
-  (declare (word word)
-           (optimize speed))
-  (let* ((ones (ldb (byte sb-vm:n-word-bits 0) #x0101010101010101))
-         (high-bits (* ones #x80)))
-    (logtest (logandc2 (- word ones) word)
-             high-bits)))
-
 (declaim (inline word-has-zero-or-negative-bytes))
 (defun word-has-zero-or-negative-bytes (word)
   (declare (word word)
diff --git a/src/code/fd-stream.lisp b/src/code/fd-stream.lisp
index da7fc1b70..5a80d4f62 100644
--- a/src/code/fd-stream.lisp
+++ b/src/code/fd-stream.lisp
@@ -1502,13 +1502,6 @@
   (when external-format
     (get-external-format external-format)))
 
-(defun variable-width-external-format-p (ef-entry)
-  ;; TODO: I'm pretty sure this is always true
-  (and ef-entry (not (null (ef-resync-fun ef-entry)))))
-
-(defun bytes-for-char-fun (ef-entry)
-  (if ef-entry (ef-bytes-for-char-fun ef-entry) (constantly 1)))
-
 (defmacro define-unibyte-mapping-external-format
     (canonical-name (&rest other-names) &body exceptions)
   (let ((->code-name (symbolicate canonical-name '->code-mapper))
@@ -1951,6 +1944,7 @@
         :count-chars ,(if (integerp in-size-expr)
                           in-size-expr
                           `#',count-chars-function)))))
+
 
 ;;;; utility functions (misc routines, etc)
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.