summaryrefslogtreecommitdiffabout
path: root/shared.c
Side-by-side diff
Diffstat (limited to 'shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--shared.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/shared.c b/shared.c
index 1cd60a2..343a4f9 100644
--- a/shared.c
+++ b/shared.c
@@ -287,49 +287,50 @@ char *trim_end(const char *str, char c)
t[len] = c;
return s;
}
void cgit_diff_tree_cb(struct diff_queue_struct *q,
struct diff_options *options, void *data)
{
int i;
for (i = 0; i < q->nr; i++) {
if (q->queue[i]->status == 'U')
continue;
((filepair_fn)data)(q->queue[i]);
}
}
static int load_mmfile(mmfile_t *file, const unsigned char *sha1)
{
enum object_type type;
if (is_null_sha1(sha1)) {
file->ptr = (char *)"";
file->size = 0;
} else {
- file->ptr = read_sha1_file(sha1, &type, &file->size);
+ file->ptr = read_sha1_file(sha1, &type,
+ (unsigned long *)&file->size);
}
return 1;
}
/*
* Receive diff-buffers from xdiff and concatenate them as
* needed across multiple callbacks.
*
* This is basically a copy of xdiff-interface.c/xdiff_outf(),
* ripped from git and modified to use globals instead of
* a special callback-struct.
*/
char *diffbuf = NULL;
int buflen = 0;
int filediff_cb(void *priv, mmbuffer_t *mb, int nbuf)
{
int i;
for (i = 0; i < nbuf; i++) {
if (mb[i].ptr[mb[i].size-1] != '\n') {
/* Incomplete line */
diffbuf = xrealloc(diffbuf, buflen + mb[i].size);
memcpy(diffbuf + buflen, mb[i].ptr, mb[i].size);