Changeset 9593


Ignore:
Timestamp:
May 25, 2008, 7:05:33 AM (11 years ago)
Author:
gb
Message:

propagate changes from working-0711 branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-unicode.lisp

    r9454 r9593  
    37053705                  (fixnum p highbits))
    37063706         (cond ((< highbits 0)
    3707                 (setf (%get-unsigned-word pointer idx) code)
     3707                (setf (%get-unsigned-word pointer idx) #+big-endian-target code #+little-endian-target (%swap-u16 code))
    37083708                (incf idx 2))
    37093709               (t
    3710                 (setf (%get-unsigned-word pointer idx) (logior #xd800 (the fixnum (ash highbits -10))))
    3711 
    3712                 (setf (%get-unsigned-word pointer (the fixnum (+ idx 2))) (logior #xdc00 (the fixnum (logand highbits #x3ff))))
    3713                 (incf idx 4)))))))
     3710                (let* ((w1 (logior #xd800 (the fixnum (ash highbits -10))))
     3711                       (w2 (logior #xdc00 (the fixnum (logand highbits #x3ff)))))
     3712                  (declare (type (unsigned-byte 16) w1 w2))
     3713                (setf (%get-unsigned-word pointer idx)
     3714                      #+big-endian-target w1 #+little-endian-target (%swap-u16 w1))
     3715                (setf (%get-unsigned-word pointer (the fixnum (+ idx 2)))
     3716                      #+big-endian-target w2
     3717                      #+little-endian-target (%swap-u16 w2))
     3718                (incf idx 4))))))))
    37143719  :memory-decode-function
    37153720  (nfunction
     
    37993804                      (t #+little-endian-target t)))))
    38003805       (do* ((i start)
     3806             (j (+ i 2) (+ i 2))
     3807             (end (+ start noctets))
    38013808             (nchars 0 (1+ nchars)))
    3802             ((>= i noctets)
    3803              (if (= i noctets) nchars))
     3809            ((> j end) (values nchars i))
    38043810         (let* ((code (%get-unsigned-word pointer i)))
    38053811           (declare (type (unsigned-byte 16) code))
     
    47894795        (funcall (character-encoding-memory-encode-function encoding)
    47904796                 data pointer offset (+ data-offset (or start 0)) (+ data-offset (or end (length s))))))))
     4797
     4798(defun get-encoded-string (encoding-name pointer noctets)
     4799  (let* ((encoding (ensure-character-encoding encoding-name)))
     4800    (multiple-value-bind (nchars nused)
     4801        (funcall (character-encoding-length-of-memory-encoding-function encoding)
     4802                 pointer
     4803                 noctets
     4804                 0)
     4805      (let* ((string (make-string nchars)))
     4806        (funcall (character-encoding-memory-decode-function encoding)
     4807                 pointer
     4808                 nused
     4809                 0
     4810                 string)
     4811        string))))
     4812       
     4813
    47914814     
    47924815
Note: See TracChangeset for help on using the changeset viewer.