[closure-cvs] CVS update: cxml/xml/util.lisp cxml/xml/xml-name-rune-p.lisp cxml/xml/xml-parse.lisp

David Lichteblau dlichteblau at common-lisp.net
Fri Mar 25 18:17:48 UTC 2005


Update of /project/cxml/cvsroot/cxml/xml
In directory common-lisp.net:/tmp/cvs-serv9430/xml

Modified Files:
	xml-name-rune-p.lisp xml-parse.lisp 
Added Files:
	util.lisp 
Log Message:
- Moved utility functions from the "runes" package to the "cxml" package to
  avoid name conflicts with functions from "glisp" of the same name.
- Renamed defsubst to definline for the same reason.

(This is a commit to the cxml repository, not the main closure repository.
If you don't want cxml commit messages on the closure list, please complain
to me and I'll change it.)

Date: Fri Mar 25 19:17:36 2005
Author: dlichteblau



Index: cxml/xml/xml-name-rune-p.lisp
diff -u cxml/xml/xml-name-rune-p.lisp:1.1.1.10 cxml/xml/xml-name-rune-p.lisp:1.2
--- cxml/xml/xml-name-rune-p.lisp:1.1.1.10	Sun Mar 13 19:02:51 2005
+++ cxml/xml/xml-name-rune-p.lisp	Fri Mar 25 19:17:34 2005
@@ -211,13 +211,13 @@
                      (setf (aref r i) 1))))) )
 
           `(progn
-             (DEFSUBST NAME-RUNE-P (RUNE)
+             (DEFINLINE NAME-RUNE-P (RUNE)
                (SETF RUNE (RUNE-CODE RUNE))
                (AND (<= 0 RUNE ,*max*)
                     (LOCALLY (DECLARE (OPTIMIZE (SAFETY 0) (SPEED 3)))
                              (= 1 (SBIT ',(predicate-to-bv #'name-rune-p)
                                         (THE FIXNUM RUNE))))))
-             (DEFSUBST NAME-START-RUNE-P (RUNE)
+             (DEFINLINE NAME-START-RUNE-P (RUNE)
                (SETF RUNE (RUNE-CODE RUNE))
                (AND (<= 0 RUNE ,*MAX*)
                     (LOCALLY (DECLARE (OPTIMIZE (SAFETY 0) (SPEED 3)))


Index: cxml/xml/xml-parse.lisp
diff -u cxml/xml/xml-parse.lisp:1.1.1.121 cxml/xml/xml-parse.lisp:1.2
--- cxml/xml/xml-parse.lisp:1.1.1.121	Sun Mar 13 19:02:57 2005
+++ cxml/xml/xml-parse.lisp	Fri Mar 25 19:17:35 2005
@@ -378,7 +378,7 @@
   )
 
 (defun make-rod-hashtable (&key (size 200))
-  (setf size (runes::nearest-greater-prime size))
+  (setf size (nearest-greater-prime size))
   (make-rod-hashtable/low
    :size size
    :table (make-array size :initial-element nil)))
@@ -392,13 +392,13 @@
       (1- (expt 2 +fixnum-bits+))
     "Pessimistic approximation of the largest bit-mask, still being a fixnum."))
 
-(defsubst stir (a b)
+(definline stir (a b)
   (%and +fixnum-mask+
         (%xor (%ior (%ash (%and a #.(ash +fixnum-mask+ -5)) 5)
                     (%ash a #.(- 5 +fixnum-bits+)))
               b)))
 
-(defsubst rod-hash (rod start end)
+(definline rod-hash (rod start end)
   "Compute a hash code out of a rod."
   (let ((res (%- end start)))
     (do ((i start (%+ i 1)))
@@ -407,7 +407,7 @@
       (setf res (stir res (rune-code (%rune rod i)))))
     res))
 
-(defsubst rod=* (x y &key (start1 0) (end1 (length x))
+(definline rod=* (x y &key (start1 0) (end1 (length x))
                           (start2 0) (end2 (length y)))
   (and (%= (%- end1 start1) (%- end2 start2))
        (do ((i start1 (%+ i 1))
@@ -417,7 +417,7 @@
          (unless (rune= (%rune x i) (%rune y j))
            (return nil)))))
 
-(defsubst rod=** (x y start1 end1 start2 end2)
+(definline rod=** (x y start1 end1 start2 end2)
   (and (%= (%- end1 start1) (%- end2 start2))
        (do ((i start1 (%+ i 1))
             (j start2 (%+ j 1)))
@@ -1339,7 +1339,7 @@
                (perror input "Expected \";\"."))
              (values :NAMED name))))))
 
-(defsubst read-S? (input)
+(definline read-S? (input)
   (while (member (peek-rune input) '(#/U+0020 #/U+0009 #/U+000A #/U+000D)
                  :test #'eq)
     (consume-rune input)))
@@ -1413,7 +1413,7 @@
                         (collect c))))
            value))))
 
-(defsubst data-rune-p (rune)
+(definline data-rune-p (rune)
   ;; any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
   (let ((c (rune-code rune)))
     (or (= c #x9) (= c #xA) (= c #xD)




More information about the Closure-cvs mailing list