summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--shared.c3
-rw-r--r--ui-tree.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/shared.c b/shared.c
index 1cd60a2..343a4f9 100644
--- a/shared.c
+++ b/shared.c
@@ -295,33 +295,34 @@ void cgit_diff_tree_cb(struct diff_queue_struct *q,
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)
diff --git a/ui-tree.c b/ui-tree.c
index 15d1f5a..d6bcec3 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -2,33 +2,33 @@
*
* Copyright (C) 2006 Lars Hjemli
*
* Licensed under GNU General Public License v2
* (see COPYING for full license text)
*/
#include "cgit.h"
char *curr_rev;
char *match_path;
int header = 0;
static void print_object(const unsigned char *sha1, char *path)
{
enum object_type type;
- unsigned char *buf;
+ char *buf;
unsigned long size, lineno, start, idx;
const char *linefmt = "<tr><td class='no'><a name='%1$d'>%1$d</a></td><td class='txt'>";
type = sha1_object_info(sha1, &size);
if (type == OBJ_BAD) {
cgit_print_error(fmt("Bad object name: %s",
sha1_to_hex(sha1)));
return;
}
buf = read_sha1_file(sha1, &type, &size);
if (!buf) {
cgit_print_error(fmt("Error reading object %s",
sha1_to_hex(sha1)));
return;
}