mark many functions and structs static in got.c and tog.c
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
diff --git a/got/got.c b/got/got.c
index a413459..4849992 100644
--- a/got/got.c
+++ b/got/got.c
@@ -45,17 +45,19 @@ struct cmd {
const char *cmd_descr;
};
-__dead void usage(void);
-__dead void usage_checkout(void);
-__dead void usage_log(void);
-__dead void usage_diff(void);
-
-const struct got_error* cmd_checkout(int, char *[]);
-const struct got_error* cmd_log(int, char *[]);
-const struct got_error* cmd_diff(int, char *[]);
-const struct got_error* cmd_status(int, char *[]);
+__dead static void usage(void);
+__dead static void usage_checkout(void);
+__dead static void usage_log(void);
+__dead static void usage_diff(void);
+
+static const struct got_error* cmd_checkout(int, char *[]);
+static const struct got_error* cmd_log(int, char *[]);
+static const struct got_error* cmd_diff(int, char *[]);
+#ifdef notyet
+static const struct got_error* cmd_status(int, char *[]);
+#endif
-struct cmd got_commands[] = {
+static struct cmd got_commands[] = {
{ "checkout", cmd_checkout, usage_checkout,
"check out a new work tree from a repository" },
{ "log", cmd_log, usage_log,
@@ -120,7 +122,7 @@ main(int argc, char *argv[])
return 1;
}
-__dead void
+__dead static void
usage(void)
{
int i;
@@ -134,7 +136,7 @@ usage(void)
exit(1);
}
-__dead void
+__dead static void
usage_checkout(void)
{
fprintf(stderr, "usage: %s checkout [-p prefix] repository-path "
@@ -153,7 +155,7 @@ checkout_progress(void *arg, const char *path)
printf("A %s/%s\n", worktree_path, path);
}
-const struct got_error *
+static const struct got_error *
cmd_checkout(int argc, char *argv[])
{
const struct got_error *error = NULL;
@@ -427,7 +429,7 @@ print_commits(struct got_object *root_obj, struct got_object_id *root_id,
return err;
}
-__dead void
+__dead static void
usage_log(void)
{
fprintf(stderr, "usage: %s log [-p] [-c commit] [ -l N ] "
@@ -435,7 +437,7 @@ usage_log(void)
exit(1);
}
-const struct got_error *
+static const struct got_error *
cmd_log(int argc, char *argv[])
{
const struct got_error *error;
@@ -521,7 +523,7 @@ cmd_log(int argc, char *argv[])
return error;
}
-__dead void
+__dead static void
usage_diff(void)
{
fprintf(stderr, "usage: %s diff [repository-path] object1 object2\n",
@@ -529,7 +531,7 @@ usage_diff(void)
exit(1);
}
-const struct got_error *
+static const struct got_error *
cmd_diff(int argc, char *argv[])
{
const struct got_error *error;
@@ -630,7 +632,7 @@ done:
}
#ifdef notyet
-const struct got_error *
+static const struct got_error *
cmd_status(int argc __unused, char *argv[] __unused)
{
git_repository *repo = NULL;
diff --git a/tog/tog.c b/tog/tog.c
index 35144a6..963fa3b 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -51,16 +51,16 @@ struct tog_cmd {
const char *descr;
};
-__dead void usage(void);
-__dead void usage_log(void);
-__dead void usage_diff(void);
-__dead void usage_blame(void);
+__dead static void usage(void);
+__dead static void usage_log(void);
+__dead static void usage_diff(void);
+__dead static void usage_blame(void);
-const struct got_error* cmd_log(int, char *[]);
-const struct got_error* cmd_diff(int, char *[]);
-const struct got_error* cmd_blame(int, char *[]);
+static const struct got_error* cmd_log(int, char *[]);
+static const struct got_error* cmd_diff(int, char *[]);
+static const struct got_error* cmd_blame(int, char *[]);
-struct tog_cmd tog_commands[] = {
+static struct tog_cmd tog_commands[] = {
{ "log", cmd_log, usage_log,
"show repository history" },
{ "diff", cmd_diff, usage_diff,
@@ -74,7 +74,7 @@ static struct tog_view {
PANEL *panel;
} tog_log_view, tog_diff_view;
-__dead void
+__dead static void
usage_log(void)
{
endwin();
@@ -657,7 +657,7 @@ done:
return err;
}
-const struct got_error *
+static const struct got_error *
cmd_log(int argc, char *argv[])
{
const struct got_error *error;
@@ -723,7 +723,7 @@ cmd_log(int argc, char *argv[])
return error;
}
-__dead void
+__dead static void
usage_diff(void)
{
endwin();
@@ -732,7 +732,7 @@ usage_diff(void)
exit(1);
}
-const struct got_error *
+static const struct got_error *
draw_diff(FILE *f, int *first_displayed_line, int *last_displayed_line,
int *eof, int max_lines)
{
@@ -774,7 +774,7 @@ draw_diff(FILE *f, int *first_displayed_line, int *last_displayed_line,
return NULL;
}
-const struct got_error *
+static const struct got_error *
show_diff_view(struct got_object *obj1, struct got_object *obj2,
struct got_repository *repo)
{
@@ -849,7 +849,7 @@ show_diff_view(struct got_object *obj1, struct got_object *obj2,
return err;
}
-const struct got_error *
+static const struct got_error *
cmd_diff(int argc, char *argv[])
{
const struct got_error *error = NULL;
@@ -915,7 +915,7 @@ done:
return error;
}
-__dead void
+__dead static void
usage_blame(void)
{
endwin();
@@ -924,7 +924,7 @@ usage_blame(void)
exit(1);
}
-const struct got_error *
+static const struct got_error *
cmd_blame(int argc, char *argv[])
{
return got_error(GOT_ERR_NOT_IMPL);
@@ -942,7 +942,7 @@ init_curses(void)
curs_set(0);
}
-__dead void
+__dead static void
usage(void)
{
int i;