X-Git-Url: http://git.kpe.io/?p=cl-base64.git;a=blobdiff_plain;f=decode.lisp;h=3b618041374e5c3ecc44f14b74072c42f171b36f;hp=775bb8ef92ef512777b3d36d8cbe7ea1cc1bd3cf;hb=82add2747ad25aafe558e51660b41286d1e39b77;hpb=8d11e40eb06556b995b963ee7c72e59a5368d21e diff --git a/decode.lisp b/decode.lisp index 775bb8e..3b61804 100644 --- a/decode.lisp +++ b/decode.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Dec 2002 ;;;; -;;;; $Id: decode.lisp,v 1.2 2003/01/12 22:32:40 kevin Exp $ +;;;; $Id: decode.lisp,v 1.5 2003/05/06 16:21:06 kevin Exp $ ;;;; ;;;; This file implements the Base64 transfer encoding algorithm as ;;;; defined in RFC 1521 by Borensten & Freed, September 1993. @@ -19,10 +19,12 @@ ;;;; Permission to use with BSD-style license included in the COPYING file ;;;; ************************************************************************* -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) - (in-package #:cl-base64) +(eval-when (:compile-toplevel) + (declaim (optimize (space 0) (speed 3) (safety 1) (compilation-speed 0)))) + + (declaim (inline whitespace-p)) (defun whitespace-p (c) "Returns T for a whitespace character." @@ -61,7 +63,7 @@ (:string '((simple-string result))) (:usb8-array - '((type (array fixnum (*)) result)))) + '((type (simple-array (usigned-byte 8) (*)) result)))) (fixnum ridx)) (do* ((bitstore 0) (bitcount 0) @@ -71,8 +73,11 @@ ,(case output-type (:stream 'stream) - ((or :stream :string) - '(subseq result 0 ridx)))) + ((:string :usb8-array) + 'result) + ;; ((:stream :string) + ;; '(subseq result 0 ridx)))) + )) (declare (fixnum bitstore bitcount) (character char)) (let ((svalue (aref decode-table (the fixnum (char-code char))))) @@ -143,7 +148,7 @@ (:string '((simple-string result))) (:usb8-array - '((type (array fixnum (*)) result)))) + '((type (simple-array (unsigned-byte 8) (*)) result)))) (fixnum ridx)) (loop for char of-type character across input @@ -189,7 +194,7 @@ ,(case output-type (:stream 'stream) - ((:stream :string) + ((:usb8-array :string) '(subseq result 0 ridx))))))) (def-base64-string-to-* :string)