]> asedeno.scripts.mit.edu Git - cl-protobufs.git/commitdiff
wire-format: Drop unnecessary clamping for callers of ENCODE-UINT functions
authorAlejandro R Sedeño <asedeno@google.com>
Fri, 5 Apr 2013 05:23:01 +0000 (01:23 -0400)
committerAlejandro R Sedeño <asedeno@google.com>
Wed, 29 May 2013 22:01:11 +0000 (18:01 -0400)
wire-format.lisp

index e78e98fb7130eaaf01c210ef8dd1bc59b045ba27..2d80c8189af28a17a486302aa5dda57d2f56276e 100644 (file)
                       (format nil "~A:~A" (package-name (symbol-package val)) (symbol-name val)))))
            (encode-string val buffer idx)))
         ((:date :time :datetime :timestamp)
-         (encode-uint64 (ldb (byte 64 0) val) buffer idx))))))
+         (encode-uint64 val buffer idx))))))
 
 (define-compiler-macro serialize-prim (&whole form val type tag buffer index)
   (setq type (fold-symbol type)
            (idx (encode-uint32 tag buffer index)))
       (declare (type (unsigned-byte 32) val)
                (type fixnum idx))
-      (encode-uint32 (ldb (byte 32 0) val) buffer idx))))
+      (encode-uint32 val buffer idx))))
 
 (defun serialize-packed-enum (values enum-values tag buffer index)
   "Serializes Protobufs enum values into the buffer at the given index.
                   (let ((val (let ((e (find val enum-values :key #'proto-value)))
                                (and e (proto-index e)))))
                     (declare (type (unsigned-byte 32) val))
-                    (setq idx (encode-uint32 (ldb (byte 32 0) val) buffer idx)))) values)
+                    (setq idx (encode-uint32 val buffer idx)))) values)
       idx)))