Skip to content
Snippets Groups Projects
Commit 91e0d56b authored by rtoy's avatar rtoy
Browse files

Oops. The type of code is not a 16-bit unsigned integer. It's a

lisp:codepoint.
parent 35feec09
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
;;; This code was written by Paul Foley and has been placed in the public ;;; This code was written by Paul Foley and has been placed in the public
;;; domain. ;;; domain.
;;; ;;;
(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-16-be.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") (ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-16-be.lisp,v 1.3 2009/09/30 16:12:41 rtoy Exp $")
(in-package "STREAM") (in-package "STREAM")
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
`(let* ((,c1 ,input) `(let* ((,c1 ,input)
(,c2 ,input) (,c2 ,input)
(,code (+ (* 256 ,c1) ,c2))) (,code (+ (* 256 ,c1) ,c2)))
(declare (type (integer 0 #xffff) ,code)) (declare (type lisp:codepoint ,code))
(cond ((lisp::surrogatep ,code :low) (cond ((lisp::surrogatep ,code :low)
(setf ,code +replacement-character-code+)) (setf ,code +replacement-character-code+))
((lisp::surrogatep ,code :high) ((lisp::surrogatep ,code :high)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
;;; This code was written by Paul Foley and has been placed in the public ;;; This code was written by Paul Foley and has been placed in the public
;;; domain. ;;; domain.
;;; ;;;
(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-16-le.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") (ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-16-le.lisp,v 1.3 2009/09/30 16:12:41 rtoy Exp $")
(in-package "STREAM") (in-package "STREAM")
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
`(let* ((,c1 ,input) `(let* ((,c1 ,input)
(,c2 ,input) (,c2 ,input)
(,code (+ (* 256 ,c2) ,c1))) (,code (+ (* 256 ,c2) ,c1)))
(declare (type (integer 0 #xffff) ,code)) (declare (type lisp:codepoint ,code))
(cond ((lisp::surrogatep ,code :low) (cond ((lisp::surrogatep ,code :low)
;; Replace with REPLACEMENT CHARACTER. ;; Replace with REPLACEMENT CHARACTER.
(setf ,code +replacement-character-code+)) (setf ,code +replacement-character-code+))
......
;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Package: STREAM -*- ;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Package: STREAM -*-
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-16.lisp,v 1.3 2009/09/09 15:51:28 rtoy Rel $") (ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-16.lisp,v 1.4 2009/09/30 16:12:41 rtoy Exp $")
(in-package "STREAM") (in-package "STREAM")
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
(+ (* 256 ,c1) ,c2))) (+ (* 256 ,c1) ,c2)))
(,wd 2)) (,wd 2))
(declare (type (integer 0 2) ,st) (declare (type (integer 0 2) ,st)
(type (integer 0 #xffff) ,code)) (type lisp:codepoint ,code))
;; Note that if BOM is read, WD will be 2 but 4 octets have ;; Note that if BOM is read, WD will be 2 but 4 octets have
;; actually been read: this is intentional - the returned ;; actually been read: this is intentional - the returned
;; width tells how much to back up to unread a character, and ;; width tells how much to back up to unread a character, and
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment