Changeset 6538


Ignore:
Timestamp:
May 9, 2007, 11:58:07 AM (15 years ago)
Author:
gb
Message:

Keep bootsrapping separate character encode/decode limits.

Location:
trunk/ccl/level-1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/l1-streams.lisp

    r6495 r6538  
    395395  (encoding nil)
    396396  (pending-byte-order-mark nil)
    397   (literal-char-code-limit 256)
     397  (decode-literal-code-unit-limit 256)
    398398  (encode-output-function nil)
    399399  (decode-input-function nil)
     
    412412  (line-termination nil)
    413413  (unread-char-function 'ioblock-no-char-input)
    414   (reserved2 nil)
     414  (encode-literal-char-code-limit 256)
    415415  (reserved3 nil))
    416416
     
    11521152              (declare (type (unsigned-byte 8) 1st-unit))
    11531153            (if (< 1st-unit
    1154                    (the (mod #x110000) (ioblock-literal-char-code-limit ioblock)))
     1154                   (the (mod #x110000) (ioblock-decode-literal-code-unit-limit ioblock)))
    11551155              (%code-char 1st-unit)
    11561156              (funcall (ioblock-decode-input-function ioblock)
     
    11821182              (declare (type (unsigned-byte 16) 1st-unit))
    11831183            (if (< 1st-unit
    1184                    (the (mod #x110000) (ioblock-literal-char-code-limit ioblock)))
     1184                   (the (mod #x110000) (ioblock-decode-literal-code-unit-limit ioblock)))
    11851185              (code-char 1st-unit)
    11861186              (funcall (ioblock-decode-input-function ioblock)
     
    12121212              (declare (type (unsigned-byte 16) 1st-unit))
    12131213            (if (< 1st-unit
    1214                    (the (mod #x110000) (ioblock-literal-char-code-limit ioblock)))
     1214                   (the (mod #x110000) (ioblock-decode-literal-code-unit-limit ioblock)))
    12151215              (code-char 1st-unit)
    12161216              (funcall (ioblock-decode-input-function ioblock)
     
    12421242              (declare (type (unsigned-byte 16) 1st-unit))
    12431243            (if (< 1st-unit
    1244                    (the (mod #x110000) (ioblock-literal-char-code-limit ioblock)))
     1244                   (the (mod #x110000) (ioblock-decode-literal-code-unit-limit ioblock)))
    12451245              (code-char 1st-unit)
    12461246              (funcall (ioblock-decode-input-function ioblock)
     
    12721272              (declare (type (unsigned-byte 16) 1st-unit))
    12731273            (if (< 1st-unit
    1274                    (the (mod #x110000) (ioblock-literal-char-code-limit ioblock)))
     1274                   (the (mod #x110000) (ioblock-decode-literal-code-unit-limit ioblock)))
    12751275              (code-char 1st-unit)
    12761276              (funcall (ioblock-decode-input-function ioblock)
     
    18611861  (let* ((code (char-code char)))
    18621862    (declare (type (mod #x110000) code))
    1863     (if (< code (the fixnum (ioblock-literal-char-code-limit ioblock)))
     1863    (if (< code (the fixnum (ioblock-encode-literal-char-code-limit ioblock)))
    18641864      (%ioblock-write-u8-element ioblock code)
    18651865      (funcall (ioblock-encode-output-function ioblock)
     
    18851885  (do* ((i 0 (1+ i))
    18861886        (col (ioblock-charpos ioblock))
    1887         (limit (ioblock-literal-char-code-limit ioblock))
     1887        (limit (ioblock-encode-literal-char-code-limit ioblock))
    18881888        (encode-function (ioblock-encode-output-function ioblock))
    18891889        (start-char start-char (1+ start-char)))
     
    19121912  (let* ((code (char-code char)))
    19131913    (declare (type (mod #x110000) code))
    1914     (if (< code (the fixnum (ioblock-literal-char-code-limit ioblock)))
     1914    (if (< code (the fixnum (ioblock-encode-literal-char-code-limit ioblock)))
    19151915      (%ioblock-write-u16-code-unit ioblock code)
    19161916      (funcall (ioblock-encode-output-function ioblock)
     
    19391939  (do* ((i 0 (1+ i))
    19401940        (col (ioblock-charpos ioblock))
    1941         (limit (ioblock-literal-char-code-limit ioblock))
     1941        (limit (ioblock-encode-literal-char-code-limit ioblock))
    19421942        (encode-function (ioblock-encode-output-function ioblock))
    19431943        (start-char start-char (1+ start-char)))
     
    19621962  (let* ((code (char-code char)))
    19631963    (declare (type (mod #x110000) code))
    1964     (if (< code (the fixnum (ioblock-literal-char-code-limit ioblock)))
     1964    (if (< code (the fixnum (ioblock-encode-literal-char-code-limit ioblock)))
    19651965      (%ioblock-write-swapped-u16-code-unit ioblock code)
    19661966      (funcall (ioblock-encode-output-function ioblock)
     
    19851985  (do* ((i 0 (1+ i))
    19861986        (col (ioblock-charpos ioblock))
    1987         (limit (ioblock-literal-char-code-limit ioblock))
     1987        (limit (ioblock-encode-literal-char-code-limit ioblock))
    19881988        (encode-function (ioblock-encode-output-function ioblock))
    19891989        (wcf (ioblock-write-char-when-locked-function ioblock))
     
    20152015  (let* ((code (char-code char)))
    20162016    (declare (type (mod #x110000 code)))
    2017     (if (< code (the fixnum (ioblock-literal-char-code-limit ioblock)))
     2017    (if (< code (the fixnum (ioblock-encode-literal-char-code-limit ioblock)))
    20182018      (%ioblock-write-u32-code-unit ioblock code)
    20192019      (funcall (ioblock-encode-output-function ioblock)
     
    20412041  (do* ((i 0 (1+ i))
    20422042        (col (ioblock-charpos ioblock))
    2043         (limit (ioblock-literal-char-code-limit ioblock))
     2043        (limit (ioblock-encode-iteral-char-code-limit ioblock))
    20442044        (encode-function (ioblock-encode-output-function ioblock))
    20452045        (start-char start-char (1+ start-char)))
     
    20652065  (let* ((code (char-code char)))
    20662066    (declare (type (mod #x110000 code)))
    2067     (if (< code (the fixnum (ioblock-literal-char-code-limit ioblock)))
     2067    (if (< code (the fixnum (ioblock-encode-literal-char-code-limit ioblock)))
    20682068      (%ioblock-write-swapped-u32-code-unit ioblock code)
    20692069      (funcall (ioblock-encode-output-function ioblock)
     
    20882088  (do* ((i 0 (1+ i))
    20892089        (col (ioblock-charpos ioblock))
    2090         (limit (ioblock-literal-char-code-limit ioblock))
     2090        (limit (ioblock-encode-literal-char-code-limit ioblock))
    20912091        (encode-function (ioblock-encode-output-function ioblock))
    20922092        (start-char start-char (1+ start-char)))
     
    30333033      (setf (ioblock-owner ioblock) *current-process*))
    30343034    (setf (ioblock-encoding ioblock) encoding)
    3035     (setf (ioblock-literal-char-code-limit ioblock)
     3035    (setf (ioblock-decode-literal-code-unit-limit ioblock)
    30363036          (if encoding
    3037             (character-encoding-literal-char-code-limit encoding)
     3037            (character-encoding-decode-literal-code-unit-limit encoding)
     3038            256))
     3039    (setf (ioblock-encode-literal-char-code-limit ioblock)
     3040          (if encoding
     3041            (character-encoding-encode-literal-char-code-limit encoding)
    30383042            256))
    30393043    (when insize
  • trunk/ccl/level-1/l1-unicode.lisp

    r6537 r6538  
    8787
    8888  ;; Code units less than this value map to themselves on input.
    89   (literal-char-code-limit 0)
     89  (decode-literal-code-unit-limit 0)
    9090
    9191  ;; Does a byte-order-mark determine the endianness of input ?
     
    263263  :length-of-memory-encoding-function
    264264  #'8-bit-fixed-width-length-of-memory-encoding
    265   :literal-char-code-limit 256
     265  :decode-literal-code-unit-limit 256
    266266  :encode-literal-char-code-limit 256
    267267  )
     
    349349  :length-of-memory-encoding-function
    350350  #'8-bit-fixed-width-length-of-memory-encoding
    351   :literal-char-code-limit 128
     351  :decode-literal-code-unit-limit 128
    352352  :encode-literal-char-code-limit 128
    353353  )
     
    523523  :length-of-memory-encoding-function
    524524  #'8-bit-fixed-width-length-of-memory-encoding
    525   :literal-char-code-limit #xa0
     525  :decode-literal-code-unit-limit #xa0
    526526  :encode-literal-char-code-limit #xa0
    527527  )
     
    702702  :length-of-memory-encoding-function
    703703  #'8-bit-fixed-width-length-of-memory-encoding
    704   :literal-char-code-limit #xa0
     704  :decode-literal-code-unit-limit #xa0
    705705  :encode-literal-char-code-limit #xa0 
    706706  )
     
    874874  :length-of-memory-encoding-function
    875875  #'8-bit-fixed-width-length-of-memory-encoding
    876   :literal-char-code-limit #xa0
     876  :decode-literal-code-unit-limit #xa0
    877877  :encode-literal-char-code-limit #xa0 
    878878  )
     
    10261026  :length-of-memory-encoding-function
    10271027  #'8-bit-fixed-width-length-of-memory-encoding
    1028   :literal-char-code-limit #xa0
     1028  :decode-literal-code-unit-limit #xa0
    10291029  :encode-literal-char-code-limit #xa0
    10301030  )
     
    11751175  :length-of-memory-encoding-function
    11761176  #'8-bit-fixed-width-length-of-memory-encoding
    1177   :literal-char-code-limit #xa0
     1177  :decode-literal-code-unit-limit #xa0
    11781178  :encode-literal-char-code-limit #xa0 
    11791179  )
     
    13551355  :length-of-memory-encoding-function
    13561356  #'8-bit-fixed-width-length-of-memory-encoding
    1357   :literal-char-code-limit #xa0
     1357  :decode-literal-code-unit-limit #xa0
    13581358  :encode-literal-char-code-limit #xa0 
    13591359  )
     
    15211521  :length-of-memory-encoding-function
    15221522  #'8-bit-fixed-width-length-of-memory-encoding
    1523   :literal-char-code-limit #xa0
     1523  :decode-literal-code-unit-limit #xa0
    15241524  :encode-literal-char-code-limit #xa0 
    15251525  )
     
    16641664  :length-of-memory-encoding-function
    16651665  #'8-bit-fixed-width-length-of-memory-encoding
    1666   :literal-char-code-limit #xd0
     1666  :decode-literal-code-unit-limit #xd0
    16671667  :encode-literal-char-code-limit #xa0
    16681668  )
     
    18141814  :length-of-memory-encoding-function
    18151815  #'8-bit-fixed-width-length-of-memory-encoding
    1816   :literal-char-code-limit #xa0
     1816  :decode-literal-code-unit-limit #xa0
    18171817  :encode-literal-char-code-limit #xa0 
    18181818  )
     
    19241924  :length-of-memory-encoding-function
    19251925  #'8-bit-fixed-width-length-of-memory-encoding
    1926   :literal-char-code-limit #xa0
     1926  :decode-literal-code-unit-limit #xa0
    19271927  :encode-literal-char-code-limit #xa0 
    19281928  )
     
    20942094  :length-of-memory-encoding-function
    20952095  #'8-bit-fixed-width-length-of-memory-encoding
    2096   :literal-char-code-limit #xa0
     2096  :decode-literal-code-unit-limit #xa0
    20972097  :encode-literal-char-code-limit #xa0 
    20982098  )
     
    23032303  :length-of-memory-encoding-function
    23042304  #'8-bit-fixed-width-length-of-memory-encoding
    2305   :literal-char-code-limit #xa0
     2305  :decode-literal-code-unit-limit #xa0
    23062306  :encode-literal-char-code-limit #xa0 
    23072307  )
     
    24632463  :length-of-memory-encoding-function
    24642464  #'8-bit-fixed-width-length-of-memory-encoding
    2465   :literal-char-code-limit #xa0
     2465  :decode-literal-code-unit-limit #xa0
    24662466  :encode-literal-char-code-limit #xa0 
    24672467  )
     
    26442644  :length-of-memory-encoding-function
    26452645  #'8-bit-fixed-width-length-of-memory-encoding
    2646   :literal-char-code-limit #xa0
     2646  :decode-literal-code-unit-limit #xa0
    26472647  :encode-literal-char-code-limit #xa0 
    26482648  )
     
    30153015             (return (values nchars i))
    30163016             (setq nchars (1+ nchars) i nexti))))))
    3017     :literal-char-code-limit #x80
     3017    :decode-literal-code-unit-limit #x80
    30183018  :encode-literal-char-code-limit #x80   
    30193019    :bom-encoding #(#xef #xbb #xbf)
     
    32953295             (return (values nchars i))
    32963296             (setq i nexti nchars (1+ nchars)))))))
    3297     :literal-char-code-limit #xd800 
     3297    :decode-literal-code-unit-limit #xd800 
    32983298    :encode-literal-char-code-limit #x10000
    32993299    :nul-encoding #(0 0)
     
    34593459           (return (values nchars i))
    34603460           (setq i nexti nchars (1+ nchars)))))))
    3461   :literal-char-code-limit #xd800
     3461  :decode-literal-code-unit-limit #xd800
    34623462  :encode-literal-char-code-limit #x10000
    34633463  :nul-encoding #(0 0)
     
    36713671                   2
    36723672                   4)))))))
    3673   :literal-char-code-limit #xd800
     3673  :decode-literal-code-unit-limit #xd800
    36743674  :encode-literal-char-code-limit #x10000 
    36753675  :use-byte-order-mark
     
    37973797     (declare (ignore pointer))
    37983798     (values (floor noctets 2) (+ start noctets))))
    3799   :literal-char-code-limit #x10000
     3799  :decode-literal-code-unit-limit #x10000
    38003800  :encode-literal-char-code-limit #x10000 
    38013801  :nul-encoding #(0 0)
     
    38963896     (declare (ignore pointer))
    38973897     (values (floor noctets 2) (+ start noctets))))
    3898   :literal-char-code-limit #x10000
     3898  :decode-literal-code-unit-limit #x10000
    38993899  :encode-literal-char-code-limit #x10000
    39003900  :nul-encoding #(0 0)
     
    40174017          (decf noctets 2))))
    40184018     (values (floor noctets 2) (+ start noctets))))
    4019   :literal-char-code-limit #x10000
     4019  :decode-literal-code-unit-limit #x10000
    40204020  :encode-literal-char-code-limit #x10000 
    40214021  :use-byte-order-mark
     
    42034203     (declare (ignore pointer))
    42044204     (values (floor noctets 4) (+ start noctets))))
    4205   :literal-char-code-limit #x110000
     4205  :decode-literal-code-unit-limit #x110000
    42064206  :encode-literal-char-code-limit #x110000
    42074207  :nul-encoding #(0 0 0 0)
     
    43014301     (declare (ignore pointer))
    43024302     (values (floor noctets 4) (+ start noctets))))
    4303   :literal-char-code-limit #x110000
     4303  :decode-literal-code-unit-limit #x110000
    43044304  :encode-literal-char-code-limit #x110000
    43054305  :nul-encoding #(0 0 0 0) 
     
    44224422          (decf noctets 4))))
    44234423     (values (floor noctets 4) (+ start noctets))))
    4424   :literal-char-code-limit #x110000
     4424  :decode-literal-code-unit-limit #x110000
    44254425  :encode-literal-char-code-limit #x110000 
    44264426  :use-byte-order-mark
Note: See TracChangeset for help on using the changeset viewer.