enhance bitfield copy
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 30 Sep 2010 01:51:56 +0000 (21:51 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 30 Sep 2010 01:51:56 +0000 (21:51 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
types/bitfield.c

index dc0e474392b79727673974e13c6a56cbb8f802c8..e9a9f69662e31ab53af56d051e0426cb9dbe0fd9 100644 (file)
@@ -41,8 +41,12 @@ size_t bitfield_copy(unsigned char *dest, const struct format *fdest,
 
        if (!(int_class->p.alignment % CHAR_BIT)
            && !(int_class->len % CHAR_BIT)
-           && !(bitfield_class->start_offset))
+           && !(bitfield_class->start_offset % CHAR_BIT)) {
+               size_t offset = bitfield_class->start_offset / CHAR_BIT;
+               dest += offset;
+               src += offset;
                return integer_copy(dest, fdest, src, fsrc, type_class);
+       }
 
        if (!int_class->signedness) {
                uint64_t v;
This page took 0.034248 seconds and 4 git commands to generate.