Skip to content

Commit

Permalink
Arrays will now handle type declarations better, and (unsigned-byte 8…
Browse files Browse the repository at this point in the history
…) will resolve to a byte array.
  • Loading branch information
rgcorman committed Jan 17, 2017
1 parent 590316e commit ac2168b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Sys/array.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,10 @@
;;;
(defun upgraded-array-element-type (element-type &optional environment)
(declare (ignore environment))
(if (member element-type '(bit byte character double-float single-float short-integer))
element-type
(if (or (eq element-type 'base-char)(eq element-type 'standard-char))
'character
't)))
(cond ((member element-type '(bit byte character double-float single-float short-integer)) element-type)
((or (eq element-type 'base-char)(eq element-type 'standard-char)) 'character)
((equal element-type '(unsigned-byte 8)) 'byte)
(t 't)))

;;;
;;; Common Lisp ARRAY-DISPLACEMENT function.
Expand All @@ -396,7 +395,7 @@
(if (integerp dimensions)
(setq dimensions (list dimensions)))

(setq element-type (upgraded-array-element-type element-type))
(setq element-type (upgraded-array-element-type (typeexpand-all element-type)))

;; if we are displacing to an already displaced array, add the offsets
(when (and displaced-to displaced-index-offset (array-displacement displaced-to))
Expand Down

0 comments on commit ac2168b

Please sign in to comment.