]> asedeno.scripts.mit.edu Git - cl-protobufs.git/commitdiff
wire-format: More type declarations
authorAlejandro R Sedeño <asedeno@google.com>
Mon, 29 Apr 2013 20:04:00 +0000 (16:04 -0400)
committerAlejandro R Sedeño <asedeno@google.com>
Wed, 29 May 2013 22:02:07 +0000 (18:02 -0400)
wire-format.lisp

index f2adce4ff8bad800bbda6ed16e0128c785fca648..98d2b8dfdf31ca2542eab69aae145ac852cda6d4 100644 (file)
    Watch out, this function turns off all type checking and array bounds checking."
   (declare #.$optimize-serialization)
   (declare (type (simple-array (unsigned-byte 8)) buffer)
+           (type (signed-byte 64) val)
            (type fixnum index))
   ;; Seven bits at a time, least significant bits first
   (loop repeat 9                ;up to 63 bits
            (type (simple-array (unsigned-byte 8)) buffer)
            (type fixnum index))
   (let ((bits (single-float-bits val)))
+    (declare (type (signed-byte 32) bits))
     (loop repeat 4 doing
       (let ((byte (ldb (byte 8 0) bits)))
         (declare (type (unsigned-byte 8) byte))
            (type fixnum index))
   (multiple-value-bind (low high)
       (double-float-bits val)
+    (declare (type (unsigned-byte 32) low)
+             (type (signed-byte 32) high))
     (loop repeat 4 doing
       (let ((byte (ldb (byte 8 0) low)))
         (declare (type (unsigned-byte 8) byte))