author | Lars Hjemli <hjemli@gmail.com> | 2007-09-19 22:21:47 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-09-19 22:21:47 (UTC) |
commit | 0835ffefb8a1f5387463b22e2e5f7e34d387d7b1 (patch) (unidiff) | |
tree | b05423687e97b885f8a6b2617bb6018fbb9d3407 | |
parent | 6df9c7028a489578bc8593e56298cd869fcdc1fc (diff) | |
download | cgit-0835ffefb8a1f5387463b22e2e5f7e34d387d7b1.zip cgit-0835ffefb8a1f5387463b22e2e5f7e34d387d7b1.tar.gz cgit-0835ffefb8a1f5387463b22e2e5f7e34d387d7b1.tar.bz2 |
Remove a few compiler warnings
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | shared.c | 3 | ||||
-rw-r--r-- | ui-tree.c | 2 |
2 files changed, 3 insertions, 2 deletions
@@ -295,33 +295,34 @@ void cgit_diff_tree_cb(struct diff_queue_struct *q, | |||
295 | 295 | ||
296 | for (i = 0; i < q->nr; i++) { | 296 | for (i = 0; i < q->nr; i++) { |
297 | if (q->queue[i]->status == 'U') | 297 | if (q->queue[i]->status == 'U') |
298 | continue; | 298 | continue; |
299 | ((filepair_fn)data)(q->queue[i]); | 299 | ((filepair_fn)data)(q->queue[i]); |
300 | } | 300 | } |
301 | } | 301 | } |
302 | 302 | ||
303 | static int load_mmfile(mmfile_t *file, const unsigned char *sha1) | 303 | static int load_mmfile(mmfile_t *file, const unsigned char *sha1) |
304 | { | 304 | { |
305 | enum object_type type; | 305 | enum object_type type; |
306 | 306 | ||
307 | if (is_null_sha1(sha1)) { | 307 | if (is_null_sha1(sha1)) { |
308 | file->ptr = (char *)""; | 308 | file->ptr = (char *)""; |
309 | file->size = 0; | 309 | file->size = 0; |
310 | } else { | 310 | } else { |
311 | file->ptr = read_sha1_file(sha1, &type, &file->size); | 311 | file->ptr = read_sha1_file(sha1, &type, |
312 | (unsigned long *)&file->size); | ||
312 | } | 313 | } |
313 | return 1; | 314 | return 1; |
314 | } | 315 | } |
315 | 316 | ||
316 | /* | 317 | /* |
317 | * Receive diff-buffers from xdiff and concatenate them as | 318 | * Receive diff-buffers from xdiff and concatenate them as |
318 | * needed across multiple callbacks. | 319 | * needed across multiple callbacks. |
319 | * | 320 | * |
320 | * This is basically a copy of xdiff-interface.c/xdiff_outf(), | 321 | * This is basically a copy of xdiff-interface.c/xdiff_outf(), |
321 | * ripped from git and modified to use globals instead of | 322 | * ripped from git and modified to use globals instead of |
322 | * a special callback-struct. | 323 | * a special callback-struct. |
323 | */ | 324 | */ |
324 | char *diffbuf = NULL; | 325 | char *diffbuf = NULL; |
325 | int buflen = 0; | 326 | int buflen = 0; |
326 | 327 | ||
327 | int filediff_cb(void *priv, mmbuffer_t *mb, int nbuf) | 328 | int filediff_cb(void *priv, mmbuffer_t *mb, int nbuf) |
@@ -2,33 +2,33 @@ | |||
2 | * | 2 | * |
3 | * Copyright (C) 2006 Lars Hjemli | 3 | * Copyright (C) 2006 Lars Hjemli |
4 | * | 4 | * |
5 | * Licensed under GNU General Public License v2 | 5 | * Licensed under GNU General Public License v2 |
6 | * (see COPYING for full license text) | 6 | * (see COPYING for full license text) |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "cgit.h" | 9 | #include "cgit.h" |
10 | 10 | ||
11 | char *curr_rev; | 11 | char *curr_rev; |
12 | char *match_path; | 12 | char *match_path; |
13 | int header = 0; | 13 | int header = 0; |
14 | 14 | ||
15 | static void print_object(const unsigned char *sha1, char *path) | 15 | static void print_object(const unsigned char *sha1, char *path) |
16 | { | 16 | { |
17 | enum object_type type; | 17 | enum object_type type; |
18 | unsigned char *buf; | 18 | char *buf; |
19 | unsigned long size, lineno, start, idx; | 19 | unsigned long size, lineno, start, idx; |
20 | const char *linefmt = "<tr><td class='no'><a name='%1$d'>%1$d</a></td><td class='txt'>"; | 20 | const char *linefmt = "<tr><td class='no'><a name='%1$d'>%1$d</a></td><td class='txt'>"; |
21 | 21 | ||
22 | type = sha1_object_info(sha1, &size); | 22 | type = sha1_object_info(sha1, &size); |
23 | if (type == OBJ_BAD) { | 23 | if (type == OBJ_BAD) { |
24 | cgit_print_error(fmt("Bad object name: %s", | 24 | cgit_print_error(fmt("Bad object name: %s", |
25 | sha1_to_hex(sha1))); | 25 | sha1_to_hex(sha1))); |
26 | return; | 26 | return; |
27 | } | 27 | } |
28 | 28 | ||
29 | buf = read_sha1_file(sha1, &type, &size); | 29 | buf = read_sha1_file(sha1, &type, &size); |
30 | if (!buf) { | 30 | if (!buf) { |
31 | cgit_print_error(fmt("Error reading object %s", | 31 | cgit_print_error(fmt("Error reading object %s", |
32 | sha1_to_hex(sha1))); | 32 | sha1_to_hex(sha1))); |
33 | return; | 33 | return; |
34 | } | 34 | } |