Changeset 15239 for release/1.8


Ignore:
Timestamp:
Mar 9, 2012, 7:25:28 PM (7 years ago)
Author:
rme
Message:

Revert r15238. I jumped the gun on this.

Location:
release/1.8/source
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • release/1.8/source

  • release/1.8/source/cocoa-ide/cocoa-editor.lisp

    r15238 r15239  
    35103510  (execute-in-gui #'(lambda ()
    35113511                      (assume-cocoa-thread)
    3512                       (handler-case
    3513                           (let ((view (find-or-make-hemlock-view pathname)))
    3514                             (hi::handle-hemlock-event view thunk))
    3515                         (error (c)
    3516                           (alert-window :title "Error in Hemlock command processing"
    3517                                         :message (or (ignore-errors (princ-to-string c))
    3518                                                      "#<error printing error message>")
    3519                                         :default-button "Ok"))))))
     3512                      (let ((view (find-or-make-hemlock-view pathname)))
     3513                        (hi::handle-hemlock-event view thunk)))))
    35203514
    35213515(defun hemlock-ext:open-sequence-dialog (&key title sequence action (printer #'prin1))
  • release/1.8/source/compiler/X86/x862.lisp

    r15238 r15239  
    10621062
    10631063
    1064 (defun x862-bind-lambda (seg lcells req opt rest keys auxen optsupvloc passed-in-regs lexpr inherited tail-label
     1064(defun x862-bind-lambda (seg lcells req opt rest keys auxen optsupvloc passed-in-regs lexpr &optional inherited
    10651065                             &aux (vloc 0) (numopt (list-length (%car opt)))
    10661066                             (nkeys (list-length (%cadr keys)))
     
    11051105            (x862-copy-register seg reg *x862-arg-z*)
    11061106            (x862-set-var-ea seg rest reg))
    1107           (let* ((loc *x862-vstack*))
    1108             (x862-vpush-register seg *x862-arg-z* :reserved)
    1109             (x862-note-top-cell rest)
    1110             (x862-bind-var seg rest loc *x862-top-vstack-lcell*))))
     1107            (let* ((loc *x862-vstack*))
     1108              (x862-vpush-register seg *x862-arg-z* :reserved)
     1109              (x862-note-top-cell rest)
     1110              (x862-bind-var seg rest loc *x862-top-vstack-lcell*))))
    11111111      (let* ((rvloc (+ vloc (* 2 *x862-target-node-size* nkeys))))
    11121112        (if (setq reg (nx2-assign-register-var rest))
    11131113          (x862-init-regvar seg rest reg (x862-vloc-ea rvloc))
    11141114          (x862-bind-var seg rest rvloc (pop lcells))))))
    1115   (when keys
    1116     (apply #'x862-init-keys seg vloc lcells keys))
    1117   (when tail-label
    1118     (with-x86-local-vinsn-macros (seg)
    1119       (@+ tail-label)))
     1115    (when keys
     1116      (apply #'x862-init-keys seg vloc lcells keys))
    11201117  (x862-seq-bind seg (%car auxen) (%cadr auxen)))
    11211118
     
    67266723          (setq *x862-entry-vstack* *x862-vstack*)
    67276724          (setq reserved-lcells (x862-collect-lcells :reserved))
    6728           (x862-bind-lambda seg reserved-lcells req opt rest keys auxen optsupvloc arg-regs lexprp inherited-vars *x862-tail-label*)
     6725          (x862-bind-lambda seg reserved-lcells req opt rest keys auxen optsupvloc arg-regs lexprp inherited-vars)
     6726          (when *x862-tail-label*
     6727            (@+ *x862-tail-label*))
    67296728          (when next-method-var-scope-info
    67306729            (push next-method-var-scope-info *x862-recorded-symbols*)))
  • release/1.8/source/level-0/X86/X8632/x8632-misc.lisp

    r15238 r15239  
    713713
    714714(defx8632lapfunction %vect-data-to-macptr ((vect arg_y) (ptr arg_z))
    715   (cmpb ($ x8632::subtag-double-float-vector) (@ x8632::misc-subtag-offset (% vect)))
    716   (je @dfloat)
    717   (cmpb ($ x8632::subtag-double-float) (@ x8632::misc-subtag-offset (% vect)))
    718   (je @dfloat)
    719715  (lea (@ x8632::misc-data-offset (% vect)) (% imm0))
    720   (jmp @common)
    721   @dfloat
    722   (lea (@ x8632::misc-dfloat-offset (% vect)) (% imm0))
    723   @common
    724716  (movl (% imm0) (@ x8632::macptr.address (% ptr)))
    725717  (single-value-return))
  • release/1.8/source/level-0/l0-io.lisp

    r15238 r15239  
    162162                                            (ash (the fixnum (logxor 3rd-unit #x80)) 6))
    163163                                          (the fixnum (logxor 4th-unit #x80)))))))))))))))))
    164         (setf (schar string i) (or char (note-vector-decoding-problem pointer index :utf-8)))))))
     164        (setf (schar string i) (or char #\Replacement_Character))))))
    165165
    166166(defun utf-8-length-of-memory-encoding (pointer noctets start)
  • release/1.8/source/level-1/l1-boot-2.lisp

    r15238 r15239  
    176176        (setq *standard-input* (make-synonym-stream '*terminal-io*)
    177177              *standard-output* (make-synonym-stream '*terminal-io*))))
    178     (setq *error-output* (if (or *batch-flag*
    179                                  (not (same-fd-p (stream-device *stderr* :output)
    180                                                  (stream-device *stdout* :output))))
     178    (setq *error-output* (if *batch-flag*
    181179                           (make-synonym-stream '*stderr*)
    182180                           (make-synonym-stream '*terminal-io*)))
  • release/1.8/source/level-1/l1-error-system.lisp

    r15238 r15239  
    5151  ((kill :initarg :kill :initform nil :reader process-reset-kill)))
    5252
    53 (define-condition encoding-problem (condition)
    54   ((character :initarg :character :reader encoding-problem-character)
    55    (destination :initarg :destination :reader encoding-problem-destination)
    56    (encoding-name :initarg :encoding-name :reader encoding-problem-encoding-name))
    57   (:report
    58    (lambda (c s)
    59      (with-slots (character destination encoding-name) c
    60        (format s "Character ~c can't be written to ~a in encoding ~a."
    61                character destination encoding-name)))))
    62 
    63 
    64 
    65 (define-condition decoding-problem (condition)
    66   ((source :initarg :source :reader decoding-problem-source)
    67    (position :initarg :position :reader decoding-problem-position)
    68    (encoding-name :initarg :encoding-name :reader decoding-problem-encoding-name))
    69   (:report (lambda (c stream)
    70              (with-slots (source position encoding-name) c
    71                (format stream "Contents of ~a" source)
    72                (when position
    73                  (format stream ", near ~a ~d," (if (typep source 'stream) "position" "index") position))
    74                (format stream " don't represent a valid character in ~s." encoding-name)))))
    75 
    76 
    77              
    7853
    7954(define-condition print-not-readable (error)
  • release/1.8/source/level-1/l1-init.lisp

    r15238 r15239  
    313313
    314314
    315 (defvar *terminal-character-encoding-name* :utf-8
     315(defvar *terminal-character-encoding-name* nil
    316316  "NIL (implying :ISO-8859-1), or a keyword which names a defined
    317317character encoding to be used for *TERMINAL-IO* and other predefined
  • release/1.8/source/level-1/l1-sysio.lisp

    r15238 r15239  
    8585(defvar *default-external-format* :unix)
    8686
    87 (defvar *default-file-character-encoding* :utf-8)
     87(defvar *default-file-character-encoding* nil)
    8888
    8989(defmethod default-character-encoding ((domain (eql :file)))
     
    932932                   (file-string-length stream #\Return))
    933933                0))
    934            (if (and (eql (file-position stream) 0)
    935                     (character-encoding-use-byte-order-mark encoding))
    936              (length (character-encoding-bom-encoding encoding))
    937              0)))))))
     934           (if (eql (file-position stream) 0)
     935             0
     936             (length (character-encoding-bom-encoding encoding)))))))))
    938937 
  • release/1.8/source/level-1/l1-unicode.lisp

    r15238 r15239  
    154154    (format stream "~a" (character-encoding-name ce))))
    155155
    156 (defun note-stream-decoding-problem (stream)
    157   (let* ((source (if (typep stream 'ioblock)
    158                    (ioblock-stream stream)
    159                    stream))
    160          (position (stream-position source))
    161          (encoding-name
    162           (character-encoding-name
    163            (external-format-character-encoding (stream-external-format source)))))
    164     (signal (make-condition 'decoding-problem
    165                             :source source
    166                             :position position
    167                             :encoding-name encoding-name))
    168     #\Replacement_Character))
    169 
    170 (defun note-vector-decoding-problem (vector index encoding)
    171   (signal (make-condition 'decoding-problem
    172                           :source vector
    173                           :position index
    174                           :encoding-name (let* ((enc (if (typep encoding 'character-encoding)
    175                                                        encoding
    176                                                        (lookup-character-encoding encoding))))
    177                                            (if enc (character-encoding-name enc) encoding))))
    178   #\Replacement_Character)
    179 
    180 (defun note-encoding-problem (char destination encoding code)
    181   (signal (make-condition 'encoding-problem
    182                           :character char
    183                           :destination (if (typep destination 'ioblock)
    184                                          (ioblock-stream destination)
    185                                          destination)
    186                           :encoding-name (let* ((enc (if (typep encoding 'character-encoding)
    187                                                        encoding
    188                                                        (lookup-character-encoding encoding))))
    189                                            (if enc (character-encoding-name enc) encoding))))
    190   code)
    191                          
    192156;;; N.B.  (ccl:nfunction <name> (lambda (...) ...)) is just  like
    193157;;;       (cl:function (lambda (...) ...)), except that the resulting
     
    241205       (declare (type (mod #x110000) code))
    242206       (if (>= code 256)
    243          (setq code (note-encoding-problem char stream :iso-8859-1 (char-code #\Sub))))
     207         (setq code (char-code #\Sub)))
    244208       (funcall write-function stream code)
    245209       1)))
     
    263227         (declare (type (mod #x110000) code))
    264228         (if (>= code 256)
    265            (setq code (note-encoding-problem char vector :iso-8859-1 (char-code #\Sub))))
     229           (setq code (char-code #\Sub)))
    266230         (progn
    267231           (setf (aref vector idx) code)
     
    283247     (do* ((i start (1+ i)))
    284248          ((>= i end) idx)
    285        (let* ((char (schar string i))
    286               (code (char-code char)))
     249       (let* ((code (char-code (schar string i))))
    287250         (declare (type (mod #x110000) code))
    288251         (if (>= code 256)
    289            (setq code (note-encoding-problem char pointer :iso-8859-1 (char-code #\Sub))))
     252           (setq code (char-code #\Sub)))
    290253         (setf (%get-unsigned-byte pointer idx) code)
    291254         (incf idx)))))
     
    307270  :decode-literal-code-unit-limit 256
    308271  :encode-literal-char-code-limit 256
    309 
    310272  )
    311273
     
    322284       (declare (type (mod #x110000) code))
    323285       (when (>= code 128)
    324          (setq code (note-encoding-problem char stream :us-ascii (char-code #\Sub))))
     286         (setq code (char-code #\Sub)))
    325287       (funcall write-function stream code)
    326288       1)))
     
    329291   ascii-stream-decode
    330292   (lambda (1st-unit next-unit-function stream)
    331      (declare (ignore next-unit-function)
     293     (declare (ignore next-unit-function stream)
    332294              (type (unsigned-byte 8) 1st-unit))
    333295     (if (< 1st-unit 128)
    334296       (code-char 1st-unit)
    335        (note-stream-decoding-problem stream))))
     297       #\Replacement_Character)))
    336298  :vector-encode-function
    337299  (nfunction
     
    346308         (declare (type (mod #x110000) code))
    347309         (if (>= code 128)
    348            (setq code (note-encoding-problem char vector :us-ascii (char-code #\Sub))))
     310           (setq code (char-code #\Sub)))
    349311         (setf (aref vector idx) code)
    350312         (incf idx)))))
     
    359321       (let* ((code (aref vector index)))
    360322         (declare (type (unsigned-byte 8) code))
    361          (setf (schar string i) (if (< code 128)
    362                                   (code-char code)
    363                                   (note-vector-decoding-problem vector index :us-ascii)))))))
     323         (when (>= code 128)
     324           (setq code (char-code #\Sub)))
     325         (setf (schar string i) (code-char code))))))
    364326  :memory-encode-function
    365327  (nfunction
     
    368330     (do* ((i start (1+ i)))
    369331          ((>= i end) idx)
    370        (let* ((char (schar string i))
    371               (code (char-code char)))
     332       (let* ((code (char-code (schar string i))))
    372333         (declare (type (mod #x110000) code))
    373334         (if (>= code 128)
    374            (setq code (note-encoding-problem char pointer :us-ascii (char-code #\Sub))))
     335           (setq code (char-code #\Sub)))
    375336         (setf (%get-unsigned-byte pointer idx) code)
    376337         (incf idx)))))
     
    385346         (declare (type (unsigned-byte 8) code))
    386347         (if (>= code 128)
    387            (setf (schar string i) (note-vector-decoding-problem pointer index :us-ascii))
     348           (setf (schar string i) #\sub)
    388349           (setf (schar string i) (code-char code)))))))
    389350  :octets-in-string-function
     
    487448                     
    488449       (declare (type (mod #x110000) code))
    489        (funcall write-function stream (or c2 (note-encoding-problem char stream :iso-8859-2 (char-code #\Sub))))
     450       (funcall write-function stream (or c2 (char-code #\Sub)))
    490451       1)))
    491452  :stream-decode-function
     
    506467     (do* ((i start (1+ i)))
    507468          ((>= i end) idx)
    508        (let* ((char (schar string i))
    509               (code (char-code char))
     469       (let* ((code (char-code (schar string i)))
    510470              (c2 (cond ((< code #xa0) code)
    511471                          ((< code #x180)
     
    516476                                  (the fixnum (- code #x2c0)))))))
    517477         (declare (type (mod #x110000) code))
    518          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-2 (char-code #\Sub))))
     478         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    519479         (incf idx)))))
    520480  :vector-decode-function
     
    538498     (do* ((i start (1+ i)))
    539499          ((>= i end) idx)
    540        (let* ((char (schar string i))
    541               (code (char-code char))
     500       (let* ((code (char-code (schar string i)))
    542501              (c2 (cond ((< code #xa0) code)
    543502                        ((< code #x180)
     
    548507                                (the fixnum (- code #x2c0)))))))
    549508       (declare (type (mod #x110000) code))
    550        (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-2 (char-code #\Sub))))
     509       (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    551510       (1+ idx)))))
    552511  :memory-decode-function
     
    660619                              (the fixnum (- code #x2d8)))))))
    661620       (declare (type (mod #x110000) code))
    662        (funcall write-function stream (or c2
    663                                           (note-encoding-problem
    664                                            char stream :iso-8859-3 (char-code #\Sub))))
     621       (funcall write-function stream (or c2 (char-code #\Sub)))
    665622       1)))
    666623  :stream-decode-function
     
    695652               (the fixnum (- code #x2d8)))))))
    696653         (declare (type (mod #x110000) code))
    697          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-3 (char-code #\Sub))))
     654         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    698655         (incf idx)))))
    699656  :vector-decode-function
     
    717674     (do* ((i start (1+ i)))
    718675          ((>= i end) idx)
    719        (let* ((char (schar string i))
    720               (code (char-code char))
     676       (let* ((code (char-code (schar string i)))
    721677              (c2 (cond ((< code #xa0) code)
    722678                        ((< code #x100)
     
    730686                                (the fixnum (- code #x2d8)))))))
    731687         (declare (type (mod #x110000) code))
    732          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-3 (char-code #\Sub))))
     688         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    733689         (incf idx)))))
    734690  :memory-decode-function
     
    842798                     
    843799       (declare (type (mod #x110000) code))
    844        (funcall write-function stream (or c2 (note-encoding-problem char stream :iso-8859-4 (char-code #\Sub))))
     800       (funcall write-function stream (or c2 (char-code #\Sub)))
    845801       1)))
    846802  :stream-decode-function
     
    871827                                (the fixnum (- code #x2c0)))))))
    872828         (declare (type (mod #x110000) code))
    873          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-4 (char-code #\Sub))))
     829         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    874830         (incf idx)))))
    875831  :vector-decode-function
     
    893849     (do* ((i start (1+ i)))
    894850          ((>= i end) idx)
    895        (let* ((char (schar string i))
    896               (code (char-code char))
     851       (let* ((code (char-code (schar string i)))
    897852              (c2 (cond ((< code #xa0) code)
    898853                        ((< code #x180)
     
    903858                                (the fixnum (- code #x2c0)))))))
    904859         (declare (type (mod #x110000) code))
    905          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-4 (char-code #\Sub))))
     860         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    906861         (incf idx)))))
    907862  :memory-decode-function
     
    995950                     
    996951       (declare (type (mod #x110000) code))
    997        (funcall write-function stream (or c2 (note-encoding-problem char stream :iso-8859-5 (char-code #\Sub))))
     952       (funcall write-function stream (or c2 (char-code #\Sub)))
    998953       1)))
    999954  :stream-decode-function
     
    1024979                                (the fixnum (- code #x400)))))))
    1025980         (declare (type (mod #x110000) code))
    1026          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-5 (char-code #\Sub))))
     981         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    1027982         (incf idx)))))
    1028983  :vector-decode-function
     
    10461001     (do* ((i start (1+ i)))
    10471002          ((>= i end) idx)
    1048        (let* ((char (schar string i))
    1049               (code (char-code char))
     1003       (let* ((code (char-code (schar string i)))
    10501004              (c2 (cond ((< code #xa0) code)
    10511005                        ((< code #xb0)
     
    10561010                                (the fixnum (- code #x400)))))))
    10571011         (declare (type (mod #x110000) code))
    1058          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-5 (char-code #\Sub))))
     1012         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    10591013         (incf idx)))))
    10601014  :memory-decode-function
     
    11451099                     
    11461100       (declare (type (mod #x110000) code))
    1147        (funcall write-function stream (or c2 (note-encoding-problem char stream :iso-8859-6 (char-code #\Sub))))
     1101       (funcall write-function stream (or c2 (char-code #\Sub)))
    11481102       1)))
    11491103  :stream-decode-function
     
    11741128                                (the fixnum (- code #x608)))))))
    11751129         (declare (type (mod #x110000) code))
    1176          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-6 (char-code #\Sub))))
     1130         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    11771131         (incf idx)))))
    11781132  :vector-decode-function
     
    11961150     (do* ((i start (1+ i)))
    11971151          ((>= i end) idx)
    1198        (let* ((char (schar string i))
    1199               (code (char-code char))
     1152       (let* ((code (char-code (schar string i)))
    12001153              (c2 (cond ((< code #xa0) code)
    12011154                        ((< code #xb0)
     
    12061159                                (the fixnum (- code #x608)))))))
    12071160         (declare (type (mod #x110000) code))
    1208          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-6 (char-code #\Sub))))
     1161         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    12091162         (incf idx)))))
    12101163  :memory-decode-function
     
    13141267             
    13151268       (declare (type (mod #x110000) code))
    1316        (funcall write-function stream (or c2 (note-encoding-problem char stream :iso-8859-7 (char-code #\Sub))))
     1269       (funcall write-function stream (or c2 (char-code #\Sub)))
    13171270       1)))
    13181271  :stream-decode-function
     
    13491302                              (the fixnum (- code #x20ac)))))))
    13501303         (declare (type (mod #x110000) code))
    1351          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-7 (char-code #\Sub))))
     1304         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    13521305         (incf idx)))))
    13531306  :vector-decode-function
     
    13711324     (do* ((i start (1+ i)))
    13721325          ((>= i end) idx)
    1373        (let* ((char (schar string i))
    1374               (code (char-code char))
     1326       (let* ((code (char-code (schar string i)))
    13751327              (c2 (cond ((< code #xa0) code)
    13761328                      ((< code #xc0)
     
    13871339                              (the fixnum (- code #x20ac)))))))
    13881340         (declare (type (mod #x110000) code))
    1389          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-7 (char-code #\Sub))))
     1341         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    13901342         (incf idx)))))
    13911343  :memory-decode-function
     
    14871439             
    14881440       (declare (type (mod #x110000) code))
    1489        (funcall write-function stream (or c2 (note-encoding-problem char stream :iso-8859-8 (char-code #\Sub))))
     1441       (funcall write-function stream (or c2 (char-code #\Sub)))
    14901442       1)))
    14911443  :stream-decode-function
     
    15191471                              (the fixnum (- code #x2008)))))))
    15201472         (declare (type (mod #x110000) code))
    1521          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-8 (char-code #\Sub))))
     1473         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    15221474         (incf idx)))))
    15231475  :vector-decode-function
     
    15411493     (do* ((i start (1+ i)))
    15421494          ((>= i end) idx)
    1543        (let* ((char (schar string i))
    1544               (code (char-code char))
     1495       (let* ((code (char-code (schar string i)))
    15451496              (c2 (cond ((< code #xa0) code)
    15461497                      ((< code #xf8)
     
    15541505                              (the fixnum (- code #x2008)))))))
    15551506         (declare (type (mod #x110000) code))
    1556          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-8 (char-code #\Sub))))
     1507         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    15571508         (incf idx)))))
    15581509  :memory-decode-function
     
    16371588             
    16381589       (declare (type (mod #x110000) code))
    1639        (funcall write-function stream (or c2 (note-encoding-problem char stream :iso-8859-9 (char-code #\Sub))))
     1590       (funcall write-function stream (or c2 (char-code #\Sub)))
    16401591       1)))
    16411592  :stream-decode-function
     
    16661617                              (the fixnum (- code #x118)))))))
    16671618         (declare (type (mod #x110000) code))
    1668          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-9 (char-code #\Sub))))
     1619         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    16691620         (incf idx)))))
    16701621  :vector-decode-function
     
    16881639     (do* ((i start (1+ i)))
    16891640          ((>= i end) idx)
    1690        (let* ((char (schar string i))
    1691               (code (char-code char))
     1641       (let* ((code (char-code (schar string i)))
    16921642              (c2 (cond ((< code #xd0) code)
    16931643                      ((< code #x100)
     
    16981648                              (the fixnum (- code #x118)))))))
    16991649         (declare (type (mod #x110000) code))
    1700          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-9 (char-code #\Sub))))
     1650         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    17011651         (incf idx)))))
    17021652  :memory-decode-function
     
    17941744                              (the fixnum (- code #xa0)))))))
    17951745       (declare (type (mod #x110000) code))
    1796        (funcall write-function stream (or c2 (note-encoding-problem char stream :iso-8859-10 (char-code #\Sub))))
     1746       (funcall write-function stream (or c2 (char-code #\Sub)))
    17971747       1)))
    17981748  :stream-decode-function
     
    18201770                              (the fixnum (- code #xa0)))))))
    18211771         (declare (type (mod #x110000) code))
    1822          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-10 (char-code #\Sub))))
     1772         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    18231773         (incf idx)))))
    18241774  :vector-decode-function
     
    18421792     (do* ((i start (1+ i)))
    18431793          ((>= i end) idx)
    1844        (let* ((char (schar string i))
    1845               (code (char-code char))
     1794       (let* ((code (char-code (schar string i)))
    18461795              (c2 (cond ((< code #xa0) code)
    18471796                      ((< code #x180)
     
    18491798                              (the fixnum (- code #xa0)))))))
    18501799         (declare (type (mod #x110000) code))
    1851          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-10 (char-code #\Sub))))
     1800         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    18521801         (incf idx)))))
    18531802  :memory-decode-function
     
    18901839                       (+ code #x0d60)))))
    18911840       (declare (type (mod #x110000) code))
    1892        (funcall write-function stream (or c2 (note-encoding-problem char stream :iso-8859-11 (char-code #\Sub))))
     1841       (funcall write-function stream (or c2 (char-code #\Sub)))
    18931842       1)))
    18941843  :stream-decode-function
     
    18961845   iso-8859-11-stream-decode
    18971846   (lambda (1st-unit next-unit-function stream)
    1898      (declare (ignore next-unit-function)
     1847     (declare (ignore next-unit-function stream)
    18991848              (type (unsigned-byte 8) 1st-unit))
    19001849     (if (< 1st-unit #xa1)
     
    19051854                          (<= 1st-unit #xe3e))))
    19061855         (code-char (- 1st-unit #xd60))
    1907          (note-stream-decoding-problem stream)))))
     1856         #\Replacement_Character))))
    19081857  :vector-encode-function
    19091858  (nfunction
     
    19211870                       (+ code #x0d60)))))
    19221871         (declare (type (mod #x110000) code))
    1923          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-11 (char-code #\Sub))))
     1872         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    19241873         (incf idx)))))
    19251874  :vector-decode-function
     
    19411890                                    (<= 1st-unit #xe3e))))
    19421891                   (code-char (- 1st-unit #xd60))
    1943                    (note-vector-decoding-problem vector index :iso-8859-11))))))))
     1892                   #\Replacement_Character)))))))
    19441893  :memory-encode-function
    19451894  (nfunction
     
    19481897     (do* ((i start (1+ i)))
    19491898          ((>= i end) idx)
    1950        (let* ((char (schar string i))
    1951               (code (char-code char))
     1899       (let* ((code (char-code (schar string i)))
    19521900              (c2 (cond ((< code #xa1) code)
    19531901                      ((and (<= code #xfb)
     
    19551903                       (+ code #x0d60)))))
    19561904         (declare (type (mod #x110000) code))
    1957          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-11 (char-code #\Sub))))
     1905         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    19581906         (incf idx)))))
    19591907  :memory-decode-function
     
    19741922                                    (<= 1st-unit #xe3e))))
    19751923                   (code-char (- 1st-unit #xd60))
    1976                    (note-vector-decoding-problem pointer index :iso-8859-11))))))))
     1924                   #\Replacement_Character)))))))
    19771925  :octets-in-string-function
    19781926  #'8-bit-fixed-width-octets-in-string
     
    20682016                              (the fixnum (- code #x2018)))))))
    20692017       (declare (type (mod #x110000) code))
    2070        (funcall write-function stream (or c2 (note-encoding-problem char stream :iso-8859-13 (char-code #\Sub))))
     2018       (funcall write-function stream (or c2 (char-code #\Sub)))
    20712019       1)))
    20722020  :stream-decode-function
     
    20982046                              (the fixnum (- code #x2018)))))))
    20992047         (declare (type (mod #x110000) code))
    2100          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-13 (char-code #\Sub))))
     2048         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    21012049         (incf idx)))))
    21022050  :vector-decode-function
     
    21202068     (do* ((i start (1+ i)))
    21212069          ((>= i end) idx)
    2122        (let* ((char (schar string i))
    2123               (code (char-code char))
     2070       (let* ((code (char-code (schar string i)))
    21242071              (c2 (cond ((< code #xa0) code)
    21252072                      ((< code #x180)
     
    21312078                              (the fixnum (- code #x2018)))))))
    21322079         (declare (type (mod #x110000) code))
    2133          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-13 (char-code #\Sub))))
     2080         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    21342081         (incf idx)))))
    21352082  :memory-decode-function
     
    22622209                              (the fixnum (- code #x1ef0)))))))
    22632210       (declare (type (mod #x110000) code))
    2264        (funcall write-function stream (or c2 (note-encoding-problem char stream :iso-8859-14 (char-code #\Sub))))
     2211       (funcall write-function stream (or c2 (char-code #\Sub)))
    22652212       1)))
    22662213  :stream-decode-function
     
    23002247                              (the fixnum (- code #x1ef0)))))))
    23012248         (declare (type (mod #x110000) code))
    2302          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-14 (char-code #\Sub))))
     2249         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    23032250         (incf idx)))))
    23042251  :vector-decode-function
     
    23222269     (do* ((i start (1+ i)))
    23232270          ((>= i end) idx)
    2324        (let* ((char (schar string i))
    2325               (code (char-code char))
     2271       (let* ((code (char-code (schar string i)))
    23262272              (c2 (cond ((< code #xa0) code)
    23272273                      ((< code #x100)
     
    23412287                              (the fixnum (- code #x1ef0)))))))
    23422288         (declare (type (mod #x110000) code))
    2343          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-14 (char-code #\Sub))))
     2289         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    23442290         (incf idx)))))
    23452291  :memory-decode-function
     
    24392385                      ((= code #x20ac) #xa4))))
    24402386       (declare (type (mod #x110000) code))
    2441        (funcall write-function stream (or c2 (note-encoding-problem char stream :iso-8859-15 (char-code #\Sub))))
     2387       (funcall write-function stream (or c2 (char-code #\Sub)))
    24422388       1)))
    24432389  :stream-decode-function
     
    24692415                      ((= code #x20ac) #xa4))))
    24702416         (declare (type (mod #x110000) code))
    2471          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-15 (char-code #\Sub))))
     2417         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    24722418         (incf idx)))))
    24732419  :vector-decode-function
     
    24912437     (do* ((i start (1+ i)))
    24922438          ((>= i end) idx)
    2493        (let* ((char (schar string i))
    2494               (code (char-code char))
     2439       (let* ((code (char-code (schar string i)))
    24952440              (c2 (cond ((< code #xa0) code)
    24962441                      ((< code #x100)
     
    25022447                      ((= code #x20ac) #xa4))))
    25032448         (declare (type (mod #x110000) code))
    2504          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-15 (char-code #\Sub))))
     2449         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    25052450         (incf idx)))))
    25062451  :memory-decode-function
     
    26152560                      ((= code #x20ac) #xa4))))
    26162561       (declare (type (mod #x110000) code))
    2617        (funcall write-function stream (or c2 (note-encoding-problem char stream :iso-8859-16 (char-code #\Sub))))
     2562       (funcall write-function stream (or c2 (char-code #\Sub)))
    26182563       1)))
    26192564  :stream-decode-function
     
    26482593                      ((= code #x20ac) #xa4))))
    26492594         (declare (type (mod #x110000) code))
    2650          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :iso-8859-16 (char-code #\Sub))))
     2595         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    26512596         (incf idx)))))
    26522597  :vector-decode-function
     
    26702615     (do* ((i start (1+ i)))
    26712616          ((>= i end) idx)
    2672        (let* ((char (schar string i))
    2673               (code (char-code char))
     2617       (let* ((code (char-code (schar string i)))
    26742618              (c2 (cond ((< code #xa0) code)
    26752619                      ((< code #x180)
     
    26842628                      ((= code #x20ac) #xa4))))
    26852629         (declare (type (mod #x110000) code))
    2686          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :iso-8859-16 (char-code #\Sub))))
     2630         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    26872631         (incf idx)))))
    26882632  :memory-decode-function
     
    28552799                      ((= code #xf8ff) #xf0))))
    28562800       (declare (type (mod #x110000) code))
    2857        (funcall write-function stream (or c2 (note-encoding-problem char stream :macintosh (char-code #\Sub))))
     2801       (funcall write-function stream (or c2 (char-code #\Sub)))
    28582802       1)))
    28592803  :stream-decode-function
     
    29022846                      ((= code #xf8ff) #xf0))))
    29032847         (declare (type (mod #x110000) code))
    2904          (setf (aref vector idx) (or c2 (note-encoding-problem char vector :macintosh (char-code #\Sub))))
     2848         (setf (aref vector idx) (or c2 (char-code #\Sub)))
    29052849         (incf idx)))))
    29062850  :vector-decode-function
     
    29242868     (do* ((i start (1+ i)))
    29252869          ((>= i end) idx)
    2926        (let* ((char (schar string i))
    2927               (code (char-code char))
    2928               (c2 (cond ((< code #x80) code)
     2870       (let* ((code (char-code (schar string i)))
     2871            (c2 (cond ((< code #x80) code)
    29292872                      ((and (>= code #xa0) (< code #x100)
    29302873                       (svref *unicode-a0-100-to-macintosh*
     
    29522895                      ((= code #xf8ff) #xf0))))
    29532896         (declare (type (mod #x110000) code))
    2954          (setf (%get-unsigned-byte pointer idx) (or c2 (note-encoding-problem char pointer :macintosh (char-code #\Sub))))
     2897         (setf (%get-unsigned-byte pointer idx) (or c2 (char-code #\Sub)))
    29552898         (incf idx)))))
    29562899  :memory-decode-function
     
    30412984                       (the fixnum (ash (the fixnum (logand #x1f 1st-unit)) 6))
    30422985                       (the fixnum (logxor s1 #x80))))
    3043                      (note-stream-decoding-problem stream))
     2986                     #\Replacement_Character)
    30442987                   (let* ((s2 (funcall next-unit-function stream)))
    30452988                     (if (eq s2 :eof)
     
    30623005                                                            6))
    30633006                                                     (the fixnum (logand s2 #x3f)))))))
    3064                                  (note-stream-decoding-problem stream))
    3065                              (note-stream-decoding-problem stream))
     3007                                 #\Replacement_Character)
     3008                             #\Replacement_Character)
    30663009                           (if (< 1st-unit #xf8)
    30673010                             (let* ((s3 (funcall next-unit-function stream)))
     
    30883031                                            (ash (the fixnum (logxor s2 #x80)) 6))
    30893032                                          (the fixnum (logxor s3 #x80))))))
    3090 
    3091 
    3092                                      (note-stream-decoding-problem stream)))))
    3093                              (note-stream-decoding-problem stream))))))))))
    3094            (note-stream-decoding-problem stream)))))
     3033                                     #\Replacement_Character))))
     3034                             #\Replacement_Character)))))))))
     3035           #\Replacement_Character))))
    30953036    :vector-encode-function
    30963037    (nfunction
     
    31933134                                              (ash (the fixnum (logxor 3rd-unit #x80)) 6))
    31943135                                            (the fixnum (logxor 4th-unit #x80))))))))))))))))
    3195                (setf (schar string i) (or char (note-vector-decoding-problem vector index :utf-8))))))))
     3136               (setf (schar string i) (or char #\Replacement_Character)))))))
    31963137    :memory-encode-function
    31973138    #'utf-8-memory-encode
     
    32843225                     (< 2nd-unit #xe000))
    32853226              (utf-16-combine-surrogate-pairs 1st-unit 2nd-unit)
    3286               (note-stream-decoding-problem stream)))))
    3287       (note-stream-decoding-problem stream))))
     3227              #\Replacement_Character))))
     3228      #\Replacement_Character)))
    32883229
    32893230
     
    34183359                                  (< 2nd-unit #xe000))
    34193360                           (utf-16-combine-surrogate-pairs 1st-unit 2nd-unit)))))))
    3420              (setf (schar string i) (or char (note-vector-decoding-problem vector index #+big-endian-target :utf-16be #-big-endian-target :utf-16le))))))))
     3361             (setf (schar string i) (or char #\Replacement_Character)))))))
    34213362    :memory-encode-function
    34223363    (nfunction
     
    34623403                                    (< 2nd-unit #xe000))
    34633404                             (utf-16-combine-surrogate-pairs 1st-unit 2nd-unit)))))))
    3464             (setf (schar string i) (or char (note-vector-decoding-problem pointer index #+big-endian-target :utf-16be #-big-endian-target :utf-16le))))))))
     3405            (setf (schar string i) (or char #\Replacement_Character)))))))
    34653406    :octets-in-string-function
    34663407    #'utf-16-octets-in-string
     
    35833524                                (< 2nd-unit #xe000))
    35843525                         (utf-16-combine-surrogate-pairs 1st-unit 2nd-unit)))))))
    3585            (setf (schar string i) (or char (note-vector-decoding-problem vector index #+big-endian-target :utf-16le #-big-endian-target :utf-16be))))))))
     3526           (setf (schar string i) (or char #\Replacement_Character)))))))
    35863527  :memory-encode-function
    35873528  (nfunction
     
    36273568                                (< 2nd-unit #xe000))
    36283569                         (utf-16-combine-surrogate-pairs 1st-unit 2nd-unit)))))))
    3629            (setf (schar string i) (or char (note-vector-decoding-problem pointer index #+big-endian-target :utf-16le #-big-endian-target :utf-16be))))))))
     3570           (setf (schar string i) (or char #\Replacement_Character)))))))
    36303571  :octets-in-string-function
    36313572  #'utf-16-octets-in-string
     
    37683709                                  (< 2nd-unit #xe000))
    37693710                           (utf-16-combine-surrogate-pairs 1st-unit 2nd-unit)))))))
    3770              (setf (schar string i) (or char (note-vector-decoding-problem vector index :utf-16)))))))))
     3711             (setf (schar string i) (or char #\Replacement_Character))))))))
    37713712  :memory-encode-function
    37723713  (nfunction
     
    38283769                                  (< 2nd-unit #xe000))
    38293770                           (utf-16-combine-surrogate-pairs 1st-unit 2nd-unit)))))))
    3830              (setf (schar string i) (or char (note-vector-decoding-problem pointer index :utf-16)))))))))
     3771             (setf (schar string i) (or char #\Replacement_Character))))))))
    38313772  :octets-in-string-function
    38323773  (nfunction
     
    39193860    (declare (type (mod #x110000) code))
    39203861    (if (>= code #x10000)
    3921       (setq code (note-encoding-problem char stream :ucs-2 (char-code #\Replacement_Character))))
     3862      (setq code (char-code #\Replacement_Character)))
    39223863    (funcall write-function stream code)
    39233864    1))
     
    39253866(defun ucs-2-stream-decode (1st-unit next-unit-function stream)
    39263867  (declare (type (unsigned-byte 16) 1st-unit)
    3927            (ignore next-unit-function))
     3868           (ignore next-unit-function stream))
    39283869  ;; CODE-CHAR returns NIL on either half of a surrogate pair.
    39293870  (or (code-char 1st-unit)
    3930       (note-stream-decoding-problem stream)))
     3871      #\Replacement_Character))
    39313872
    39323873
     
    39813922         (declare (type (mod #x110000) code))
    39823923         (when (>= code #x10000)
    3983            (setq code (note-encoding-problem char vector #+big-endian-target :ucs-2be #-big-endian-target :ucs-2le (char-code #\Replacement_Character))))
     3924           (setq code (char-code #\Replacement_Character)))
    39843925         (setf (%native-u8-ref-u16 vector idx) code)
    39853926         (incf idx 2)))))
     
    39973938       (setf (schar string i)
    39983939             (or (code-char (%native-u8-ref-u16 vector index))
    3999                  (note-vector-decoding-problem vector index  #+big-endian-target :ucs-2be #-big-endian-target :ucs-2le))))))
     3940                 #\Replacement_Character)))))
    40003941  :memory-encode-function
    40013942  (nfunction
     
    40053946     (do* ((i start (1+ i)))
    40063947          ((>= i end) idx)
    4007        (let* ((char (schar string i))
    4008               (code (char-code char)))
     3948       (let* ((code (char-code (schar string i))))
    40093949         (declare (type (mod #x110000) code))
    40103950         (setf (%get-unsigned-word pointer idx)
    40113951                      (if (>= code #x10000)
    4012                         (note-encoding-problem char pointer #+big-endian-target :ucs-2be #-big-endian-target :ucs-2le (char-code #\Replacement_Character))
     3952                        (char-code #\Replacement_Character)
    40133953                        code))
    40143954         (incf idx 2)))))
     
    40243964       (let* ((1st-unit (%get-unsigned-word pointer index)))
    40253965         (declare (type (unsigned-byte 16) 1st-unit))
    4026          (setf (schar string i) (or (char-code 1st-unit) (note-vector-decoding-problem pointer index  #+big-endian-target :ucs-2be #-big-endian-target :ucs-2le)))))))
     3966         (setf (schar string i) (or (char-code 1st-unit) #\Replacement_Character))))))
    40273967  :octets-in-string-function
    40283968  #'ucs-2-octets-in-string
     
    40714011         (declare (type (mod #x110000) code))
    40724012         (when (>= code #x10000)
    4073            (setq code (note-encoding-problem char vector #+big-endian-target :ucs-2le #-big-endian-target :ucs-2be (char-code #\Replacement_Character))))
     4013           (setq code (char-code #\Replacement_Character)))
    40744014         (setf (%reversed-u8-ref-u16 vector idx) code)
    40754015         (incf idx 2)))))
     
    40874027       (setf (schar string i)
    40884028             (or (code-char (%reversed-u8-ref-u16 vector index))
    4089                  (note-vector-decoding-problem vector index #+big-endian-target :ucs-2le #-big-endian-target :ucs-2be))))))
     4029                 #\Replacement_Character)))))
    40904030  :memory-encode-function
    40914031  (nfunction
     
    40954035     (do* ((i start (1+ i)))
    40964036          ((>= i end) idx)
    4097        (let* ((char (schar string i))
    4098               (code (char-code char)))
     4037       (let* ((code (char-code (schar string i))))
    40994038         (declare (type (mod #x110000) code))
    41004039         (setf (%get-unsigned-word pointer idx)
    41014040               (if (>= code #x10000)
    4102                  (%swap-u16 (note-encoding-problem char pointer #+big-endian-target :ucs-2le #-big-endian-target :ucs-2be (char-code #\Replacement_Character)))
     4041                 (%swap-u16 (char-code #\Replacement_Character))
    41034042                 (%swap-u16 code)))
    41044043         (incf idx 2)))))
     
    41144053       (let* ((1st-unit (%swap-u16 (%get-unsigned-word pointer index))))
    41154054         (declare (type (unsigned-byte 16) 1st-unit))
    4116          (setf (schar string i) (or (code-char 1st-unit) (note-vector-decoding-problem pointer index #+big-endian-target :ucs-2le #-big-endian-target :ucs-2be)))))))
     4055         (setf (schar string i) (or (code-char 1st-unit) #\Replacement_Character))))))
    41174056  :octets-in-string-function
    41184057  #'ucs-2-octets-in-string
     
    41554094         (declare (type (mod #x110000) code))
    41564095         (when (>= code #x10000)
    4157            (setq code (note-encoding-problem char vector :ucs-2 (char-code #\Replacement_Character))))
     4096           (setq code (char-code #\Replacement_Character)))
    41584097         (setf (%native-u8-ref-u16 vector idx) code)
    41594098         (incf idx 2)))))
     
    41824121                            (%native-u8-ref-u16 vector index))))
    41834122             (declare (type (unsigned-byte 16) 1st-unit))
    4184              (setf (schar string i) (or (code-char 1st-unit)
    4185                                         (note-vector-decoding-problem vector index :ucs-2))))))))
     4123             (setf (schar string i) (or (code-char 1st-unit) #\Replacement_Character)))))))
    41864124  :memory-encode-function
    41874125  (nfunction
     
    41934131     (do* ((i start (1+ i)))
    41944132          ((>= i end) idx)
    4195        (let* ((char (schar string i))
    4196               (code (char-code char)))
     4133       (let* ((code (char-code (schar string i))))
    41974134         (declare (type (mod #x110000) code))
    41984135         (setf (%get-unsigned-word pointer idx)
    41994136                      (if (>= code #x10000)
    4200                         (note-encoding-problem char pointer :ucs-2 (char-code #\Replacement_Character))
     4137                        (char-code #\Replacement_Character)
    42014138                        code))
    42024139         (incf idx 2)))))
     
    42244161         (declare (type (unsigned-byte 16) 1st-unit))
    42254162         (if swap (setq 1st-unit (%swap-u16 1st-unit)))
    4226          (setf (schar string i) (or (code-char 1st-unit)
    4227                                     (note-vector-decoding-problem pointer index :ucs-2))))))))
     4163         (setf (schar string i) (or (code-char 1st-unit) #\Replacement_Character)))))))
    42284164  :octets-in-string-function
    42294165  (nfunction
     
    44064342               (or (if (< code char-code-limit)
    44074343                      (code-char code))
    4408                    (note-vector-decoding-problem vector index #+big-endian-target :utf-32be #-big-endian-target :utf-32le)))))))
     4344                   #\Replacement_Character))))))
    44094345  :memory-encode-function
    44104346  (nfunction
     
    44314367         (setf (schar string i) (or (if (< 1st-unit char-code-limit)
    44324368                                      (code-char 1st-unit))
    4433                                     (note-vector-decoding-problem
    4434                                      pointer index #+big-endian-target :utf-32be #-big-endian-target :utf-32le)))))))
     4369                                    #\Replacement_Character))))))
    44354370  :octets-in-string-function
    44364371  #'ucs-4-octets-in-string
     
    45054440               (or (if (< code char-code-limit)
    45064441                     (code-char code))
    4507                    (note-vector-decoding-problem vector index #+big-endian-target :utf-32le #-big-endian-target :utf-32be)))))))
     4442                   #\Replacement_Character))))))
    45084443  :memory-encode-function
    45094444  (nfunction
     
    45304465         (setf (schar string i) (or (if (< 1st-unit char-code-limit)
    45314466                                      (code-char 1st-unit))
    4532                                     (note-vector-decoding-problem pointer index #+big-endian-target :utf-32le #-big-endian-target :utf-32be)))))))
     4467                                    #\Replacement_Character))))))
    45334468
    45344469  :octets-in-string-function
     
    46134548             (setf (schar string i) (or (if (< 1st-unit char-code-limit)
    46144549                                          (code-char 1st-unit))
    4615                                         (note-vector-decoding-problem
    4616                                          vector index :utf-32))))))))
     4550                                        #\Replacement_Character)))))))
    46174551  :memory-encode-function
    46184552  (nfunction
     
    46534587         (setf (schar string i) (or (if (< 1st-unit char-code-limit)
    46544588                                      (code-char 1st-unit))
    4655                                     (note-vector-decoding-problem
    4656                                      pointer index :utf-32))))))))
     4589                                    #\Replacement_Character)))))))
    46574590  :octets-in-string-function
    46584591  (nfunction
  • release/1.8/source/level-1/linux-files.lisp

    r15238 r15239  
    21852185;;(assert (= (logcount *host-page-size*) 1))
    21862186
    2187 
    2188 (defun same-fd-p (a b)
    2189   (or (eql a b)
    2190       #-windows-target
    2191       (let* ((a-stat (multiple-value-list (%fstat a)))
    2192              (b-stat (multiple-value-list (%fstat b))))
    2193         (declare (dynamic-extent a-stat b-stat))
    2194         (and (car a-stat) (car b-stat)
    2195              (eql (nth 9 a-stat)
    2196                   (nth 9 b-stat))
    2197              (eql (nth 4 a-stat)
    2198                   (nth 4 b-stat))))
    2199       #+windows-target
    2200       (%stack-block ((a-info (record-length #>BY_HANDLE_FILE_INFORMATION))
    2201                      (b-info (record-length #>BY_HANDLE_FILE_INFORMATION)))
    2202         (unless (or (eql 0 (#_GetFileInformationByHandle (%int-to-ptr a) a-info))
    2203                     (eql 0 (#_GetFileInformationByHandle (%int-to-ptr b) b-info)))
    2204           (and (eql (pref a-info #>BY_HANDLE_FILE_INFORMATION.dwVolumeSerialNumber)
    2205                     (pref b-info #>BY_HANDLE_FILE_INFORMATION.dwVolumeSerialNumber))
    2206                (eql (pref a-info #>BY_HANDLE_FILE_INFORMATION.nFileIndexHigh)
    2207                     (pref b-info #>BY_HANDLE_FILE_INFORMATION.nFileIndexHigh))
    2208                (eql (pref a-info #>BY_HANDLE_FILE_INFORMATION.nFileIndexLow)
    2209                     (pref b-info #>BY_HANDLE_FILE_INFORMATION.nFileIndexLow)))))))
    2210 
    2211  
    22122187(defun get-universal-time ()
    22132188  "Return a single integer for the current time of
  • release/1.8/source/lib/ccl-export-syms.lisp

    r15238 r15239  
    343343     event-dispatch
    344344     *ticks-per-second*
    345      encoding-problem
    346      decoding-problem
    347      with-encoding-problems-as-errors
    348      with-decoding-problems-as-errors
    349345
    350346     *application*
  • release/1.8/source/lib/macros.lisp

    r15238 r15239  
    406406             (continue cond &rest args) expansion
    407407             (setq condform `(condition-arg ,cond (list ,@args) 'simple-error)
    408                    signalform `(cerror ,continue ,cname ,@args))))
     408                   signalform `(cerror ,continue ,cname))))
    409409          ((signal error warn)
    410410           (destructuring-bind
     
    17691769            (setf (%get-unsigned-word ,sym ,noctets) 0)
    17701770            ,@body))))))
    1771 
    1772 (defmacro with-encoding-problems-as-errors (&body body)
    1773   `(handler-bind ((encoding-problem #'error))
    1774     ,@body))
    1775 
    1776 (defmacro with-decoding-problems-as-errors (&body body)
    1777   `(handler-bind ((decoding-problem #'error))
    1778     ,@body))
    17791771
    17801772(defmacro with-pointers (speclist &body body)
  • release/1.8/source/lisp-kernel/androidarm/Makefile

    r15238 r15239  
    1515
    1616LIBBASE = 0x04001000
    17 NDK = /usr/local/android-ndk-r7b
     17NDK = /usr/local/android-ndk-r7
    1818UNAME_S = $(shell uname -s)
    1919ifeq ($(UNAME_S),Linux)
  • release/1.8/source/lisp-kernel/androidarm/android_native_app_glue.c

    r15238 r15239  
    192192}
    193193
    194 static void process_cmd(struct android_app* app, struct android_poll_source* source)
    195 {
    196   int8_t cmd = android_app_read_cmd(app);
    197   android_app_pre_exec_cmd(app, cmd);
    198   if (app->onAppCmd != NULL) app->onAppCmd(app, cmd);
    199   android_app_post_exec_cmd(app, cmd);
    200 }
    201 
    202 static void*
    203 android_app_entry(void* param)
    204 {
    205   struct android_app* android_app = (struct android_app*)param;
    206 
    207   android_app->config = AConfiguration_new();
    208   AConfiguration_fromAssetManager(android_app->config, android_app->activity->assetManager);
    209 
    210   print_cur_config(android_app);
    211 
    212   android_app->cmdPollSource.id = LOOPER_ID_MAIN;
    213   android_app->cmdPollSource.app = android_app;
    214   android_app->cmdPollSource.process = process_cmd;
    215   android_app->inputPollSource.id = LOOPER_ID_INPUT;
    216   android_app->inputPollSource.app = android_app;
    217   android_app->inputPollSource.process = process_input;
    218 
    219   ALooper* looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
    220   ALooper_addFd(looper, android_app->msgread, LOOPER_ID_MAIN, ALOOPER_EVENT_INPUT, NULL,
    221                 &android_app->cmdPollSource);
    222   android_app->looper = looper;
    223 
    224   pthread_mutex_lock(&android_app->mutex);
    225   android_app->running = 1;
    226   pthread_cond_broadcast(&android_app->cond);
    227   pthread_mutex_unlock(&android_app->mutex);
    228 
    229   android_main(android_app);
    230 
    231   android_app_destroy(android_app);
    232   return NULL;
     194static void process_cmd(struct android_app* app, struct android_poll_source* source) {
     195    int8_t cmd = android_app_read_cmd(app);
     196    android_app_pre_exec_cmd(app, cmd);
     197    if (app->onAppCmd != NULL) app->onAppCmd(app, cmd);
     198    android_app_post_exec_cmd(app, cmd);
     199}
     200
     201static void* android_app_entry(void* param) {
     202    struct android_app* android_app = (struct android_app*)param;
     203
     204    android_app->config = AConfiguration_new();
     205    AConfiguration_fromAssetManager(android_app->config, android_app->activity->assetManager);
     206
     207    print_cur_config(android_app);
     208
     209    android_app->cmdPollSource.id = LOOPER_ID_MAIN;
     210    android_app->cmdPollSource.app = android_app;
     211    android_app->cmdPollSource.process = process_cmd;
     212    android_app->inputPollSource.id = LOOPER_ID_INPUT;
     213    android_app->inputPollSource.app = android_app;
     214    android_app->inputPollSource.process = process_input;
     215
     216    ALooper* looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
     217    ALooper_addFd(looper, android_app->msgread, LOOPER_ID_MAIN, ALOOPER_EVENT_INPUT, NULL,
     218            &android_app->cmdPollSource);
     219    android_app->looper = looper;
     220
     221    pthread_mutex_lock(&android_app->mutex);
     222    android_app->running = 1;
     223    pthread_cond_broadcast(&android_app->cond);
     224    pthread_mutex_unlock(&android_app->mutex);
     225
     226    android_main(android_app);
     227
     228    android_app_destroy(android_app);
     229    return NULL;
    233230}
    234231
     
    237234// --------------------------------------------------------------------
    238235
    239 static struct android_app*
    240 android_app_create(ANativeActivity* activity,
    241         void* savedState, size_t savedStateSize)
    242 {
    243   struct android_app* android_app = (struct android_app*)malloc(sizeof(struct android_app));
    244   memset(android_app, 0, sizeof(struct android_app));
    245   android_app->activity = activity;
    246 
    247   pthread_mutex_init(&android_app->mutex, NULL);
    248   pthread_cond_init(&android_app->cond, NULL);
    249 
    250   if (savedState != NULL) {
    251     android_app->savedState = malloc(savedStateSize);
    252     android_app->savedStateSize = savedStateSize;
    253     memcpy(android_app->savedState, savedState, savedStateSize);
    254   }
    255 
    256   int msgpipe[2];
    257   if (pipe(msgpipe)) {
    258     LOGI("could not create pipe: %s", strerror(errno));
    259   }
    260   android_app->msgread = msgpipe[0];
    261   android_app->msgwrite = msgpipe[1];
    262 
    263   pthread_attr_t attr;
    264   pthread_attr_init(&attr);
    265   pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
    266   pthread_create(&android_app->thread, &attr, android_app_entry, android_app);
    267 
    268   // Wait for thread to start.
    269   pthread_mutex_lock(&android_app->mutex);
    270   while (!android_app->running) {
    271     pthread_cond_wait(&android_app->cond, &android_app->mutex);
    272   }
    273   pthread_mutex_unlock(&android_app->mutex);
    274 
    275   return android_app;
    276 }
    277 
    278 static void
    279 android_app_write_cmd(struct android_app* android_app, int8_t cmd)
    280 {
    281   if (write(android_app->msgwrite, &cmd, sizeof(cmd)) != sizeof(cmd)) {
    282     LOGI("Failure writing android_app cmd: %s\n", strerror(errno));
    283   }
    284 }
    285 
    286 static void
    287 android_app_set_input(struct android_app* android_app, AInputQueue* inputQueue)
    288 {
    289   pthread_mutex_lock(&android_app->mutex);
    290   android_app->pendingInputQueue = inputQueue;
    291   android_app_write_cmd(android_app, APP_CMD_INPUT_CHANGED);
    292   while (android_app->inputQueue != android_app->pendingInputQueue) {
    293     pthread_cond_wait(&android_app->cond, &android_app->mutex);
    294   }
    295   pthread_mutex_unlock(&android_app->mutex);
    296 }
    297 
    298 static void
    299 android_app_set_window(struct android_app* android_app, ANativeWindow* window)
    300 {
    301   pthread_mutex_lock(&android_app->mutex);
    302   if (android_app->pendingWindow != NULL) {
    303     android_app_write_cmd(android_app, APP_CMD_TERM_WINDOW);
    304   }
    305   android_app->pendingWindow = window;
    306   if (window != NULL) {
    307     android_app_write_cmd(android_app, APP_CMD_INIT_WINDOW);
    308   }
    309   while (android_app->window != android_app->pendingWindow) {
    310     pthread_cond_wait(&android_app->cond, &android_app->mutex);
    311   }
    312   pthread_mutex_unlock(&android_app->mutex);
    313 }
    314 
    315 static void
    316 android_app_set_activity_state(struct android_app* android_app, int8_t cmd)
    317 {
    318   pthread_mutex_lock(&android_app->mutex);
    319   android_app_write_cmd(android_app, cmd);
    320   while (android_app->activityState != cmd) {
    321     pthread_cond_wait(&android_app->cond, &android_app->mutex);
    322   }
    323   pthread_mutex_unlock(&android_app->mutex);
    324 }
    325 
    326 static void
    327 android_app_free(struct android_app* android_app)
    328 {
    329   pthread_mutex_lock(&android_app->mutex);
    330   android_app_write_cmd(android_app, APP_CMD_DESTROY);
    331   while (!android_app->destroyed) {
    332     pthread_cond_wait(&android_app->cond, &android_app->mutex);
    333   }
    334   pthread_mutex_unlock(&android_app->mutex);
    335 
    336   close(android_app->msgread);
    337   close(android_app->msgwrite);
    338   pthread_cond_destroy(&android_app->cond);
    339   pthread_mutex_destroy(&android_app->mutex);
    340   free(android_app);
    341 }
    342 
    343 static void
    344 onDestroy(ANativeActivity* activity)
    345 {
    346   LOGI("Destroy: %p\n", activity);
    347   android_app_free((struct android_app*)activity->instance);
    348 }
    349 
    350 static void
    351 onStart(ANativeActivity* activity)
    352 {
    353   LOGI("Start: %p\n", activity);
    354   android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_START);
    355 }
    356 
    357 static void
    358 onResume(ANativeActivity* activity)
    359 {
    360   LOGI("Resume: %p\n", activity);
    361   android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_RESUME);
    362 }
    363 
    364 static void*
    365 onSaveInstanceState(ANativeActivity* activity, size_t* outLen)
    366 {
    367   struct android_app* android_app = (struct android_app*)activity->instance;
    368   void* savedState = NULL;
    369 
    370   LOGI("SaveInstanceState: %p\n", activity);
    371   pthread_mutex_lock(&android_app->mutex);
    372   android_app->stateSaved = 0;
    373   android_app_write_cmd(android_app, APP_CMD_SAVE_STATE);
    374   while (!android_app->stateSaved) {
    375     pthread_cond_wait(&android_app->cond, &android_app->mutex);
    376   }
    377 
    378   if (android_app->savedState != NULL) {
    379     savedState = android_app->savedState;
    380     *outLen = android_app->savedStateSize;
    381     android_app->savedState = NULL;
    382     android_app->savedStateSize = 0;
    383   }
    384 
    385   pthread_mutex_unlock(&android_app->mutex);
    386 
    387   return savedState;
    388 }
    389 
    390 static void
    391 onPause(ANativeActivity* activity) {
     236static struct android_app* android_app_create(ANativeActivity* activity,
     237        void* savedState, size_t savedStateSize) {
     238    struct android_app* android_app = (struct android_app*)malloc(sizeof(struct android_app));
     239    memset(android_app, 0, sizeof(struct android_app));
     240    android_app->activity = activity;
     241
     242    pthread_mutex_init(&android_app->mutex, NULL);
     243    pthread_cond_init(&android_app->cond, NULL);
     244
     245    if (savedState != NULL) {
     246        android_app->savedState = malloc(savedStateSize);
     247        android_app->savedStateSize = savedStateSize;
     248        memcpy(android_app->savedState, savedState, savedStateSize);
     249    }
     250
     251    int msgpipe[2];
     252    if (pipe(msgpipe)) {
     253        LOGI("could not create pipe: %s", strerror(errno));
     254    }
     255    android_app->msgread = msgpipe[0];
     256    android_app->msgwrite = msgpipe[1];
     257
     258    pthread_attr_t attr;
     259    pthread_attr_init(&attr);
     260    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
     261    pthread_create(&android_app->thread, &attr, android_app_entry, android_app);
     262
     263    // Wait for thread to start.
     264    pthread_mutex_lock(&android_app->mutex);
     265    while (!android_app->running) {
     266        pthread_cond_wait(&android_app->cond, &android_app->mutex);
     267    }
     268    pthread_mutex_unlock(&android_app->mutex);
     269
     270    return android_app;
     271}
     272
     273static void android_app_write_cmd(struct android_app* android_app, int8_t cmd) {
     274    if (write(android_app->msgwrite, &cmd, sizeof(cmd)) != sizeof(cmd)) {
     275        LOGI("Failure writing android_app cmd: %s\n", strerror(errno));
     276    }
     277}
     278
     279static void android_app_set_input(struct android_app* android_app, AInputQueue* inputQueue) {
     280    pthread_mutex_lock(&android_app->mutex);
     281    android_app->pendingInputQueue = inputQueue;
     282    android_app_write_cmd(android_app, APP_CMD_INPUT_CHANGED);
     283    while (android_app->inputQueue != android_app->pendingInputQueue) {
     284        pthread_cond_wait(&android_app->cond, &android_app->mutex);
     285    }
     286    pthread_mutex_unlock(&android_app->mutex);
     287}
     288
     289static void android_app_set_window(struct android_app* android_app, ANativeWindow* window) {
     290    pthread_mutex_lock(&android_app->mutex);
     291    if (android_app->pendingWindow != NULL) {
     292        android_app_write_cmd(android_app, APP_CMD_TERM_WINDOW);
     293    }
     294    android_app->pendingWindow = window;
     295    if (window != NULL) {
     296        android_app_write_cmd(android_app, APP_CMD_INIT_WINDOW);
     297    }
     298    while (android_app->window != android_app->pendingWindow) {
     299        pthread_cond_wait(&android_app->cond, &android_app->mutex);
     300    }
     301    pthread_mutex_unlock(&android_app->mutex);
     302}
     303
     304static void android_app_set_activity_state(struct android_app* android_app, int8_t cmd) {
     305    pthread_mutex_lock(&android_app->mutex);
     306    android_app_write_cmd(android_app, cmd);
     307    while (android_app->activityState != cmd) {
     308        pthread_cond_wait(&android_app->cond, &android_app->mutex);
     309    }
     310    pthread_mutex_unlock(&android_app->mutex);
     311}
     312
     313static void android_app_free(struct android_app* android_app) {
     314    pthread_mutex_lock(&android_app->mutex);
     315    android_app_write_cmd(android_app, APP_CMD_DESTROY);
     316    while (!android_app->destroyed) {
     317        pthread_cond_wait(&android_app->cond, &android_app->mutex);
     318    }
     319    pthread_mutex_unlock(&android_app->mutex);
     320
     321    close(android_app->msgread);
     322    close(android_app->msgwrite);
     323    pthread_cond_destroy(&android_app->cond);
     324    pthread_mutex_destroy(&android_app->mutex);
     325    free(android_app);
     326}
     327
     328static void onDestroy(ANativeActivity* activity) {
     329    LOGI("Destroy: %p\n", activity);
     330    android_app_free((struct android_app*)activity->instance);
     331}
     332
     333static void onStart(ANativeActivity* activity) {
     334    LOGI("Start: %p\n", activity);
     335    android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_START);
     336}
     337
     338static void onResume(ANativeActivity* activity) {
     339    LOGI("Resume: %p\n", activity);
     340    android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_RESUME);
     341}
     342
     343static void* onSaveInstanceState(ANativeActivity* activity, size_t* outLen) {
     344    struct android_app* android_app = (struct android_app*)activity->instance;
     345    void* savedState = NULL;
     346
     347    LOGI("SaveInstanceState: %p\n", activity);
     348    pthread_mutex_lock(&android_app->mutex);
     349    android_app->stateSaved = 0;
     350    android_app_write_cmd(android_app, APP_CMD_SAVE_STATE);
     351    while (!android_app->stateSaved) {
     352        pthread_cond_wait(&android_app->cond, &android_app->mutex);
     353    }
     354
     355    if (android_app->savedState != NULL) {
     356        savedState = android_app->savedState;
     357        *outLen = android_app->savedStateSize;
     358        android_app->savedState = NULL;
     359        android_app->savedStateSize = 0;
     360    }
     361
     362    pthread_mutex_unlock(&android_app->mutex);
     363
     364    return savedState;
     365}
     366
     367static void onPause(ANativeActivity* activity) {
    392368    LOGI("Pause: %p\n", activity);
    393369    android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_PAUSE);
    394370}
    395371
    396 static void
    397 onStop(ANativeActivity* activity) {
     372static void onStop(ANativeActivity* activity) {
    398373    LOGI("Stop: %p\n", activity);
    399374    android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_STOP);
    400375}
    401376
    402 static void
    403 onConfigurationChanged(ANativeActivity* activity) {
     377static void onConfigurationChanged(ANativeActivity* activity) {
    404378    struct android_app* android_app = (struct android_app*)activity->instance;
    405379    LOGI("ConfigurationChanged: %p\n", activity);
     
    407381}
    408382
    409 static void
    410 onLowMemory(ANativeActivity* activity)
    411 {
    412   struct android_app* android_app = (struct android_app*)activity->instance;
    413   LOGI("LowMemory: %p\n", activity);
    414   android_app_write_cmd(android_app, APP_CMD_LOW_MEMORY);
    415 }
    416 
    417 static void
    418 onWindowFocusChanged(ANativeActivity* activity, int focused)
    419 {
    420   LOGI("WindowFocusChanged: %p -- %d\n", activity, focused);
    421   android_app_write_cmd((struct android_app*)activity->instance,
    422                         focused ? APP_CMD_GAINED_FOCUS : APP_CMD_LOST_FOCUS);
    423 }
    424 
    425 static void
    426 onNativeWindowCreated(ANativeActivity* activity, ANativeWindow* window)
    427 {
    428   LOGI("NativeWindowCreated: %p -- %p\n", activity, window);
    429   android_app_set_window((struct android_app*)activity->instance, window);
    430 }
    431 
    432 static void
    433 onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* window)
    434 {
    435   LOGI("NativeWindowDestroyed: %p -- %p\n", activity, window);
    436   android_app_set_window((struct android_app*)activity->instance, NULL);
    437 }
    438 
    439 static void
    440 onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue)
    441 {
    442   LOGI("InputQueueCreated: %p -- %p\n", activity, queue);
    443   android_app_set_input((struct android_app*)activity->instance, queue);
    444 }
    445 
    446 static void
    447 onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue)
    448 {
    449   LOGI("InputQueueDestroyed: %p -- %p\n", activity, queue);
    450   android_app_set_input((struct android_app*)activity->instance, NULL);
    451 }
    452 
    453 void
    454 ANativeActivity_onCreate(ANativeActivity* activity,
    455         void* savedState, size_t savedStateSize)
    456 {
    457   extern Boolean init_ccl_for_android(ANativeActivity *);
    458 
    459   if (!init_ccl_for_android(activity)) {
    460     _exit(1);
    461   }
    462  
    463   LOGI("Creating: %p\n", activity);
    464   activity->callbacks->onDestroy = onDestroy;
    465   activity->callbacks->onStart = onStart;
    466   activity->callbacks->onResume = onResume;
    467   activity->callbacks->onSaveInstanceState = onSaveInstanceState;
    468   activity->callbacks->onPause = onPause;
    469   activity->callbacks->onStop = onStop;
    470   activity->callbacks->onConfigurationChanged = onConfigurationChanged;
    471   activity->callbacks->onLowMemory = onLowMemory;
    472   activity->callbacks->onWindowFocusChanged = onWindowFocusChanged;
    473   activity->callbacks->onNativeWindowCreated = onNativeWindowCreated;
    474   activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed;
    475   activity->callbacks->onInputQueueCreated = onInputQueueCreated;
    476   activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed;
    477 
    478   activity->instance = android_app_create(activity, savedState, savedStateSize);
    479 }
     383static void onLowMemory(ANativeActivity* activity) {
     384    struct android_app* android_app = (struct android_app*)activity->instance;
     385    LOGI("LowMemory: %p\n", activity);
     386    android_app_write_cmd(android_app, APP_CMD_LOW_MEMORY);
     387}
     388
     389static void onWindowFocusChanged(ANativeActivity* activity, int focused) {
     390    LOGI("WindowFocusChanged: %p -- %d\n", activity, focused);
     391    android_app_write_cmd((struct android_app*)activity->instance,
     392            focused ? APP_CMD_GAINED_FOCUS : APP_CMD_LOST_FOCUS);
     393}
     394
     395static void onNativeWindowCreated(ANativeActivity* activity, ANativeWindow* window) {
     396    LOGI("NativeWindowCreated: %p -- %p\n", activity, window);
     397    android_app_set_window((struct android_app*)activity->instance, window);
     398}
     399
     400static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* window) {
     401    LOGI("NativeWindowDestroyed: %p -- %p\n", activity, window);
     402    android_app_set_window((struct android_app*)activity->instance, NULL);
     403}
     404
     405static void onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue) {
     406    LOGI("InputQueueCreated: %p -- %p\n", activity, queue);
     407    android_app_set_input((struct android_app*)activity->instance, queue);
     408}
     409
     410static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue) {
     411    LOGI("InputQueueDestroyed: %p -- %p\n", activity, queue);
     412    android_app_set_input((struct android_app*)activity->instance, NULL);
     413}
     414
     415void ANativeActivity_onCreate(ANativeActivity* activity,
     416        void* savedState, size_t savedStateSize) {
     417    LOGI("Creating: %p\n", activity);
     418    activity->callbacks->onDestroy = onDestroy;
     419    activity->callbacks->onStart = onStart;
     420    activity->callbacks->onResume = onResume;
     421    activity->callbacks->onSaveInstanceState = onSaveInstanceState;
     422    activity->callbacks->onPause = onPause;
     423    activity->callbacks->onStop = onStop;
     424    activity->callbacks->onConfigurationChanged = onConfigurationChanged;
     425    activity->callbacks->onLowMemory = onLowMemory;
     426    activity->callbacks->onWindowFocusChanged = onWindowFocusChanged;
     427    activity->callbacks->onNativeWindowCreated = onNativeWindowCreated;
     428    activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed;
     429    activity->callbacks->onInputQueueCreated = onInputQueueCreated;
     430    activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed;
     431
     432    activity->instance = android_app_create(activity, savedState, savedStateSize);
     433}
  • release/1.8/source/lisp-kernel/arm-asmutils.s

    r15238 r15239  
    196196_endfn               
    197197
    198 /* zero N (r1) dnodes, starting at the dnode-aligned address in r0 */
    199 _exportfn(C(zero_dnodes))
    200         __(cmp r1,#0)
    201         __(adr r2,2f)
    202         __(fldd d0,[r2,#0])
    203         __(b 1f)
    204 0:      __(subs r1,r1,#1)
    205         __(fstd d0,[r0])
    206         __(add r0,r0,#dnode_size)       
    207 1:      __(bne 0b)
    208         __(bx lr)
    209         .align 3
    210 2:      .long 0
    211         .long 0       
    212 _endfn                       
    213198                               
    214199        _endfile
  • release/1.8/source/lisp-kernel/arm-spentry.s

    r15238 r15239  
    43714371local_label(loop):
    43724372        __(ref_nrs_value(arg_z,toplcatch))
    4373         __(bl _SPmkcatch1v)
     4373        __(bl _SPmkcatch1v)     /* preserves nfn, at the moment */
    43744374        __(b local_label(test)) /* cleanup address, not really a branch */
    43754375        __(ldr nfn,[vsp,#0])
     
    44744474        __(ldr allocptr,[rcontext,#tcr.save_allocptr])
    44754475        __(ref_nrs_function(nfn,restore_lisp_pointers))
    4476         __(extract_subtag(imm0,nfn))
     4476        __(extract_fulltag(imm0,nfn))
    44774477        __(cmp imm0,#subtag_function)
    44784478        __(bne local_label(fail))
     
    44804480        __(bl _SPmkcatch1v)
    44814481        __(b local_label(fail)) /* cleanup address */
    4482         __(ref_nrs_function(nfn,restore_lisp_pointers))
    44834482        __(set_nargs(0))
    44844483        __(bl _SPfuncall)
  • release/1.8/source/lisp-kernel/gc-common.c

    r15238 r15239  
    13531353}
    13541354
    1355 extern void zero_dnodes(void *,natural);
    1356 
    13571355void
    13581356gc(TCR *tcr, signed_natural param)
     
    17071705      last_zeroed_addr = a->high;
    17081706    }
    1709     zero_dnodes(a->active, area_dnode(last_zeroed_addr,a->active));
     1707    zero_memory_range(a->active, last_zeroed_addr);
    17101708
    17111709    /*
  • release/1.8/source/lisp-kernel/pmcl-kernel.c

    r15238 r15239  
    21502150xGetSharedLibrary(char *path, int mode)
    21512151{
    2152 #ifdef ANDROID
    2153   /* Hopefully temporary bug workaround */
    2154   return NULL;
    2155 #else
    21562152  return dlopen(path, mode);
    2157 #endif
    21582153}
    21592154#endif
     
    26072602JavaVM *android_vm = NULL;
    26082603
    2609 void
    2610 wait_for_debugger()
    2611 {
    2612   volatile Boolean ready = false;
    2613 
    2614   __android_log_print(ANDROID_LOG_INFO,"nativeCCL","waiting for debugger");
    2615   do {
    2616     sleep(1);
    2617   } while(!ready);
    2618 
    2619  
    2620 
    2621 Boolean
    2622 init_ccl_for_android(ANativeActivity *activity)
     2604jint
     2605JNI_OnLoad(JavaVM *vm, void *unused)
    26232606{
    26242607  extern int page_size;
     
    26312614    ;
    26322615  TCR *tcr;
    2633   BytePtr stack_base, current_sp;
    2634   char **argv;
    2635 
    2636   wait_for_debugger();
    2637   android_vm = activity->vm;
    2638 
    2639   current_sp = (BytePtr) current_stack_pointer();
     2616  BytePtr stack_base, current_sp = (BytePtr) current_stack_pointer();
     2617 
     2618#if 1
     2619  sleep(100);
     2620#endif
     2621  android_vm = vm;
     2622
    26402623  page_size = getpagesize();
    26412624 
    26422625  if (!check_arm_cpu()) {
    26432626    __android_log_print(ANDROID_LOG_FATAL,"nativeCCL","CPU doesn't support required features");
    2644     return false;
     2627      return -1;
    26452628  }
    26462629  main_thread_pid = getpid();
     
    26852668
    26862669  exception_init();
    2687   argv = (char**)(malloc (sizeof (char *)));
    2688   argv[0] = NULL;
     2670
    26892671  lisp_global(IMAGE_NAME) = ptr_to_lispobj(ensure_real_path(image_name));
    26902672  lisp_global(KERNEL_PATH) = ptr_to_lispobj(real_executable_name);
    2691   lisp_global(ARGV) = ptr_to_lispobj(argv);
     2673  lisp_global(ARGV) = (LispObj)NULL;
    26922674  lisp_global(KERNEL_IMPORTS) = (LispObj)import_ptrs_base;
    26932675
     
    27252707
    27262708  if (init_lisp(TCR_TO_TSD(tcr)) == 0) {
    2727     return true;
    2728   }
    2729   return false;
     2709    return JNI_VERSION_1_6;
     2710  }
     2711  return -1;
    27302712}
    27312713
     
    27422724android_main(struct android_app* state)
    27432725{
    2744   TCR *tcr;
     2726  TCR *tcr = new_tcr(DEFAULT_INITIAL_STACK_SIZE, MIN_TSTACK_SIZE);
    27452727  JNIEnv *env;
    27462728
    2747   tcr = new_tcr(DEFAULT_INITIAL_STACK_SIZE, MIN_TSTACK_SIZE);
    27482729  thread_init_tcr(tcr, current_stack_pointer,DEFAULT_INITIAL_STACK_SIZE);
    27492730  (*android_vm)->AttachCurrentThread(android_vm, &env, NULL);
  • release/1.8/source/lisp-kernel/ppc-asmutils.s

    r15238 r15239  
    428428_endfn
    429429
    430 /* zero N (r4) dnodes, starting at the dnode-aligned address in r3 */
    431 _exportfn(C(zero_dnodes))
    432         __(cmpri(r4,0))
    433         __(li r5,0)
    434         __(li r6,0)
    435         __(b 1f)
    436 0:      __(subi r4,r4,1)
    437         __(str(r5,0(r3)))
    438         __(cmpri(r4,0))
    439         __(str(r6,node_size(r3)))
    440         __(la r3,dnode_size(r3))
    441 1:      __(bne 0b)
    442         __(blr)
    443 _endfn               
     430
    444431        _endfile
  • release/1.8/source/lisp-kernel/x86-asmutils32.s

    r15238 r15239  
    280280_endfn                                       
    281281        __endif
    282 
    283 /* zero arg1 dnodes,starting at the dnode-aligned address in arg0 */
    284 _exportfn(C(zero_dnodes)) 
    285         __(xorl %eax,%eax)
    286         __(mov 4(%esp),%edx)
    287         __(mov 8(%esp),%ecx)
    288         __(testl %ecx,%ecx)
    289         __(jmp 1f)
    290 0:      __(mov %eax,0(%edx))
    291         __(mov %eax,4(%edx))
    292         __(lea dnode_size(%edx),%edx)
    293         __(subl $1,%ecx)
    294 1:      __(jne 0b)
    295         __(repret)
    296 _endfn       
    297282        _endfile
    298283
  • release/1.8/source/lisp-kernel/x86-asmutils64.s

    r15238 r15239  
    276276_endfn                                       
    277277        __endif
    278 
    279 /* zero N (%carg1) dnodes, starting at the dnode-aligned address in %carg0 */
    280 _exportfn(C(zero_dnodes))
    281         __(pxor %xmm0,%xmm0)
    282         __(cmpq $0,%carg1)
    283         __(jmp 1f)
    284 0:      __(movdqa %xmm0,(%carg0))
    285         __(lea 16(%carg0),%carg0)
    286         __(subq $1,%carg1)
    287 1:      __(jne 0b)
    288         __(repret)
    289 _endfn       
    290278        _endfile
Note: See TracChangeset for help on using the changeset viewer.