CMUCL commit: RELEASE-20B-BRANCH src (bootfiles/20a/boot-2010-08-1.lisp code/extfmts.lisp)

Raymond Toy rtoy at common-lisp.net
Mon Sep 6 03:01:28 CEST 2010


    Date: Sunday, September 5, 2010 @ 21:01:28
  Author: rtoy
    Path: /project/cmucl/cvsroot/src
     Tag: RELEASE-20B-BRANCH

   Added: bootfiles/20a/boot-2010-08-1.lisp
Modified: code/extfmts.lisp

code/extfmts.lisp
o Add new ef-macro index for octets-to-string-counted.  (Forgot to do
  that before.)

bootfiles/20a/boot-2010-08-1.lisp:
o Use this to bootstrap the change (using a cross-compile.)


-----------------------------------+
 bootfiles/20a/boot-2010-08-1.lisp |   28 ++++++++++++++++++++++++++++
 code/extfmts.lisp                 |   10 +++++++---
 2 files changed, 35 insertions(+), 3 deletions(-)


Index: src/bootfiles/20a/boot-2010-08-1.lisp
diff -u /dev/null src/bootfiles/20a/boot-2010-08-1.lisp:1.1.2.1
--- /dev/null	Sun Sep  5 21:01:28 2010
+++ src/bootfiles/20a/boot-2010-08-1.lisp	Sun Sep  5 21:01:27 2010
@@ -0,0 +1,28 @@
+;; Need to add a new ef macro id for OCTETS-TO-STRING-COUNTED.
+;;
+;; 2010-09 (probably) needs to be cross-compiled from 2010-08 (aka
+;; 20b-pre1).  Use something like
+;;
+;; src/tools/cross-build-world.sh -crl -B src/bootfiles/20a/boot-2010-08-1.lisp target/ cross src/tools/cross-scripts/cross-x86-x86.lisp <20b/bin/lisp>
+
+(in-package "STREAM")
+
+(ext:without-package-locks
+
+  (handler-bind ((error (lambda (c)
+			  (declare (ignore c))
+			  (invoke-restart 'kernel::continue))))
+    (vm::defenum (:prefix "+EF-" :suffix "+" :start 1)
+      str				; string length
+      cin				; input a character
+      cout				; output a character
+      sin				; input string
+      sout				; output string
+      os				; octets to string
+      so				; string to octets
+      en				; encode
+      de				; decode
+      flush				; flush state
+      copy-state			; copy state
+      osc
+      max)))
\ No newline at end of file
Index: src/code/extfmts.lisp
diff -u src/code/extfmts.lisp:1.35.4.4 src/code/extfmts.lisp:1.35.4.5
--- src/code/extfmts.lisp:1.35.4.4	Thu Sep  2 19:47:31 2010
+++ src/code/extfmts.lisp	Sun Sep  5 21:01:27 2010
@@ -5,7 +5,7 @@
 ;;; domain.
 ;;; 
 (ext:file-comment
- "$Header: /project/cmucl/cvsroot/src/code/extfmts.lisp,v 1.35.4.4 2010-09-02 23:47:31 rtoy Exp $")
+ "$Header: /project/cmucl/cvsroot/src/code/extfmts.lisp,v 1.35.4.5 2010-09-06 01:01:27 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -35,6 +35,9 @@
   "Hash table mapping an external format alias to the actual external
   format implementation")
 
+;; Each time DEF-EF-MACRO is used to define a new external format
+;; macro, a unique value must be used for the index.  The mapping
+;; between the macro and the index is here.
 (vm::defenum (:prefix "+EF-" :suffix "+" :start 1)
   str					; string length
   cin					; input a character
@@ -47,6 +50,7 @@
   de					; decode
   flush					; flush state
   copy-state				; copy state
+  osc					; octets to string, counted
   max)
 
 ;; Unicode replacement character U+FFFD
@@ -685,7 +689,7 @@
 (defun ensure-cache (ef id reqd)
   (let ((base (or (getf *ef-extensions* id)
 		  (setf (getf *ef-extensions* id)
-		      (prog1 *ef-base* (incf *ef-base* reqd))))))
+			(prog1 *ef-base* (incf *ef-base* reqd))))))
     (when (< (length (ef-cache ef)) (+ base reqd))
       (setf (efx-cache (ef-efx ef))
 	  (adjust-array (ef-cache ef) (+ base reqd) :initial-element nil)))
@@ -921,7 +925,7 @@
       (values (if stringp string (lisp::shrink-vector string pos)) pos last-octet new-state))))
 
 
-(def-ef-macro ef-octets-to-string-counted (extfmt lisp::lisp +ef-max+ +ef-os+)
+(def-ef-macro ef-octets-to-string-counted (extfmt lisp::lisp +ef-max+ +ef-osc+)
   `(lambda (octets ptr end state ocount string s-start s-end error
 	    &aux (pos s-start) (last-octet 0))
      (declare (optimize (speed 3) (safety 0) #|(space 0) (debug 0)|#)



More information about the cmucl-commit mailing list