summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 06f59e9)
raw | patch | inline | side by side (parent: 06f59e9)
author | Junio C Hamano <gitster@pobox.com> | |
Fri, 29 Jun 2007 05:54:37 +0000 (22:54 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 1 Jul 2007 03:51:31 +0000 (20:51 -0700) |
We may want to use richer information on the data we are dealing
with in this function, so instead of passing a buffer address
and length, just pass the diffcore_filespec structure. Existing
callers always call this function with parameters taken from a
filespec anyway, so there is no functionality changes.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
with in this function, so instead of passing a buffer address
and length, just pass the diffcore_filespec structure. Existing
callers always call this function with parameters taken from a
filespec anyway, so there is no functionality changes.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diffcore-break.c | patch | blob | history | |
diffcore-delta.c | patch | blob | history | |
diffcore-rename.c | patch | blob | history | |
diffcore.h | patch | blob | history |
diff --git a/diffcore-break.c b/diffcore-break.c
index 9c19b8cab778362b9d369135e743fb232a7cd295..ae8a7d03e2d103739897ac37fe1f9966956b9ec8 100644 (file)
--- a/diffcore-break.c
+++ b/diffcore-break.c
if (base_size < MINIMUM_BREAK_SIZE)
return 0; /* we do not break too small filepair */
- if (diffcore_count_changes(src->data, src->size,
- dst->data, dst->size,
+ if (diffcore_count_changes(src, dst,
NULL, NULL,
0,
&src_copied, &literal_added))
diff --git a/diffcore-delta.c b/diffcore-delta.c
index 7338a40c5964ae6ddfb855465249fc1a2fa5a2a3..0e1fae79de47029b212805170bb3e3b29bf6bf81 100644 (file)
--- a/diffcore-delta.c
+++ b/diffcore-delta.c
return hash;
}
-int diffcore_count_changes(void *src, unsigned long src_size,
- void *dst, unsigned long dst_size,
+int diffcore_count_changes(struct diff_filespec *src,
+ struct diff_filespec *dst,
void **src_count_p,
void **dst_count_p,
unsigned long delta_limit,
if (src_count_p)
src_count = *src_count_p;
if (!src_count) {
- src_count = hash_chars(src, src_size);
+ src_count = hash_chars(src->data, src->size);
if (src_count_p)
*src_count_p = src_count;
}
if (dst_count_p)
dst_count = *dst_count_p;
if (!dst_count) {
- dst_count = hash_chars(dst, dst_size);
+ dst_count = hash_chars(dst->data, dst->size);
if (dst_count_p)
*dst_count_p = dst_count;
}
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 79c984c9cf5489d22f359b7a2ad3464ffc271c35..cb227366b8e12cc692c968560bc550776b6c9705 100644 (file)
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
delta_limit = (unsigned long)
(base_size * (MAX_SCORE-minimum_score) / MAX_SCORE);
- if (diffcore_count_changes(src->data, src->size,
- dst->data, dst->size,
+ if (diffcore_count_changes(src, dst,
&src->cnt_data, &dst->cnt_data,
delta_limit,
&src_copied, &literal_added))
diff --git a/diffcore.h b/diffcore.h
index 7b9294eab2c1cb9f7cb03307c90203344d97e3f6..990dec50f1e6ea4649800c7778fadb78883d5ea4 100644 (file)
--- a/diffcore.h
+++ b/diffcore.h
#define diff_debug_queue(a,b) do {} while(0)
#endif
-extern int diffcore_count_changes(void *src, unsigned long src_size,
- void *dst, unsigned long dst_size,
+extern int diffcore_count_changes(struct diff_filespec *src,
+ struct diff_filespec *dst,
void **src_count_p,
void **dst_count_p,
unsigned long delta_limit,