diff --git a/src/pcl/simple-streams/external-formats/utf-16.lisp b/src/pcl/simple-streams/external-formats/utf-16.lisp index d197aeadbb2bbb17ea1d8b155b4a3eafa0557f94..c8ad61a74d6c9ac47a0a1347efad97a7cc9bad37 100644 --- a/src/pcl/simple-streams/external-formats/utf-16.lisp +++ b/src/pcl/simple-streams/external-formats/utf-16.lisp @@ -52,7 +52,7 @@ Unicode replacement character.") ;; Big endian (including BOM, if any) (+ (* 256 ,c1) ,c2))) (,wd 2)) - (declare (type (integer 0 2) ,st) + (declare (type (member 0 -2 2) ,st) (type lisp:codepoint ,code)) ;; Note that if BOM is read, WD will be 2 but 4 octets have ;; actually been read: this is intentional - the returned diff --git a/src/pcl/simple-streams/external-formats/utf-32.lisp b/src/pcl/simple-streams/external-formats/utf-32.lisp index c0fa8200a230c277de5c7f64a8b502234bfca7b0..2520f4b464bdf4dc188781c78b110ff1642eb926 100644 --- a/src/pcl/simple-streams/external-formats/utf-32.lisp +++ b/src/pcl/simple-streams/external-formats/utf-32.lisp @@ -62,8 +62,9 @@ Unicode replacement character.") (ash ,c3 8) ,c4))) (,wd 4)) - (declare (type (integer 0 2) ,st) + (declare (type (member 0 -4 4) ,st) (type (unsigned-byte 8) ,c1 ,c2 ,c3 ,c4) + (type (unsigned-byte 32) ,code) (optimize (speed 3))) (cond ((or (>= ,code lisp:codepoint-limit) (lisp::surrogatep ,code))