[nio-cvs] r63 - branches/home/psmith/restructure/src/buffer

psmith at common-lisp.net psmith at common-lisp.net
Sat Feb 3 03:16:10 UTC 2007


Author: psmith
Date: Fri Feb  2 22:16:10 2007
New Revision: 63

Modified:
   branches/home/psmith/restructure/src/buffer/buffer.lisp
Log:
Corrected compact

Modified: branches/home/psmith/restructure/src/buffer/buffer.lisp
==============================================================================
--- branches/home/psmith/restructure/src/buffer/buffer.lisp	(original)
+++ branches/home/psmith/restructure/src/buffer/buffer.lisp	Fri Feb  2 22:16:10 2007
@@ -88,8 +88,8 @@
 					;	    (format t "Current address : ~A~%" address)
 		      (if (>= address (+ start-address length)) 
 			  (progn 
-			    (format str "--")
-			    (format readable "--"))
+			    (format str (if (eql column-index 7) "   " ".. "))
+			    (format readable "."))
 			  (progn 
 			    (format str (if (eql column-index 7) "~A   " "~A ") (hex-dump-byte address))
 			    (format readable "~A" (get-readable-char (byte-value address)))))))))))))
@@ -153,10 +153,11 @@
 
 (defmethod compact((byte-buffer byte-buffer))
   :documentation "copy remaining bytes to the beginning of this buffer and set position to number of bytes copied (ready for a new put"
-  (with-slots (buf position limit) byte-buffer
+  (with-slots (buf position limit capacity) byte-buffer
     (let ((remaining (remaining byte-buffer)))
       (%memcpy buf (cffi:make-pointer (+ (cffi:pointer-address buf) position)) remaining)
-      (setf position remaining))))
+      (setf position remaining)
+      (setf limit capacity))))
 
 ;reads bytes from byte-buffer and returns a vector (unsigned-byte 8)
 (defmethod bytebuffer-read-vector((bb byte-buffer) &optional (num-bytes-to-read (remaining bb)))



More information about the Nio-cvs mailing list