]> granicus.if.org Git - cgit/commitdiff
Avoid non-ANSI function declarations
authorJohn Keeping <john@keeping.me.uk>
Sun, 8 Mar 2015 16:32:16 +0000 (16:32 +0000)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 9 Mar 2015 16:38:30 +0000 (17:38 +0100)
Sparse says things like:

warning: non-ANSI function declaration of function 'calc_ttl'

Signed-off-by: John Keeping <john@keeping.me.uk>
cgit.c
filter.c
ui-diff.c
ui-refs.c
ui-repolist.c
ui-shared.c
ui-ssdiff.c
ui-summary.c
ui-tree.c

diff --git a/cgit.c b/cgit.c
index 0ad81716f17b3b5bf903e497aaaa4131134ed96a..c16ed8c4885402970e535e1181a59fdd30d64382 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -1013,7 +1013,7 @@ static void cgit_parse_args(int argc, const char **argv)
        }
 }
 
-static int calc_ttl()
+static int calc_ttl(void)
 {
        if (!ctx.repo)
                return ctx.cfg.cache_root_ttl;
index 9f433dbc178df40259245ba7b8b18702920e33fd..ebf4937d24b9331703781b1d9fd01c6d512c767a 100644 (file)
--- a/filter.c
+++ b/filter.c
@@ -72,7 +72,7 @@ static inline void hook_write(struct cgit_filter *filter, ssize_t (*new_write)(s
        filter_write = new_write;
 }
 
-static inline void unhook_write()
+static inline void unhook_write(void)
 {
        assert(filter_write != NULL);
        assert(current_write_filter != NULL);
index 5b6df1ff972226e30a5fcf6418d21ec1e92f04dc..8eff178c6e3e8cd33c64c8bf5b21a0c143ce112e 100644 (file)
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -311,7 +311,7 @@ static void filepair_cb(struct diff_filepair *pair)
                cgit_ssdiff_footer();
 }
 
-void cgit_print_diff_ctrls()
+void cgit_print_diff_ctrls(void)
 {
        int i, curr;
 
index ac8a6d446e14765afabfcffe0f41f6fb32256b68..d3d71dd0d9a6aa18c7ead4cdabcce672b606f310 100644 (file)
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -82,7 +82,7 @@ static int print_branch(struct refinfo *ref)
        return 0;
 }
 
-static void print_tag_header()
+static void print_tag_header(void)
 {
        html("<tr class='nohover'><th class='left'>Tag</th>"
             "<th class='left'>Download</th>"
@@ -234,7 +234,7 @@ void cgit_print_tags(int maxcount)
        cgit_free_reflist_inner(&list);
 }
 
-void cgit_print_refs()
+void cgit_print_refs(void)
 {
 
        html("<table class='list nowrap'>");
index e945f6733270f83f654a3204a75edb42a0156f68..a6d032114db92ab052deaae236939a82f7992027 100644 (file)
@@ -117,7 +117,7 @@ static void print_sort_header(const char *title, const char *sort)
        htmlf("'>%s</a></th>", title);
 }
 
-static void print_header()
+static void print_header(void)
 {
        html("<tr class='nohover'>");
        print_sort_header("Name", "name");
@@ -247,7 +247,7 @@ static int sort_repolist(char *field)
 }
 
 
-void cgit_print_repolist()
+void cgit_print_repolist(void)
 {
        int i, columns = 3, hits = 0, header = 0;
        char *last_section = NULL;
@@ -344,7 +344,7 @@ void cgit_print_repolist()
        cgit_print_docend();
 }
 
-void cgit_print_site_readme()
+void cgit_print_site_readme(void)
 {
        if (!ctx.cfg.root_readme)
                return;
index ff03cb25adf5eeb9ea5a09dc0bbc084921cae5e1..6d3cfa9c5101c1d766795ff4cb2cc23a6ad06767 100644 (file)
@@ -46,7 +46,7 @@ void cgit_vprint_error(const char *fmt, va_list ap)
        html("</div>\n");
 }
 
-const char *cgit_httpscheme()
+const char *cgit_httpscheme(void)
 {
        if (ctx.env.https && !strcmp(ctx.env.https, "on"))
                return "https://";
@@ -54,7 +54,7 @@ const char *cgit_httpscheme()
                return "http://";
 }
 
-const char *cgit_hosturl()
+const char *cgit_hosturl(void)
 {
        if (ctx.env.http_host)
                return ctx.env.http_host;
@@ -65,14 +65,14 @@ const char *cgit_hosturl()
        return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port);
 }
 
-const char *cgit_currenturl()
+const char *cgit_currenturl(void)
 {
        if (!ctx.qry.url)
                return cgit_rooturl();
        return ctx.qry.url;
 }
 
-const char *cgit_rooturl()
+const char *cgit_rooturl(void)
 {
        if (ctx.cfg.virtual_root)
                return ctx.cfg.virtual_root;
@@ -80,7 +80,7 @@ const char *cgit_rooturl()
                return ctx.cfg.script_name;
 }
 
-const char *cgit_loginurl()
+const char *cgit_loginurl(void)
 {
        static const char *login_url = 0;
        if (!login_url)
@@ -735,7 +735,7 @@ void cgit_print_docstart(void)
                html_include(ctx.cfg.header);
 }
 
-void cgit_print_docend()
+void cgit_print_docend(void)
 {
        html("</div> <!-- class=content -->\n");
        if (ctx.cfg.embedded) {
index 08cf513b477097b85315e448f80401900f50e5d8..2146c7120d7a38a7a87b64f1e8183c6340406dce 100644 (file)
@@ -18,7 +18,7 @@ struct deferred_lines {
 static struct deferred_lines *deferred_old, *deferred_old_last;
 static struct deferred_lines *deferred_new, *deferred_new_last;
 
-static void create_or_reset_lcs_table()
+static void create_or_reset_lcs_table(void)
 {
        int i;
 
@@ -276,7 +276,7 @@ static void print_ssdiff_line(char *class,
                free(old_line);
 }
 
-static void print_deferred_old_lines()
+static void print_deferred_old_lines(void)
 {
        struct deferred_lines *iter_old, *tmp;
        iter_old = deferred_old;
@@ -289,7 +289,7 @@ static void print_deferred_old_lines()
        }
 }
 
-static void print_deferred_new_lines()
+static void print_deferred_new_lines(void)
 {
        struct deferred_lines *iter_new, *tmp;
        iter_new = deferred_new;
@@ -302,7 +302,7 @@ static void print_deferred_new_lines()
        }
 }
 
-static void print_deferred_changed_lines()
+static void print_deferred_changed_lines(void)
 {
        struct deferred_lines *iter_old, *iter_new, *tmp;
        int n_old_lines = calc_deferred_lines(deferred_old);
@@ -337,7 +337,7 @@ static void print_deferred_changed_lines()
        }
 }
 
-void cgit_ssdiff_print_deferred_lines()
+void cgit_ssdiff_print_deferred_lines(void)
 {
        if (!deferred_old && !deferred_new)
                return;
@@ -388,7 +388,7 @@ void cgit_ssdiff_line_cb(char *line, int len)
        line[len - 1] = c;
 }
 
-void cgit_ssdiff_header_begin()
+void cgit_ssdiff_header_begin(void)
 {
        current_old_line = -1;
        current_new_line = -1;
@@ -396,12 +396,12 @@ void cgit_ssdiff_header_begin()
        html("<tr><td class='head' colspan='4'>");
 }
 
-void cgit_ssdiff_header_end()
+void cgit_ssdiff_header_end(void)
 {
        html("</td><tr>");
 }
 
-void cgit_ssdiff_footer()
+void cgit_ssdiff_footer(void)
 {
        if (deferred_old || deferred_new)
                cgit_ssdiff_print_deferred_lines();
index fa5ba0423669bb9a00ee8fa3dcebb274c7e7076a..b0af0737a14762a808428829342ec42c3e6e743b 100644 (file)
@@ -40,7 +40,7 @@ static void print_url(const char *url)
        html("</a></td></tr>\n");
 }
 
-void cgit_print_summary()
+void cgit_print_summary(void)
 {
        int columns = 3;
 
index 4ab01372e7bacd44b1601ad8b5a5e6a84f9f6b47..bbc468ef7ec03395dfc04daa240e8c1330fcd41e 100644 (file)
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -180,7 +180,7 @@ static int ls_item(const unsigned char *sha1, struct strbuf *base,
        return 0;
 }
 
-static void ls_head()
+static void ls_head(void)
 {
        html("<table summary='tree listing' class='list'>\n");
        html("<tr class='nohover'>");
@@ -191,7 +191,7 @@ static void ls_head()
        html("</tr>\n");
 }
 
-static void ls_tail()
+static void ls_tail(void)
 {
        html("</table>\n");
 }