Changeset 5063


Ignore:
Timestamp:
Sep 2, 2006, 9:55:07 AM (18 years ago)
Author:
Gary Byers
Message:

%CSTR-POINTER and %CSTR-SEGMENT-POINTER: don't assume 8-bit chars.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-0/l0-aprims.lisp

    r4640 r5063  
    5959  (multiple-value-bind (s o n) (dereference-base-string string)
    6060    (declare (fixnum o n))
    61     (%copy-ivector-to-ptr s o pointer 0 n)
     61    (do* ((i 0 (1+ i))
     62          (o o (1+ o)))
     63         ((= i n))
     64      (declare (fixnum i o))
     65      (setf (%get-unsigned-byte pointer i)
     66            (logand #xff (char-code (schar s o)))))
    6267    (setf (%get-byte pointer n) 0))
    6368  nil)
     
    6873    (multiple-value-bind (s o) (dereference-base-string string)
    6974      (declare (fixnum o))
    70       (%copy-ivector-to-ptr s (the fixnum (+ o start)) pointer 0 n)
     75          (do* ((i 0 (1+ i))
     76          (o (the fixnum (+ o start)) (1+ o)))
     77         ((= i n))
     78      (declare (fixnum i o))
     79      (setf (%get-unsigned-byte pointer i)
     80            (logand #xff (char-code (schar s o)))))
    7181    (setf (%get-byte pointer n) 0)
    7282    nil)))
Note: See TracChangeset for help on using the changeset viewer.