- (let* ((len (strlen s))
- (len4 (the fixnum (ash (the fixnum len) -2)))
- (end4 (the fixnum (ash (the fixnum len4) 2)))
- (remainder (the fixnum (- len end4)))
- (str (make-string len))
- (str4 str))
- (declare (type fixnum len len4 end4 remainder)
- (type (simple-array (signed-byte 32) (*)) str4)
- (type (simple-array (signed-byte 8) (*)) str))
- (dotimes (i len4)
- (declare (fixnum i))
- (setf (aref str4 i) (uffi:deref-array s '(:array :int) i)))
- (dotimes (i remainder)
- (declare (fixnum i))
- (setf (aref str end4) (uffi:deref-array s '(:array :char) end4))
- (incf end4))
- str))
+ (let* ((len (or len (strlen s)))
+ (str (make-string len)))
+ (dotimes (i len str)
+ (setf (schar str i) (code-char (uffi:deref-array s '(:array :unsigned-byte) i))))))