[movitz-cvs] CVS update: movitz/losp/tmp/packet.lisp

Frode Vatvedt Fjeld ffjeld at common-lisp.net
Thu Jul 22 01:11:14 UTC 2004


Update of /project/movitz/cvsroot/movitz/losp/tmp
In directory common-lisp.net:/tmp/cvs-serv11776

Modified Files:
	packet.lisp 
Log Message:
Some minor tweaks. Seems to run OK.

Date: Wed Jul 21 18:11:14 2004
Author: ffjeld

Index: movitz/losp/tmp/packet.lisp
diff -u movitz/losp/tmp/packet.lisp:1.3 movitz/losp/tmp/packet.lisp:1.4
--- movitz/losp/tmp/packet.lisp:1.3	Wed Jul 21 15:37:06 2004
+++ movitz/losp/tmp/packet.lisp	Wed Jul 21 18:11:14 2004
@@ -171,13 +171,13 @@
 (defvar *encode-bit-offset* 0 "The current accumulator bit-position.")
 
 (defmacro with-buffer-output (() &body body)
-  `(let ((*encode-buffer* (make-array '(0) :element-type 'octet
+  `(let ((*encode-buffer* (make-array '(1514) :element-type 'octet
                                       :adjustable t :fill-pointer 0))
          (*encode-position* 0)
          (*encode-bit-bucket* 0)
          (*encode-bit-offset* 0))
-    , at body
-    (coerce *encode-buffer* 'buffer)))
+     , at body
+     (coerce *encode-buffer* 'buffer)))
 
 (defun encoding-position ()
   (length *encode-buffer*))
@@ -793,8 +793,8 @@
 
 (defun encode-test ()
   "Check that (encode (decode PACKET)) <=> identity."
-  (assert (and (equalp *udp-packet* (encode (decode *udp-packet*)))
-               (equalp *arp-packet* (encode (decode *arp-packet*))))))
+  (assert (not (mismatch *udp-packet* (encode (decode *udp-packet*)))))
+  (assert (not (mismatch *arp-packet* (encode (decode *arp-packet*))))))
 
 (defun bench (n)
   "Show how long it takes to decode and re-encode 10^N UDP packets."





More information about the Movitz-cvs mailing list