projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into js/fmt-patch
[git.git]
/
delta.h
diff --git
a/delta.h
b/delta.h
index
a15350d
..
09b2e1e
100644
(file)
--- a/
delta.h
+++ b/
delta.h
@@
-2,11
+2,11
@@
#define DELTA_H
/* handling of delta buffers */
#define DELTA_H
/* handling of delta buffers */
-extern void *diff_delta(void *from_buf, unsigned long from_size,
- void *to_buf, unsigned long to_size,
+extern void *diff_delta(
const
void *from_buf, unsigned long from_size,
+
const
void *to_buf, unsigned long to_size,
unsigned long *delta_size, unsigned long max_size);
extern void *patch_delta(void *src_buf, unsigned long src_size,
unsigned long *delta_size, unsigned long max_size);
extern void *patch_delta(void *src_buf, unsigned long src_size,
- void *delta_buf, unsigned long delta_size,
+
const
void *delta_buf, unsigned long delta_size,
unsigned long *dst_size);
/* the smallest possible delta size is 4 bytes */
unsigned long *dst_size);
/* the smallest possible delta size is 4 bytes */
@@
-16,7
+16,8
@@
extern void *patch_delta(void *src_buf, unsigned long src_size,
* This must be called twice on the delta data buffer, first to get the
* expected reference buffer size, and again to get the result buffer size.
*/
* This must be called twice on the delta data buffer, first to get the
* expected reference buffer size, and again to get the result buffer size.
*/
-static inline unsigned long get_delta_hdr_size(const unsigned char **datap)
+static inline unsigned long get_delta_hdr_size(const unsigned char **datap,
+ const unsigned char *top)
{
const unsigned char *data = *datap;
unsigned char cmd;
{
const unsigned char *data = *datap;
unsigned char cmd;
@@
-26,7
+27,7
@@
static inline unsigned long get_delta_hdr_size(const unsigned char **datap)
cmd = *data++;
size |= (cmd & ~0x80) << i;
i += 7;
cmd = *data++;
size |= (cmd & ~0x80) << i;
i += 7;
- } while (cmd & 0x80);
+ } while (cmd & 0x80
&& data < top
);
*datap = data;
return size;
}
*datap = data;
return size;
}