diff options
author | John Keeping <john@keeping.me.uk> | 2013-04-06 19:37:59 (JST) |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-04-08 22:45:34 (JST) |
commit | 8f208794318f83826e98168b8b430f2d9a68bcce (patch) | |
tree | b8e2b81f4899e75eda3666cba24ac3dc06daf151 | |
parent | a5e4ad2d8b9c6bcfc7029894d3a3837166996b35 (diff) | |
download | cgit-8f208794318f83826e98168b8b430f2d9a68bcce.zip cgit-8f208794318f83826e98168b8b430f2d9a68bcce.tar.gz |
Always #include corresponding .h in .c files
While doing this, remove declarations from header files where the
corresponding definition is declared "static" in order to avoid build
errors.
Also re-order existing headers in ui-*.c so that the file-specific
header always comes immediately after "cgit.h", helping with future
consistency.
Signed-off-by: John Keeping <john@keeping.me.uk>
-rw-r--r-- | html.c | 1 | ||||
-rw-r--r-- | html.h | 2 | ||||
-rw-r--r-- | scan-tree.c | 1 | ||||
-rw-r--r-- | ui-atom.c | 1 | ||||
-rw-r--r-- | ui-blob.c | 1 | ||||
-rw-r--r-- | ui-clone.c | 1 | ||||
-rw-r--r-- | ui-commit.c | 1 | ||||
-rw-r--r-- | ui-diff.c | 1 | ||||
-rw-r--r-- | ui-diff.h | 3 | ||||
-rw-r--r-- | ui-log.c | 1 | ||||
-rw-r--r-- | ui-patch.c | 1 | ||||
-rw-r--r-- | ui-plain.c | 1 | ||||
-rw-r--r-- | ui-refs.c | 1 | ||||
-rw-r--r-- | ui-repolist.c | 1 | ||||
-rw-r--r-- | ui-shared.c | 1 | ||||
-rw-r--r-- | ui-shared.h | 2 | ||||
-rw-r--r-- | ui-snapshot.c | 1 | ||||
-rw-r--r-- | ui-ssdiff.c | 2 | ||||
-rw-r--r-- | ui-stats.c | 2 | ||||
-rw-r--r-- | ui-summary.c | 1 | ||||
-rw-r--r-- | ui-tag.c | 1 | ||||
-rw-r--r-- | ui-tree.c | 1 |
22 files changed, 20 insertions, 8 deletions
@@ -6,6 +6,7 @@ | |||
6 | * (see COPYING for full license text) | 6 | * (see COPYING for full license text) |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "html.h" | ||
9 | #include <unistd.h> | 10 | #include <unistd.h> |
10 | #include <stdio.h> | 11 | #include <stdio.h> |
11 | #include <stdlib.h> | 12 | #include <stdlib.h> |
@@ -1,7 +1,7 @@ | |||
1 | #ifndef HTML_H | 1 | #ifndef HTML_H |
2 | #define HTML_H | 2 | #define HTML_H |
3 | 3 | ||
4 | extern int htmlfd; | 4 | #include <stddef.h> |
5 | 5 | ||
6 | extern void html_raw(const char *txt, size_t size); | 6 | extern void html_raw(const char *txt, size_t size); |
7 | extern void html(const char *txt); | 7 | extern void html(const char *txt); |
diff --git a/scan-tree.c b/scan-tree.c index 10d90f4..0d3e0ad 100644 --- a/scan-tree.c +++ b/scan-tree.c | |||
@@ -8,6 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include "cgit.h" | 10 | #include "cgit.h" |
11 | #include "scan-tree.h" | ||
11 | #include "configfile.h" | 12 | #include "configfile.h" |
12 | #include "html.h" | 13 | #include "html.h" |
13 | 14 | ||
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "cgit.h" | 9 | #include "cgit.h" |
10 | #include "ui-atom.h" | ||
10 | #include "html.h" | 11 | #include "html.h" |
11 | #include "ui-shared.h" | 12 | #include "ui-shared.h" |
12 | 13 | ||
@@ -8,6 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include "cgit.h" | 10 | #include "cgit.h" |
11 | #include "ui-blob.h" | ||
11 | #include "html.h" | 12 | #include "html.h" |
12 | #include "ui-shared.h" | 13 | #include "ui-shared.h" |
13 | 14 | ||
@@ -8,6 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include "cgit.h" | 10 | #include "cgit.h" |
11 | #include "ui-clone.h" | ||
11 | #include "html.h" | 12 | #include "html.h" |
12 | #include "ui-shared.h" | 13 | #include "ui-shared.h" |
13 | 14 | ||
diff --git a/ui-commit.c b/ui-commit.c index 5a552a1..8310ce6 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "cgit.h" | 9 | #include "cgit.h" |
10 | #include "ui-commit.h" | ||
10 | #include "html.h" | 11 | #include "html.h" |
11 | #include "ui-shared.h" | 12 | #include "ui-shared.h" |
12 | #include "ui-diff.h" | 13 | #include "ui-diff.h" |
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "cgit.h" | 9 | #include "cgit.h" |
10 | #include "ui-diff.h" | ||
10 | #include "html.h" | 11 | #include "html.h" |
11 | #include "ui-shared.h" | 12 | #include "ui-shared.h" |
12 | #include "ui-ssdiff.h" | 13 | #include "ui-ssdiff.h" |
@@ -3,9 +3,6 @@ | |||
3 | 3 | ||
4 | extern void cgit_print_diff_ctrls(); | 4 | extern void cgit_print_diff_ctrls(); |
5 | 5 | ||
6 | extern void cgit_print_diffstat(const unsigned char *old_sha1, | ||
7 | const unsigned char *new_sha1); | ||
8 | |||
9 | extern void cgit_print_diff(const char *new_hex, const char *old_hex, | 6 | extern void cgit_print_diff(const char *new_hex, const char *old_hex, |
10 | const char *prefix, int show_ctrls); | 7 | const char *prefix, int show_ctrls); |
11 | 8 | ||
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "cgit.h" | 9 | #include "cgit.h" |
10 | #include "ui-log.h" | ||
10 | #include "html.h" | 11 | #include "html.h" |
11 | #include "ui-shared.h" | 12 | #include "ui-shared.h" |
12 | #include "vector.h" | 13 | #include "vector.h" |
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "cgit.h" | 9 | #include "cgit.h" |
10 | #include "ui-patch.h" | ||
10 | #include "html.h" | 11 | #include "html.h" |
11 | #include "ui-shared.h" | 12 | #include "ui-shared.h" |
12 | 13 | ||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include <stdio.h> | 9 | #include <stdio.h> |
10 | #include "cgit.h" | 10 | #include "cgit.h" |
11 | #include "ui-plain.h" | ||
11 | #include "html.h" | 12 | #include "html.h" |
12 | #include "ui-shared.h" | 13 | #include "ui-shared.h" |
13 | 14 | ||
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "cgit.h" | 9 | #include "cgit.h" |
10 | #include "ui-refs.h" | ||
10 | #include "html.h" | 11 | #include "html.h" |
11 | #include "ui-shared.h" | 12 | #include "ui-shared.h" |
12 | 13 | ||
diff --git a/ui-repolist.c b/ui-repolist.c index a9751f6..76fe71a 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -8,6 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include "cgit.h" | 10 | #include "cgit.h" |
11 | #include "ui-repolist.h" | ||
11 | #include "html.h" | 12 | #include "html.h" |
12 | #include "ui-shared.h" | 13 | #include "ui-shared.h" |
13 | #include <strings.h> | 14 | #include <strings.h> |
diff --git a/ui-shared.c b/ui-shared.c index 7a726c1..945d560 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "cgit.h" | 9 | #include "cgit.h" |
10 | #include "ui-shared.h" | ||
10 | #include "cmd.h" | 11 | #include "cmd.h" |
11 | #include "html.h" | 12 | #include "html.h" |
12 | 13 | ||
diff --git a/ui-shared.h b/ui-shared.h index 0666388..5f8b629 100644 --- a/ui-shared.h +++ b/ui-shared.h | |||
@@ -47,8 +47,6 @@ extern void cgit_diff_link(const char *name, const char *title, | |||
47 | extern void cgit_stats_link(const char *name, const char *title, | 47 | extern void cgit_stats_link(const char *name, const char *title, |
48 | const char *class, const char *head, | 48 | const char *class, const char *head, |
49 | const char *path); | 49 | const char *path); |
50 | extern void cgit_self_link(char *name, const char *title, | ||
51 | const char *class, struct cgit_context *ctx); | ||
52 | extern void cgit_object_link(struct object *obj); | 50 | extern void cgit_object_link(struct object *obj); |
53 | 51 | ||
54 | extern void cgit_submodule_link(const char *class, char *path, | 52 | extern void cgit_submodule_link(const char *class, char *path, |
diff --git a/ui-snapshot.c b/ui-snapshot.c index e199a92..9be5dbe 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c | |||
@@ -8,6 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include "cgit.h" | 10 | #include "cgit.h" |
11 | #include "ui-snapshot.h" | ||
11 | #include "html.h" | 12 | #include "html.h" |
12 | #include "ui-shared.h" | 13 | #include "ui-shared.h" |
13 | 14 | ||
diff --git a/ui-ssdiff.c b/ui-ssdiff.c index 3d3dad6..cbe60bd 100644 --- a/ui-ssdiff.c +++ b/ui-ssdiff.c | |||
@@ -1,8 +1,8 @@ | |||
1 | #include "cgit.h" | 1 | #include "cgit.h" |
2 | #include "ui-ssdiff.h" | ||
2 | #include "html.h" | 3 | #include "html.h" |
3 | #include "ui-shared.h" | 4 | #include "ui-shared.h" |
4 | #include "ui-diff.h" | 5 | #include "ui-diff.h" |
5 | #include "ui-ssdiff.h" | ||
6 | 6 | ||
7 | extern int use_ssdiff; | 7 | extern int use_ssdiff; |
8 | 8 | ||
@@ -1,7 +1,7 @@ | |||
1 | #include "cgit.h" | 1 | #include "cgit.h" |
2 | #include "ui-stats.h" | ||
2 | #include "html.h" | 3 | #include "html.h" |
3 | #include "ui-shared.h" | 4 | #include "ui-shared.h" |
4 | #include "ui-stats.h" | ||
5 | 5 | ||
6 | #ifdef NO_C99_FORMAT | 6 | #ifdef NO_C99_FORMAT |
7 | #define SZ_FMT "%u" | 7 | #define SZ_FMT "%u" |
diff --git a/ui-summary.c b/ui-summary.c index 0754bb7..bd123ef 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
@@ -8,6 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include "cgit.h" | 10 | #include "cgit.h" |
11 | #include "ui-summary.h" | ||
11 | #include "html.h" | 12 | #include "html.h" |
12 | #include "ui-log.h" | 13 | #include "ui-log.h" |
13 | #include "ui-refs.h" | 14 | #include "ui-refs.h" |
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "cgit.h" | 9 | #include "cgit.h" |
10 | #include "ui-tag.h" | ||
10 | #include "html.h" | 11 | #include "html.h" |
11 | #include "ui-shared.h" | 12 | #include "ui-shared.h" |
12 | 13 | ||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include <ctype.h> | 9 | #include <ctype.h> |
10 | #include "cgit.h" | 10 | #include "cgit.h" |
11 | #include "ui-tree.h" | ||
11 | #include "html.h" | 12 | #include "html.h" |
12 | #include "ui-shared.h" | 13 | #include "ui-shared.h" |
13 | 14 | ||