Merge branch 'lt/rev-list' into next
[gitweb.git] / delta.h
diff --git a/delta.h b/delta.h
index 31d1820f80f2887d51808170fc86585ada42d42e..00fef0b8d739702c6cf664b35679c4897c0ca13f 100644 (file)
--- a/delta.h
+++ b/delta.h
@@ -4,7 +4,8 @@
 /* handling of delta buffers */
 extern void *diff_delta(void *from_buf, unsigned long from_size,
                        void *to_buf, unsigned long to_size,
-                       unsigned long *delta_size, unsigned long max_size);
+                       unsigned long *delta_size, unsigned long max_size,
+                       void **from_index);
 extern void *patch_delta(void *src_buf, unsigned long src_size,
                         void *delta_buf, unsigned long delta_size,
                         unsigned long *dst_size);
@@ -19,14 +20,14 @@ extern void *patch_delta(void *src_buf, unsigned long src_size,
 static inline unsigned long get_delta_hdr_size(const unsigned char **datap)
 {
        const unsigned char *data = *datap;
-       unsigned char cmd = *data++;
-       unsigned long size = cmd & ~0x80;
-       int i = 7;
-       while (cmd & 0x80) {
+       unsigned char cmd;
+       unsigned long size = 0;
+       int i = 0;
+       do {
                cmd = *data++;
                size |= (cmd & ~0x80) << i;
                i += 7;
-       }
+       } while (cmd & 0x80);
        *datap = data;
        return size;
 }