summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dcde55b)
raw | patch | inline | side by side (parent: dcde55b)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 29 Jun 2005 07:32:11 +0000 (00:32 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Wed, 29 Jun 2005 16:11:38 +0000 (09:11 -0700) |
If we prefer 0 as maxsize for diff_delta() to say "unlimited", let's be
consistent about it.
This patch also fixes type mismatch in a call to get_delta_hdr_size()
from packed_delta_info().
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
consistent about it.
This patch also fixes type mismatch in a call to get_delta_hdr_size()
from packed_delta_info().
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
diffcore-break.c | patch | blob | history | |
sha1_file.c | patch | blob | history | |
test-delta.c | patch | blob | history |
diff --git a/diffcore-break.c b/diffcore-break.c
index 9852f9716cb1a52842044e557c175b19118f19fb..06f9a7f0ee25891ff6f4dd9646e39cd4c8b105fd 100644 (file)
--- a/diffcore-break.c
+++ b/diffcore-break.c
delta = diff_delta(src->data, src->size,
dst->data, dst->size,
- &delta_size, ~0UL);
+ &delta_size, 0);
/* Estimate the edit size by interpreting delta. */
if (count_delta(delta, delta_size,
diff --git a/sha1_file.c b/sha1_file.c
index 737ecb48002c873d43bafc99810feb00194b0d8c..fdb8a45c4e93ff3cc5a878bcacc3c9ee0278fcfd 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
char *type,
unsigned long *sizep)
{
- unsigned char *data;
+ const unsigned char *data;
unsigned char delta_head[64];
- unsigned long data_size, result_size, base_size, verify_base_size;
+ unsigned long result_size, base_size, verify_base_size;
z_stream stream;
int st;
if (sha1_object_info(base_sha1, type, &base_size))
die("cannot get info for delta-pack base");
- data = base_sha1 + 20;
- data_size = left - 20;
-
memset(&stream, 0, sizeof(stream));
- stream.next_in = data;
- stream.avail_in = data_size;
+ data = stream.next_in = base_sha1 + 20;
+ stream.avail_in = left - 20;
stream.next_out = delta_head;
stream.avail_out = sizeof(delta_head);
diff --git a/test-delta.c b/test-delta.c
index da51efc245c4f6b543a5695d402c902a3c343779..37ef86b283c2378017f1fc6bff05cc33fb25d7aa 100644 (file)
--- a/test-delta.c
+++ b/test-delta.c
if (argv[1][1] == 'd')
out_buf = diff_delta(from_buf, from_size,
data_buf, data_size,
- &out_size, ~0UL);
+ &out_size, 0);
else
out_buf = patch_delta(from_buf, from_size,
data_buf, data_size,