Changeset 61

Show
Ignore:
Timestamp:
05/25/08 23:43:22 (6 months ago)
Author:
eweitz
Message:

Ready for release

Location:
branches/edi
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • branches/edi/CHANGELOG

    r50 r61  
     1Version 1.0.0 
     22008-05-26 
     3More redesign for the sake of performance 
     4More checks for invalid data 
     5More tests 
     6Exported functions for length computation 
     7 
    18Version 0.15.3 
    292008-05-23 
  • branches/edi/conditions.lisp

    r55 r61  
    11;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: FLEXI-STREAMS; Base: 10 -*- 
    2 ;;; $Header: /usr/local/cvsrep/flexi-streams/conditions.lisp,v 1.8 2008/05/25 03:07:58 edi Exp $ 
     2;;; $Header: /usr/local/cvsrep/flexi-streams/conditions.lisp,v 1.9 2008/05/25 22:23:58 edi Exp $ 
    33 
    44;;; Copyright (c) 2005-2008, Dr. Edmund Weitz.  All rights reserved. 
     
    9494  (:documentation "Superclass for all errors related to external 
    9595formats.")) 
    96  
    97 (define-condition external-format-warning (external-format-condition warning) 
    98   () 
    99   (:documentation "Superclass for all warnings related to external 
    100 formats.")) 
    10196   
    10297(define-condition external-format-encoding-error (external-format-error) 
    10398  () 
    10499  (:documentation "Errors of this type are signalled if there is an 
    105 encoding problem.")) 
    106    
    107 (define-condition external-format-encoding-warning (external-format-warning) 
    108   () 
    109   (:documentation "Warnings of this type are signalled if there is an 
    110100encoding problem.")) 
    111101 
     
    117107         :format-arguments format-args 
    118108         :external-format external-format)) 
    119  
    120 (defun signal-encoding-warning (external-format format-control &rest format-args) 
    121   "Convenience function similar to WARN to signal conditions of type 
    122 EXTERNAL-FORMAT-ENCODING-WARNING." 
    123   (warn 'external-format-encoding-warning 
    124         :format-control format-control 
    125         :format-arguments format-args 
    126         :external-format external-format)) 
  • branches/edi/decode.lisp

    r59 r61  
    11;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: FLEXI-STREAMS; Base: 10 -*- 
    2 ;;; $Header: /usr/local/cvsrep/flexi-streams/decode.lisp,v 1.26 2008/05/25 20:44:03 edi Exp $ 
     2;;; $Header: /usr/local/cvsrep/flexi-streams/decode.lisp,v 1.29 2008/05/25 23:19:19 edi Exp $ 
    33 
    44;;; Copyright (c) 2005-2008, Dr. Edmund Weitz.  All rights reserved. 
     
    203203         (declare (fixnum start end)) 
    204204         (let* ((i start) 
    205                 (string-length (compute-number-of-chars format sequence start end nil)) 
     205                (string-length (compute-number-of-chars format sequence start end)) 
    206206                (string (make-array string-length :element-type 'char*))) 
    207207           (declare (fixnum i string-length)) 
     
    224224similar for CRLF-FORMAT-CLASS, i.e. LF-FORMAT-CLASS is the base class. 
    225225BODY is a code template for the code to read octets and return one 
    226 character.  BODY must contain a symbol OCTET-GETTER representing the 
    227 form which is used to obtain the next octet." 
    228   `(progn 
    229      (defmethod octets-to-char-code ((format ,lf-format-class) reader) 
    230        (declare #.*fixnum-optimize-settings*) 
    231        (declare (function reader)) 
    232        (symbol-macrolet ((octet-getter (funcall reader))) 
    233          ,@(sublis '((char-decoder . octets-to-char-code)) 
    234                    body))) 
    235      (define-sequence-readers (,lf-format-class) ,@body) 
    236      (define-sequence-readers (,cr-format-class) 
    237        ,(with-unique-names (char-code) 
    238           `(let ((,char-code (progn ,@body))) 
    239              (case ,char-code 
    240                (#.+cr+ #.(char-code #\Newline)) 
    241                (otherwise ,char-code))))) 
    242      (define-sequence-readers  (,crlf-format-class) 
    243        ,(with-unique-names (char-code next-char-code get-char-code) 
    244           `(flet ((,get-char-code () ,@body)) 
    245              (let ((,char-code (,get-char-code))) 
     226character code.  BODY must contain a symbol OCTET-GETTER representing 
     227the form which is used to obtain the next octet." 
     228  (let* ((body (with-unique-names (char-code) 
     229                 `((let ((,char-code (progn ,@body))) 
     230                     (when (and ,char-code 
     231                                (or (<= #xd8 (logand* #x00ff (ash* ,char-code -8)) #xdf) 
     232                                    (> ,char-code #x10ffff))) 
     233                       (recover-from-encoding-error format "Illegal code point ~A \(#x~:*~X)." ,char-code)) 
     234                     ,char-code))))) 
     235    `(progn 
     236       (defmethod octets-to-char-code ((format ,lf-format-class) reader) 
     237         (declare #.*fixnum-optimize-settings*) 
     238         (declare (function reader)) 
     239         (symbol-macrolet ((octet-getter (funcall reader))) 
     240           ,@(sublis '((char-decoder . octets-to-char-code)) 
     241                     body))) 
     242       (define-sequence-readers (,lf-format-class) ,@body) 
     243       (define-sequence-readers (,cr-format-class) 
     244         ,(with-unique-names (char-code) 
     245            `(let ((,char-code (progn ,@body))) 
    246246               (case ,char-code 
    247                  (#.+cr+ 
    248                   (let ((,next-char-code (,get-char-code))) 
    249                     (case ,next-char-code 
    250                       (#.+lf+ #.(char-code #\Newline)) 
    251                       ;; we saw a CR but no LF afterwards, but then the data 
    252                       ;; ended, so we just return #\Return 
    253                       ((nil) +cr+) 
    254                       ;; if the character we peeked at wasn't a 
    255                       ;; linefeed character we unread its constituents 
    256                       (otherwise (unget (code-char ,next-char-code)) 
    257                                  ,char-code)))) 
    258                  (otherwise ,char-code)))))))) 
     247                 (#.+cr+ #.(char-code #\Newline)) 
     248                 (otherwise ,char-code))))) 
     249       (define-sequence-readers  (,crlf-format-class) 
     250         ,(with-unique-names (char-code next-char-code get-char-code) 
     251            `(flet ((,get-char-code () ,@body)) 
     252               (let ((,char-code (,get-char-code))) 
     253                 (case ,char-code 
     254                   (#.+cr+ 
     255                    (let ((,next-char-code (,get-char-code))) 
     256                      (case ,next-char-code 
     257                        (#.+lf+ #.(char-code #\Newline)) 
     258                        ;; we saw a CR but no LF afterwards, but then the data 
     259                        ;; ended, so we just return #\Return 
     260                        ((nil) +cr+) 
     261                        ;; if the character we peeked at wasn't a 
     262                        ;; linefeed character we unread its constituents 
     263                        (otherwise (unget (code-char ,next-char-code)) 
     264                                   ,char-code)))) 
     265                   (otherwise ,char-code))))))))) 
    259266 
    260267(define-char-decoders (flexi-latin-1-format flexi-cr-latin-1-format flexi-crlf-latin-1-format) 
     
    297304            (cond ((not (logbitp 7 octet)) 
    298305                   (values octet 0)) 
    299                   ((= #b11000000 (logand octet #b11100000)) 
    300                    (values (logand octet #b00011111) 1)) 
    301                   ((= #b11100000 (logand octet #b11110000)) 
    302                    (values (logand octet #b00001111) 2)) 
    303                   ((= #b11110000 (logand octet #b11111000)) 
    304                    (values (logand octet #b00000111) 3)) 
     306                  ((= #b11000000 (logand* octet #b11100000)) 
     307                   (when (= #b11000000 (logand* octet #b11111110)) 
     308                     (return-from char-decoder 
     309                       (recover-from-encoding-error format 
     310                                                    "Illegal value #x~X leads to `overlong' UTF-8 sequence." 
     311                                                    octet))) 
     312                   (values (logand* octet #b00011111) 1)) 
     313                  ((= #b11100000 (logand* octet #b11110000)) 
     314                   (values (logand* octet #b00001111) 2)) 
     315                  ((= #b11110000 (logand* octet #b11111000)) 
     316                   (values (logand* octet #b00000111) 3)) 
    305317                  (t (return-from char-decoder 
    306318                       (recover-from-encoding-error format 
     
    308320                                                    octet)))) 
    309321          (declare (fixnum count)) 
    310           ;; note that we currently don't check for "overlong" 
    311           ;; sequences or other illegal values 
    312322          (loop for result of-type code-point 
    313                 = start then (+ (ash result 6) 
    314                                 (logand octet #b111111)) 
     323                = start then (+ (ash* result 6) 
     324                                (logand* octet #b111111)) 
    315325                repeat count 
    316326                for octet of-type octet = (read-next-byte) 
    317                 unless (= #b10000000 (logand octet #b11000000)) 
     327                unless (= #b10000000 (logand* octet #b11000000)) 
    318328                do (return-from char-decoder 
    319329                     (recover-from-encoding-error format 
     
    335345      (flet ((read-next-word () 
    336346               (+ (the octet (read-next-byte)) 
    337                   (ash (the octet (read-next-byte)) 8)))) 
     347                  (ash* (the octet (read-next-byte)) 8)))) 
    338348        (declare (inline read-next-word)) 
    339349        (let ((word (read-next-word))) 
     
    347357                                                    "Unexpected UTF-16 word #x~X following #x~X." 
    348358                                                    next-word word))) 
    349                    (+ (ash (logand #b1111111111 word) 10) 
    350                       (logand #b1111111111 next-word) 
     359                   (+ (ash* (logand* #b1111111111 word) 10) 
     360                      (logand* #b1111111111 next-word) 
    351361                      #x10000))) 
    352362                (t word))))))) 
     
    365375                    (setq first-octet-seen t)))) 
    366376      (flet ((read-next-word () 
    367                (+ (ash (the octet (read-next-byte)) 8) 
     377               (+ (ash* (the octet (read-next-byte)) 8) 
    368378                  (the octet (read-next-byte))))) 
    369379        (declare (inline read-next-word)) 
     
    378388                                                    "Unexpected UTF-16 word #x~X following #x~X." 
    379389                                                    next-word word))) 
    380                    (+ (ash (logand #b1111111111 word) 10) 
    381                       (logand #b1111111111 next-word) 
     390                   (+ (ash* (logand* #b1111111111 word) 10) 
     391                      (logand* #b1111111111 next-word) 
    382392                      #x10000))) 
    383393                (t word))))))) 
     
    397407      (loop for count of-type fixnum from 0 to 24 by 8 
    398408            for octet of-type octet = (read-next-byte) 
    399             sum (ash octet count))))) 
     409            sum (ash* octet count))))) 
    400410 
    401411(define-char-decoders (flexi-utf-32-be-format flexi-cr-utf-32-be-format flexi-crlf-utf-32-be-format) 
     
    413423      (loop for count of-type fixnum from 24 downto 0 by 8 
    414424            for octet of-type octet = (read-next-byte) 
    415             sum (ash octet count))))) 
     425            sum (ash* octet count))))) 
    416426 
    417427(defmethod octets-to-char-code ((format flexi-cr-mixin) reader) 
  • branches/edi/doc/index.html

    r58 r61  
    7373      <li><a href="#external-format-condition-external-format"><code>external-format-condition-external-format</code></a> 
    7474      <li><a href="#external-format-error"><code>external-format-error</code></a> 
    75       <li><a href="#external-format-warning"><code>external-format-warning</code></a> 
    7675      <li><a href="#external-format-encoding-error"><code>external-format-encoding-error</code></a> 
    7776      <li><a href="#*substitution-char*"><code>*substitution-char*</code></a> 
     
    230229FLEXI-STREAMS together with this documentation can be downloaded from <a 
    231230href="http://weitz.de/files/flexi-streams.tar.gz">http://weitz.de/files/flexi-streams.tar.gz</a>. The 
    232 current version is 0.15.3. 
     231current version is 1.0.0. 
    233232<p> 
    234233Before you install FLEXI-STREAMS you first need to 
     
    549548 
    550549<p><br>[Condition] 
    551 <br><a class=none name="external-format-warning"><b>external-format-warning</b></a> 
    552  
    553 <blockquote><br> 
    554 All warnings related to <a href="#external-formats">external formats</a> are of this type. 
    555 This is a subtype of <a href="#external-format-condition"><code>EXTERNAL-FORMAT-CONDITION</code></a>. 
    556 </blockquote> 
    557  
    558 <p><br>[Condition] 
    559550<br><a class=none name="external-format-error"><b>external-format-error</b></a> 
    560551 
     
    10641055<code><i>start</i></code> and <code><i>end</i></code> 
    10651056are <code>0</code> and the length of the sequence.  The default 
    1066 for <code><i>external-format</i></code> is <code>:LATIN1</code>. 
     1057for <code><i>external-format</i></code> is <code>:LATIN1</code>.  Note that this function doesn't check for the validity of the data in <code><i>sequence</i></code>. 
    10671058<p> 
    10681059This function is optimized for the case 
     
    11111102 
    11121103<p> 
    1113 $Header: /usr/local/cvsrep/flexi-streams/doc/index.html,v 1.116 2008/05/25 19:07:55 edi Exp $ 
     1104$Header: /usr/local/cvsrep/flexi-streams/doc/index.html,v 1.119 2008/05/25 23:42:30 edi Exp $ 
    11141105<p><a href="http://weitz.de/index.html">BACK TO MY HOMEPAGE</a> 
    11151106 
  • branches/edi/flexi-streams.asd

    r57 r61  
    11;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- 
    2 ;;; $Header: /usr/local/cvsrep/flexi-streams/flexi-streams.asd,v 1.70 2008/05/25 12:26:02 edi Exp $ 
     2;;; $Header: /usr/local/cvsrep/flexi-streams/flexi-streams.asd,v 1.71 2008/05/25 23:42:28 edi Exp $ 
    33 
    44;;; Copyright (c) 2005-2008, Dr. Edmund Weitz.  All rights reserved. 
     
    3636 
    3737(defsystem :flexi-streams 
    38   :version "0.15.3" 
     38  :version "1.0.0" 
    3939  :serial t 
    4040  :components ((:file "packages") 
  • branches/edi/length.lisp

    r58 r61  
    11;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: FLEXI-STREAMS; Base: 10 -*- 
    2 ;;; $Header: /usr/local/cvsrep/flexi-streams/length.lisp,v 1.3 2008/05/25 20:15:28 edi Exp $ 
     2;;; $Header: /usr/local/cvsrep/flexi-streams/length.lisp,v 1.4 2008/05/25 22:23:58 edi Exp $ 
    33 
    44;;; Copyright (c) 2005-2008, Dr. Edmund Weitz.  All rights reserved. 
     
    7373  (* 1.02d0 (call-next-method))) 
    7474 
    75 (defgeneric check-end (format start end i warnp) 
     75(defgeneric check-end (format start end i) 
    7676  (declare #.*fixnum-optimize-settings*) 
    7777  (:documentation "Helper function used below to determine if we tried 
    7878to read past the end of the sequence.") 
    79   (:method (format start end i warnp) 
     79  (:method (format start end i) 
    8080   (declare #.*fixnum-optimize-settings*) 
    8181   (declare (fixnum start end i)) 
    82    (when (and warnp (> i end)) 
    83      (signal-encoding-warning format "These ~A octet~:P can't be ~ 
     82   (when (> i end) 
     83     (signal-encoding-error format "These ~A octet~:P can't be ~ 
    8484decoded using ~A as the sequence is too short.  ~A octet~:P missing ~ 
    8585at then end." 
    86                               (- end start) 
    87                               (external-format-name format) 
    88                               (- i end)))) 
    89   (:method ((format flexi-utf-16-format) start end i warnp) 
     86                            (- end start) 
     87                            (external-format-name format) 
     88                            (- i end)))) 
     89  (:method ((format flexi-utf-16-format) start end i) 
    9090   (declare #.*fixnum-optimize-settings*) 
    9191   (declare (fixnum start end i)) 
    92    (declare (ignore i warnp)) 
     92   (declare (ignore i)) 
    9393   ;; don't warn twice 
    9494   (when (evenp (- end start)) 
    9595     (call-next-method)))) 
    9696 
    97 (defgeneric compute-number-of-chars (format sequence start end warnp) 
     97(defgeneric compute-number-of-chars (format sequence start end) 
    9898  (declare #.*standard-optimize-settings*) 
    9999  (:documentation "Computes the exact number of characters required to 
    100100decode the sequence of octets in SEQUENCE from START to END using the 
    101 external format FORMAT.  If WARNP is NIL, warnings will be muffled.")) 
    102  
    103 (defmethod compute-number-of-chars :around (format (list list) start end warnp) 
    104   (declare #.*standard-optimize-settings*) 
    105   (call-next-method format (coerce list 'vector) start end warnp)) 
    106  
    107 (defmethod compute-number-of-chars ((format flexi-8-bit-format) sequence start end warnp) 
    108   (declare #.*fixnum-optimize-settings*) 
    109   (declare (fixnum start end)) 
    110   (declare (ignore sequence warnp)) 
     101external format FORMAT.")) 
     102 
     103(defmethod compute-number-of-chars :around (format (list list) start end) 
     104  (declare #.*standard-optimize-settings*) 
     105  (call-next-method format (coerce list 'vector) start end)) 
     106 
     107(defmethod compute-number-of-chars ((format flexi-8-bit-format) sequence start end) 
     108  (declare #.*fixnum-optimize-settings*) 
     109  (declare (fixnum start end)) 
     110  (declare (ignore sequence)) 
    111111  (- end start)) 
    112112 
    113 (defmethod compute-number-of-chars ((format flexi-crlf-mixin) sequence start end warnp) 
     113(defmethod compute-number-of-chars ((format flexi-crlf-mixin) sequence start end) 
    114114  ;; this method only applies to the 8-bit formats as all other 
    115115  ;; formats with CRLF line endings have their own specialized methods 
     
    117117  (declare #.*fixnum-optimize-settings*) 
    118118  (declare (fixnum start end) (vector sequence)) 
    119   (declare (ignore warnp)) 
    120119  (let ((i start) 
    121120        (length (- end start))) 
     
    131130    length)) 
    132131 
    133 (defmethod compute-number-of-chars ((format flexi-utf-8-format) sequence start end warnp) 
     132(defmethod compute-number-of-chars ((format flexi-utf-8-format) sequence start end) 
    134133  (declare #.*fixnum-optimize-settings*) 
    135134  (declare (fixnum start end) (vector sequence)) 
     
    141140       (return)) 
    142141     (let* ((octet (aref sequence i)) 
     142            ;; note that there are no validity checks here 
    143143            (length (cond ((not (logbitp 7 octet)) 1) 
    144                           ((= #b11000000 (logand octet #b11100000)) 2) 
    145                           ((= #b11100000 (logand octet #b11110000)) 3) 
     144                          ((= #b11000000 (logand* octet #b11100000)) 2) 
     145                          ((= #b11100000 (logand* octet #b11110000)) 3) 
    146146                          (t 4)))) 
    147147       (declare (fixnum length) (type octet octet)) 
    148148       (incf sum) 
    149149       (incf i length))) 
    150     (check-end format start end i warnp) 
    151     sum)) 
    152  
    153 (defmethod compute-number-of-chars ((format flexi-crlf-utf-8-format) sequence start end warnp) 
     150    (check-end format start end i) 
     151    sum)) 
     152 
     153(defmethod compute-number-of-chars ((format flexi-crlf-utf-8-format) sequence start end) 
    154154  (declare #.*fixnum-optimize-settings*) 
    155155  (declare (fixnum start end) (vector sequence)) 
     
    162162       (return)) 
    163163     (let* ((octet (aref sequence i)) 
     164            ;; note that there are no validity checks here 
    164165            (length (cond ((not (logbitp 7 octet)) 1) 
    165                           ((= #b11000000 (logand octet #b11100000)) 2) 
    166                           ((= #b11100000 (logand octet #b11110000)) 3) 
     166                          ((= #b11000000 (logand* octet #b11100000)) 2) 
     167                          ((= #b11100000 (logand* octet #b11110000)) 3) 
    167168                          (t 4)))) 
    168169       (declare (fixnum length) (type octet octet)) 
     
    171172       (incf i length) 
    172173       (setq last-octet octet))) 
    173     (check-end format start end i warnp) 
    174     sum)) 
    175  
    176 (defmethod compute-number-of-chars :before ((format flexi-utf-16-format) sequence start end warnp) 
     174    (check-end format start end i) 
     175    sum)) 
     176 
     177(defmethod compute-number-of-chars :before ((format flexi-utf-16-format) sequence start end) 
    177178  (declare #.*fixnum-optimize-settings*) 
    178179  (declare (fixnum start end) (vector sequence)) 
    179180  (declare (ignore sequence)) 
    180   (when (and warnp (oddp (- end start))) 
    181     (signal-encoding-warning format "~A octet~:P cannot be decoded ~ 
     181  (when (oddp (- end start)) 
     182    (signal-encoding-error format "~A octet~:P cannot be decoded ~ 
    182183using UTF-16 as ~:*~A is not even." 
    183                              (- end start))))   
     184                           (- end start)))) 
    184185   
    185 (defmethod compute-number-of-chars ((format flexi-utf-16-le-format) sequence start end warnp) 
     186(defmethod compute-number-of-chars ((format flexi-utf-16-le-format) sequence start end) 
    186187  (declare #.*fixnum-optimize-settings*) 
    187188  (declare (fixnum start end)) 
     
    199200       (incf sum) 
    200201       (incf i length))) 
    201     (check-end format start (+ end 2) i warnp) 
    202     sum)) 
    203  
    204 (defmethod compute-number-of-chars ((format flexi-utf-16-be-format) sequence start end warnp) 
     202    (check-end format start (+ end 2) i) 
     203    sum)) 
     204 
     205(defmethod compute-number-of-chars ((format flexi-utf-16-be-format) sequence start end) 
    205206  (declare #.*fixnum-optimize-settings*) 
    206207  (declare (fixnum start end) (vector sequence)) 
     
    218219       (incf sum) 
    219220       (incf i length))) 
    220     (check-end format start (+ end 2) i warnp) 
    221     sum)) 
    222  
    223 (defmethod compute-number-of-chars ((format flexi-crlf-utf-16-le-format) sequence start end warnp) 
     221    (check-end format start (+ end 2) i) 
     222    sum)) 
     223 
     224(defmethod compute-number-of-chars ((format flexi-crlf-utf-16-le-format) sequence start end) 
    224225  (declare #.*fixnum-optimize-settings*) 
    225226  (declare (fixnum start end) (vector sequence)) 
     
    244245                          0)) 
    245246       (incf i length))) 
    246     (check-end format start (+ end 2) i warnp) 
    247     sum)) 
    248  
    249 (defmethod compute-number-of-chars ((format flexi-crlf-utf-16-be-format) sequence start end warnp) 
     247    (check-end format start (+ end 2) i) 
     248    sum)) 
     249 
     250(defmethod compute-number-of-chars ((format flexi-crlf-utf-16-be-format) sequence start end) 
    250251  (declare #.*fixnum-optimize-settings*) 
    251252  (declare (fixnum start end) (vector sequence)) 
     
    270271                          0)) 
    271272       (incf i length))) 
    272     (check-end format start (+ end 2) i warnp) 
    273     sum)) 
    274  
    275 (defmethod compute-number-of-chars :before ((format flexi-utf-32-format) sequence start end warnp) 
     273    (check-end format start (+ end 2) i) 
     274    sum)) 
     275 
     276(defmethod compute-number-of-chars :before ((format flexi-utf-32-format) sequence start end) 
    276277  (declare #.*fixnum-optimize-settings*) 
    277278  (declare (fixnum start end)) 
    278279  (declare (ignore sequence)) 
    279280  (let ((length (- end start))) 
    280     (when (and warnp (plusp (mod length 4))) 
    281       (signal-encoding-warning format "~A octet~:P cannot be decoded ~ 
     281    (when (plusp (mod length 4)) 
     282      (signal-encoding-error format "~A octet~:P cannot be decoded ~ 
    282283using UTF-32 as ~:*~A is not a multiple-value of four." 
    283                                length)))) 
    284  
    285 (defmethod compute-number-of-chars ((format flexi-utf-32-format) sequence start end warnp) 
    286   (declare #.*fixnum-optimize-settings*) 
    287   (declare (fixnum start end)) 
    288   (declare (ignore sequence warnp)) 
     284                             length)))) 
     285 
     286(defmethod compute-number-of-chars ((format flexi-utf-32-format) sequence start end) 
     287  (declare #.*fixnum-optimize-settings*) 
     288  (declare (fixnum start end)) 
     289  (declare (ignore sequence)) 
    289290  (ceiling (- end start) 4)) 
    290291 
    291 (defmethod compute-number-of-chars ((format flexi-crlf-utf-32-le-format) sequence start end warnp) 
    292   (declare #.*fixnum-optimize-settings*) 
    293   (declare (fixnum start end) (vector sequence)) 
    294   (declare (ignore warnp)) 
     292(defmethod compute-number-of-chars ((format flexi-crlf-utf-32-le-format) sequence start end) 
     293  (declare #.*fixnum-optimize-settings*) 
     294  (declare (fixnum start end) (vector sequence)) 
    295295  (let ((i start) 
    296296        (length (ceiling (- end start) 4))) 
     
    307307    length)) 
    308308 
    309 (defmethod compute-number-of-chars ((format flexi-crlf-utf-32-be-format) sequence start end warnp) 
    310   (declare #.*fixnum-optimize-settings*) 
    311   (declare (fixnum start end) (vector sequence)) 
    312   (declare (ignore warnp)) 
     309(defmethod compute-number-of-chars ((format flexi-crlf-utf-32-be-format) sequence start end) 
     310  (declare #.*fixnum-optimize-settings*) 
     311  (declare (fixnum start end) (vector sequence)) 
    313312  (let ((i start) 
    314313        (length (ceiling (- end start) 4))) 
  • branches/edi/packages.lisp

    r55 r61  
    11;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- 
    2 ;;; $Header: /usr/local/cvsrep/flexi-streams/packages.lisp,v 1.37 2008/05/25 03:07:59 edi Exp $ 
     2;;; $Header: /usr/local/cvsrep/flexi-streams/packages.lisp,v 1.38 2008/05/25 22:23:58 edi Exp $ 
    33 
    44;;; Copyright (c) 2005-2008, Dr. Edmund Weitz.  All rights reserved. 
     
    4747           :external-format-error 
    4848           :external-format-encoding-error 
    49            :external-format-encoding-warning 
    5049           :external-format-equal 
    5150           :external-format-id 
    5251           :external-format-little-endian 
    5352           :external-format-name 
    54            :external-format-warning 
    5553           :flexi-input-stream 
    5654           :flexi-output-stream 
  • branches/edi/strings.lisp

    r58 r61