Spotted by parsing the output of `gcc -Wmissing-prototypes [...]`.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
/* Return a strftime formatted date/time
* NB: the result from this function is to shared memory
*/
-char *sprintftime(const char *format, time_t time)
+static char *sprintftime(const char *format, time_t time)
{
static char buf[64];
struct tm *tm;
const char *cgit_version = CGIT_VERSION;
-void add_mimetype(const char *name, const char *value)
+static void add_mimetype(const char *name, const char *value)
{
struct string_list_item *item;
item->util = xstrdup(value);
}
-struct cgit_filter *new_filter(const char *cmd, filter_type filtertype)
+static struct cgit_filter *new_filter(const char *cmd, filter_type filtertype)
{
struct cgit_filter *f;
int args_size = 0;
static void process_cached_repolist(const char *path);
-void repo_config(struct cgit_repo *repo, const char *name, const char *value)
+static void repo_config(struct cgit_repo *repo, const char *name, const char *value)
{
struct string_list_item *item;
}
}
-void config_cb(const char *name, const char *value)
+static void config_cb(const char *name, const char *value)
{
if (!strcmp(name, "section") || !strcmp(name, "repo.group"))
ctx.cfg.section = xstrdup(value);
}
}
-char *xstrdupn(const char *str)
+static char *xstrdupn(const char *str)
{
return (str ? xstrdup(str) : NULL);
}
int match;
};
-int find_current_ref(const char *refname, const unsigned char *sha1,
- int flags, void *cb_data)
+static int find_current_ref(const char *refname, const unsigned char *sha1,
+ int flags, void *cb_data)
{
struct refmatch *info;
return info->match;
}
-char *find_default_branch(struct cgit_repo *repo)
+static char *find_default_branch(struct cgit_repo *repo)
{
struct refmatch info;
char *ref;
cgit_print_docend();
}
-int cmp_repos(const void *a, const void *b)
+static int cmp_repos(const void *a, const void *b)
{
const struct cgit_repo *ra = a, *rb = b;
return strcmp(ra->url, rb->url);
}
-char *build_snapshot_setting(int bitmap)
+static char *build_snapshot_setting(int bitmap)
{
const struct cgit_snapshot_format *f;
char *result = xstrdup("");
return result;
}
-char *get_first_line(char *txt)
+static char *get_first_line(char *txt)
{
char *t = xstrdup(txt);
char *p = strchr(t, '\n');
return t;
}
-void print_repo(FILE *f, struct cgit_repo *repo)
+static void print_repo(FILE *f, struct cgit_repo *repo)
{
fprintf(f, "repo.url=%s\n", repo->url);
fprintf(f, "repo.name=%s\n", repo->name);
fprintf(f, "\n");
}
-void print_repolist(FILE *f, struct cgit_repolist *list, int start)
+static void print_repolist(FILE *f, struct cgit_repolist *list, int start)
{
int i;
#include <stdio.h>
#include "configfile.h"
-int next_char(FILE *f)
+static int next_char(FILE *f)
{
int c = fgetc(f);
if (c == '\r') {
return c;
}
-void skip_line(FILE *f)
+static void skip_line(FILE *f)
{
int c;
;
}
-int read_config_line(FILE *f, char *line, const char **value, int bufsize)
+static int read_config_line(FILE *f, char *line, const char **value, int bufsize)
{
int i = 0, isname = 0;
"%fe", "%ff"
};
-int htmlfd = STDOUT_FILENO;
+static int htmlfd = STDOUT_FILENO;
char *fmt(const char *format, ...)
{
return 0;
}
-int hextoint(char c)
+static int hextoint(char c)
{
if (c >= 'a' && c <= 'f')
return 10 + c - 'a';
return -1;
}
-char *convert_query_hexchar(char *txt)
+static char *convert_query_hexchar(char *txt)
{
int d1, d2, n;
n = strlen(txt);
}
}
-char *substr(const char *head, const char *tail)
+static char *substr(const char *head, const char *tail)
{
char *buf;
return buf;
}
-char *parse_user(char *t, char **name, char **email, unsigned long *date)
+static char *parse_user(char *t, char **name, char **email, unsigned long *date)
{
char *p = t;
int mode = 1;
#ifdef NO_ICONV
#define reencode(a, b, c)
#else
-const char *reencode(char **txt, const char *src_enc, const char *dst_enc)
+static const char *reencode(char **txt, const char *src_enc, const char *dst_enc)
{
char *tmp;
list->refs[list->count++] = ref;
}
-struct refinfo *cgit_mk_refinfo(const char *refname, const unsigned char *sha1)
+static struct refinfo *cgit_mk_refinfo(const char *refname, const unsigned char *sha1)
{
struct refinfo *ref;
return 0;
}
-void cgit_diff_tree_cb(struct diff_queue_struct *q,
- struct diff_options *options, void *data)
+static void cgit_diff_tree_cb(struct diff_queue_struct *q,
+ struct diff_options *options, void *data)
{
int i;
char *diffbuf = NULL;
int buflen = 0;
-int filediff_cb(void *priv, mmbuffer_t *mb, int nbuf)
+static int filediff_cb(void *priv, mmbuffer_t *mb, int nbuf)
{
int i;
return (*size == st.st_size ? 0 : e);
}
-int is_token_char(char c)
+static int is_token_char(char c)
{
return isalnum(c) || c == '_';
}
/* Replace name with getenv(name), return pointer to zero-terminating char
*/
-char *expand_macro(char *name, int maxlength)
+static char *expand_macro(char *name, int maxlength)
{
char *value;
int len;
#include "html.h"
#include "ui-shared.h"
-void add_entry(struct commit *commit, char *host)
+static void add_entry(struct commit *commit, char *host)
{
char delim = '&';
char *hex;
total_rems += lines_removed;
}
-void cgit_print_diffstat(const unsigned char *old_sha1,
- const unsigned char *new_sha1, const char *prefix)
+static void cgit_print_diffstat(const unsigned char *old_sha1,
+ const unsigned char *new_sha1,
+ const char *prefix)
{
int i;
#define COLUMN_COLORS_HTML_MAX (ARRAY_SIZE(column_colors_html) - 1)
-void count_lines(char *line, int size)
+static void count_lines(char *line, int size)
{
if (size <= 0)
return;
rem_lines++;
}
-void inspect_files(struct diff_filepair *pair)
+static void inspect_files(struct diff_filepair *pair)
{
unsigned long old_size = 0;
unsigned long new_size = 0;
}
}
-void print_commit(struct commit *commit, struct rev_info *revs)
+static void print_commit(struct commit *commit, struct rev_info *revs)
{
struct commitinfo *info;
int cols = revs->graph ? 3 : 2;
#include "ui-shared.h"
#include <strings.h>
-time_t read_agefile(char *path)
+static time_t read_agefile(char *path)
{
time_t result;
size_t size;
cgit_print_age(t, -1, NULL);
}
-int is_match(struct cgit_repo *repo)
+static int is_match(struct cgit_repo *repo)
{
if (!ctx.qry.search)
return 1;
return 0;
}
-int is_in_url(struct cgit_repo *repo)
+static int is_in_url(struct cgit_repo *repo)
{
if (!ctx.qry.url)
return 1;
return 0;
}
-void print_sort_header(const char *title, const char *sort)
+static void print_sort_header(const char *title, const char *sort)
{
htmlf("<th class='left'><a href='%s?s=%s", cgit_rooturl(), sort);
if (ctx.qry.search) {
htmlf("'>%s</a></th>", title);
}
-void print_header()
+static void print_header()
{
html("<tr class='nohover'>");
print_sort_header("Name", "name");
}
-void print_pager(int items, int pagelen, char *search, char *sort)
+static void print_pager(int items, int pagelen, char *search, char *sort)
{
int i, ofs;
char *class = NULL;
{NULL, NULL}
};
-int sort_repolist(char *field)
+static int sort_repolist(char *field)
{
struct sortcolumn *column;
return rvbuf;
}
-char *cgit_currurl()
+static char *cgit_currurl()
{
if (!ctx.cfg.virtual_root)
return ctx.cfg.script_name;
reporevlink("stats", name, title, class, head, NULL, path);
}
-void cgit_self_link(char *name, const char *title, const char *class,
- struct cgit_context *ctx)
+static void cgit_self_link(char *name, const char *title, const char *class,
+ struct cgit_context *ctx)
{
if (!strcmp(ctx->qry.page, "repolist"))
return cgit_index_link(name, title, class, ctx->qry.search, ctx->qry.sort,
reporevlink(page, name, NULL, NULL, ctx.qry.head, fullrev, NULL);
}
-struct string_list_item *lookup_path(struct string_list *list,
- const char *path)
+static struct string_list_item *lookup_path(struct string_list *list,
+ const char *path)
{
struct string_list_item *item;
html("</body>\n</html>\n");
}
-int print_branch_option(const char *refname, const unsigned char *sha1,
- int flags, void *cb_data)
+static int print_branch_option(const char *refname, const unsigned char *sha1,
+ int flags, void *cb_data)
{
char *name = (char *)refname;
html_option(name, name, ctx.qry.head);
return 0;
}
-int print_archive_ref(const char *refname, const unsigned char *sha1,
- int flags, void *cb_data)
+static int print_archive_ref(const char *refname, const unsigned char *sha1,
+ int flags, void *cb_data)
{
struct tag *tag;
struct taginfo *info;
return NULL;
}
-void show_error(char *msg)
+static void show_error(char *msg)
{
ctx.page.mimetype = "text/html";
cgit_print_http_headers(&ctx);
/* Walk the commit DAG and collect number of commits per author per
* timeperiod into a nested string_list collection.
*/
-struct string_list collect_stats(struct cgit_context *ctx,
- struct cgit_period *period)
+static struct string_list collect_stats(struct cgit_context *ctx,
+ struct cgit_period *period)
{
struct string_list authors;
struct rev_info rev;
return authors;
}
-void print_combined_authorrow(struct string_list *authors, int from, int to,
- const char *name, const char *leftclass, const char *centerclass,
- const char *rightclass, struct cgit_period *period)
+static void print_combined_authorrow(struct string_list *authors, int from,
+ int to, const char *name,
+ const char *leftclass,
+ const char *centerclass,
+ const char *rightclass,
+ struct cgit_period *period)
{
struct string_list_item *author;
struct authorstat *authorstat;
htmlf("<td class='%s'>%ld</td></tr>", rightclass, total);
}
-void print_authors(struct string_list *authors, int top,
- struct cgit_period *period)
+static void print_authors(struct string_list *authors, int top,
+ struct cgit_period *period)
{
struct string_list_item *author;
struct authorstat *authorstat;
}
}
-void print_download_links(char *revname)
+static void print_download_links(char *revname)
{
html("<tr><th>download</th><td class='sha1'>");
cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head,