0.9.15.48: more precice unions of array types
[sbcl.git] / src / code / octets.lisp
index f743a4b..b86a1be 100644 (file)
@@ -221,6 +221,7 @@ one-past-the-end"
 (defun get-latin-bytes (mapper external-format string pos end)
   (declare (ignore end))
   (let ((code (funcall mapper (char-code (char string pos)))))
+    (declare (type (or null char-code) code))
     (values (cond
               ((and code (< code 256)) code)
               (t
@@ -640,13 +641,16 @@ one-past-the-end"
 
 (defun default-external-format ()
   (or *default-external-format*
-      (let ((external-format (intern (or #!-win32 (sb!alien:alien-funcall
-                                          (extern-alien
-                                           "nl_langinfo"
-                                           (function c-string int))
-                                          sb!unix:codeset)
-                                         "LATIN-1")
-                                     "KEYWORD")))
+      (let ((external-format #!-win32 (intern (or (sb!alien:alien-funcall
+                                                    (extern-alien
+                                                      "nl_langinfo"
+                                                      (function c-string int))
+                                                    sb!unix:codeset)
+                                                  "LATIN-1")
+                                              "KEYWORD")
+                             #!+win32
+                               #!+sb-unicode (sb!win32::ansi-codepage)
+                               #!-sb-unicode :LATIN-1))
         (/show0 "cold-printing defaulted external-format:")
         #!+sb-show
         (cold-print external-format)