diff options
author | John Keeping | 2015-03-08 16:32:16 +0000 |
---|---|---|
committer | Jason A. Donenfeld | 2015-03-09 17:38:30 +0100 |
commit | e3d3fffdd447cdb4551549faae65bae5353a2cab (patch) | |
tree | 43ab1eaeeabf9269d0eebb64e64e957183f41b4d | |
parent | Makefile: add a target to run CGit through sparse (diff) | |
download | cgit-e3d3fffdd447cdb4551549faae65bae5353a2cab.tar.gz cgit-e3d3fffdd447cdb4551549faae65bae5353a2cab.zip |
Avoid non-ANSI function declarations
Sparse says things like: warning: non-ANSI function declaration of function 'calc_ttl' Signed-off-by: John Keeping <john@keeping.me.uk>
-rw-r--r-- | cgit.c | 2 | ||||
-rw-r--r-- | filter.c | 2 | ||||
-rw-r--r-- | ui-diff.c | 2 | ||||
-rw-r--r-- | ui-refs.c | 4 | ||||
-rw-r--r-- | ui-repolist.c | 6 | ||||
-rw-r--r-- | ui-shared.c | 12 | ||||
-rw-r--r-- | ui-ssdiff.c | 16 | ||||
-rw-r--r-- | ui-summary.c | 2 | ||||
-rw-r--r-- | ui-tree.c | 4 |
9 files changed, 25 insertions, 25 deletions
diff --git a/cgit.c b/cgit.c index 0ad8171..c16ed8c 100644 --- a/cgit.c +++ b/cgit.c | |||
@@ -1013,7 +1013,7 @@ static void cgit_parse_args(int argc, const char **argv) | |||
1013 | } | 1013 | } |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | static int calc_ttl() | 1016 | static int calc_ttl(void) |
1017 | { | 1017 | { |
1018 | if (!ctx.repo) | 1018 | if (!ctx.repo) |
1019 | return ctx.cfg.cache_root_ttl; | 1019 | return ctx.cfg.cache_root_ttl; |
diff --git a/filter.c b/filter.c index 9f433db..ebf4937 100644 --- a/filter.c +++ b/filter.c | |||
@@ -72,7 +72,7 @@ static inline void hook_write(struct cgit_filter *filter, ssize_t (*new_write)(s | |||
72 | filter_write = new_write; | 72 | filter_write = new_write; |
73 | } | 73 | } |
74 | 74 | ||
75 | static inline void unhook_write() | 75 | static inline void unhook_write(void) |
76 | { | 76 | { |
77 | assert(filter_write != NULL); | 77 | assert(filter_write != NULL); |
78 | assert(current_write_filter != NULL); | 78 | assert(current_write_filter != NULL); |
diff --git a/ui-diff.c b/ui-diff.c index 5b6df1f..8eff178 100644 --- a/ui-diff.c +++ b/ui-diff.c | |||
@@ -311,7 +311,7 @@ static void filepair_cb(struct diff_filepair *pair) | |||
311 | cgit_ssdiff_footer(); | 311 | cgit_ssdiff_footer(); |
312 | } | 312 | } |
313 | 313 | ||
314 | void cgit_print_diff_ctrls() | 314 | void cgit_print_diff_ctrls(void) |
315 | { | 315 | { |
316 | int i, curr; | 316 | int i, curr; |
317 | 317 | ||
diff --git a/ui-refs.c b/ui-refs.c index ac8a6d4..d3d71dd 100644 --- a/ui-refs.c +++ b/ui-refs.c | |||
@@ -82,7 +82,7 @@ static int print_branch(struct refinfo *ref) | |||
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | 84 | ||
85 | static void print_tag_header() | 85 | static void print_tag_header(void) |
86 | { | 86 | { |
87 | html("<tr class='nohover'><th class='left'>Tag</th>" | 87 | html("<tr class='nohover'><th class='left'>Tag</th>" |
88 | "<th class='left'>Download</th>" | 88 | "<th class='left'>Download</th>" |
@@ -234,7 +234,7 @@ void cgit_print_tags(int maxcount) | |||
234 | cgit_free_reflist_inner(&list); | 234 | cgit_free_reflist_inner(&list); |
235 | } | 235 | } |
236 | 236 | ||
237 | void cgit_print_refs() | 237 | void cgit_print_refs(void) |
238 | { | 238 | { |
239 | 239 | ||
240 | html("<table class='list nowrap'>"); | 240 | html("<table class='list nowrap'>"); |
diff --git a/ui-repolist.c b/ui-repolist.c index e945f67..a6d0321 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -117,7 +117,7 @@ static void print_sort_header(const char *title, const char *sort) | |||
117 | htmlf("'>%s</a></th>", title); | 117 | htmlf("'>%s</a></th>", title); |
118 | } | 118 | } |
119 | 119 | ||
120 | static void print_header() | 120 | static void print_header(void) |
121 | { | 121 | { |
122 | html("<tr class='nohover'>"); | 122 | html("<tr class='nohover'>"); |
123 | print_sort_header("Name", "name"); | 123 | print_sort_header("Name", "name"); |
@@ -247,7 +247,7 @@ static int sort_repolist(char *field) | |||
247 | } | 247 | } |
248 | 248 | ||
249 | 249 | ||
250 | void cgit_print_repolist() | 250 | void cgit_print_repolist(void) |
251 | { | 251 | { |
252 | int i, columns = 3, hits = 0, header = 0; | 252 | int i, columns = 3, hits = 0, header = 0; |
253 | char *last_section = NULL; | 253 | char *last_section = NULL; |
@@ -344,7 +344,7 @@ void cgit_print_repolist() | |||
344 | cgit_print_docend(); | 344 | cgit_print_docend(); |
345 | } | 345 | } |
346 | 346 | ||
347 | void cgit_print_site_readme() | 347 | void cgit_print_site_readme(void) |
348 | { | 348 | { |
349 | if (!ctx.cfg.root_readme) | 349 | if (!ctx.cfg.root_readme) |
350 | return; | 350 | return; |
diff --git a/ui-shared.c b/ui-shared.c index ff03cb2..6d3cfa9 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -46,7 +46,7 @@ void cgit_vprint_error(const char *fmt, va_list ap) | |||
46 | html("</div>\n"); | 46 | html("</div>\n"); |
47 | } | 47 | } |
48 | 48 | ||
49 | const char *cgit_httpscheme() | 49 | const char *cgit_httpscheme(void) |
50 | { | 50 | { |
51 | if (ctx.env.https && !strcmp(ctx.env.https, "on")) | 51 | if (ctx.env.https && !strcmp(ctx.env.https, "on")) |
52 | return "https://"; | 52 | return "https://"; |
@@ -54,7 +54,7 @@ const char *cgit_httpscheme() | |||
54 | return "http://"; | 54 | return "http://"; |
55 | } | 55 | } |
56 | 56 | ||
57 | const char *cgit_hosturl() | 57 | const char *cgit_hosturl(void) |
58 | { | 58 | { |
59 | if (ctx.env.http_host) | 59 | if (ctx.env.http_host) |
60 | return ctx.env.http_host; | 60 | return ctx.env.http_host; |
@@ -65,14 +65,14 @@ const char *cgit_hosturl() | |||
65 | return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port); | 65 | return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port); |
66 | } | 66 | } |
67 | 67 | ||
68 | const char *cgit_currenturl() | 68 | const char *cgit_currenturl(void) |
69 | { | 69 | { |
70 | if (!ctx.qry.url) | 70 | if (!ctx.qry.url) |
71 | return cgit_rooturl(); | 71 | return cgit_rooturl(); |
72 | return ctx.qry.url; | 72 | return ctx.qry.url; |
73 | } | 73 | } |
74 | 74 | ||
75 | const char *cgit_rooturl() | 75 | const char *cgit_rooturl(void) |
76 | { | 76 | { |
77 | if (ctx.cfg.virtual_root) | 77 | if (ctx.cfg.virtual_root) |
78 | return ctx.cfg.virtual_root; | 78 | return ctx.cfg.virtual_root; |
@@ -80,7 +80,7 @@ const char *cgit_rooturl() | |||
80 | return ctx.cfg.script_name; | 80 | return ctx.cfg.script_name; |
81 | } | 81 | } |
82 | 82 | ||
83 | const char *cgit_loginurl() | 83 | const char *cgit_loginurl(void) |
84 | { | 84 | { |
85 | static const char *login_url = 0; | 85 | static const char *login_url = 0; |
86 | if (!login_url) | 86 | if (!login_url) |
@@ -735,7 +735,7 @@ void cgit_print_docstart(void) | |||
735 | html_include(ctx.cfg.header); | 735 | html_include(ctx.cfg.header); |
736 | } | 736 | } |
737 | 737 | ||
738 | void cgit_print_docend() | 738 | void cgit_print_docend(void) |
739 | { | 739 | { |
740 | html("</div> <!-- class=content -->\n"); | 740 | html("</div> <!-- class=content -->\n"); |
741 | if (ctx.cfg.embedded) { | 741 | if (ctx.cfg.embedded) { |
diff --git a/ui-ssdiff.c b/ui-ssdiff.c index 08cf513..2146c71 100644 --- a/ui-ssdiff.c +++ b/ui-ssdiff.c | |||
@@ -18,7 +18,7 @@ struct deferred_lines { | |||
18 | static struct deferred_lines *deferred_old, *deferred_old_last; | 18 | static struct deferred_lines *deferred_old, *deferred_old_last; |
19 | static struct deferred_lines *deferred_new, *deferred_new_last; | 19 | static struct deferred_lines *deferred_new, *deferred_new_last; |
20 | 20 | ||
21 | static void create_or_reset_lcs_table() | 21 | static void create_or_reset_lcs_table(void) |
22 | { | 22 | { |
23 | int i; | 23 | int i; |
24 | 24 | ||
@@ -276,7 +276,7 @@ static void print_ssdiff_line(char *class, | |||
276 | free(old_line); | 276 | free(old_line); |
277 | } | 277 | } |
278 | 278 | ||
279 | static void print_deferred_old_lines() | 279 | static void print_deferred_old_lines(void) |
280 | { | 280 | { |
281 | struct deferred_lines *iter_old, *tmp; | 281 | struct deferred_lines *iter_old, *tmp; |
282 | iter_old = deferred_old; | 282 | iter_old = deferred_old; |
@@ -289,7 +289,7 @@ static void print_deferred_old_lines() | |||
289 | } | 289 | } |
290 | } | 290 | } |
291 | 291 | ||
292 | static void print_deferred_new_lines() | 292 | static void print_deferred_new_lines(void) |
293 | { | 293 | { |
294 | struct deferred_lines *iter_new, *tmp; | 294 | struct deferred_lines *iter_new, *tmp; |
295 | iter_new = deferred_new; | 295 | iter_new = deferred_new; |
@@ -302,7 +302,7 @@ static void print_deferred_new_lines() | |||
302 | } | 302 | } |
303 | } | 303 | } |
304 | 304 | ||
305 | static void print_deferred_changed_lines() | 305 | static void print_deferred_changed_lines(void) |
306 | { | 306 | { |
307 | struct deferred_lines *iter_old, *iter_new, *tmp; | 307 | struct deferred_lines *iter_old, *iter_new, *tmp; |
308 | int n_old_lines = calc_deferred_lines(deferred_old); | 308 | int n_old_lines = calc_deferred_lines(deferred_old); |
@@ -337,7 +337,7 @@ static void print_deferred_changed_lines() | |||
337 | } | 337 | } |
338 | } | 338 | } |
339 | 339 | ||
340 | void cgit_ssdiff_print_deferred_lines() | 340 | void cgit_ssdiff_print_deferred_lines(void) |
341 | { | 341 | { |
342 | if (!deferred_old && !deferred_new) | 342 | if (!deferred_old && !deferred_new) |
343 | return; | 343 | return; |
@@ -388,7 +388,7 @@ void cgit_ssdiff_line_cb(char *line, int len) | |||
388 | line[len - 1] = c; | 388 | line[len - 1] = c; |
389 | } | 389 | } |
390 | 390 | ||
391 | void cgit_ssdiff_header_begin() | 391 | void cgit_ssdiff_header_begin(void) |
392 | { | 392 | { |
393 | current_old_line = -1; | 393 | current_old_line = -1; |
394 | current_new_line = -1; | 394 | current_new_line = -1; |
@@ -396,12 +396,12 @@ void cgit_ssdiff_header_begin() | |||
396 | html("<tr><td class='head' colspan='4'>"); | 396 | html("<tr><td class='head' colspan='4'>"); |
397 | } | 397 | } |
398 | 398 | ||
399 | void cgit_ssdiff_header_end() | 399 | void cgit_ssdiff_header_end(void) |
400 | { | 400 | { |
401 | html("</td><tr>"); | 401 | html("</td><tr>"); |
402 | } | 402 | } |
403 | 403 | ||
404 | void cgit_ssdiff_footer() | 404 | void cgit_ssdiff_footer(void) |
405 | { | 405 | { |
406 | if (deferred_old || deferred_new) | 406 | if (deferred_old || deferred_new) |
407 | cgit_ssdiff_print_deferred_lines(); | 407 | cgit_ssdiff_print_deferred_lines(); |
diff --git a/ui-summary.c b/ui-summary.c index fa5ba04..b0af073 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
@@ -40,7 +40,7 @@ static void print_url(const char *url) | |||
40 | html("</a></td></tr>\n"); | 40 | html("</a></td></tr>\n"); |
41 | } | 41 | } |
42 | 42 | ||
43 | void cgit_print_summary() | 43 | void cgit_print_summary(void) |
44 | { | 44 | { |
45 | int columns = 3; | 45 | int columns = 3; |
46 | 46 | ||
diff --git a/ui-tree.c b/ui-tree.c index 4ab0137..bbc468e 100644 --- a/ui-tree.c +++ b/ui-tree.c | |||
@@ -180,7 +180,7 @@ static int ls_item(const unsigned char *sha1, struct strbuf *base, | |||
180 | return 0; | 180 | return 0; |
181 | } | 181 | } |
182 | 182 | ||
183 | static void ls_head() | 183 | static void ls_head(void) |
184 | { | 184 | { |
185 | html("<table summary='tree listing' class='list'>\n"); | 185 | html("<table summary='tree listing' class='list'>\n"); |
186 | html("<tr class='nohover'>"); | 186 | html("<tr class='nohover'>"); |
@@ -191,7 +191,7 @@ static void ls_head() | |||
191 | html("</tr>\n"); | 191 | html("</tr>\n"); |
192 | } | 192 | } |
193 | 193 | ||
194 | static void ls_tail() | 194 | static void ls_tail(void) |
195 | { | 195 | { |
196 | html("</table>\n"); | 196 | html("</table>\n"); |
197 | } | 197 | } |