From mboxrd@z Thu Jan 1 00:00:00 1970 From: john at keeping.me.uk (John Keeping) Date: Tue, 19 Jan 2016 19:33:01 +0000 Subject: [PATCH 1/8] ui-shared: remove "format" from cgit_print_age() In-Reply-To: References: Message-ID: <351b95e5e566e29d14f74db2a7776cf4ba359114.1453231719.git.john@keeping.me.uk> We never use any format other than FMT_SHORTDATE, so move that into the function. Signed-off-by: John Keeping --- ui-log.c | 4 ++-- ui-refs.c | 6 +++--- ui-repolist.c | 2 +- ui-shared.c | 4 ++-- ui-shared.h | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ui-log.c b/ui-log.c index 4573255..bc625db 100644 --- a/ui-log.c +++ b/ui-log.c @@ -202,7 +202,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs) } else { html(""); - cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); + cgit_print_age(commit->date, TM_WEEK * 2); html(""); } @@ -242,7 +242,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs) if (revs->graph) { html(""); - cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); + cgit_print_age(commit->date, TM_WEEK * 2); } if (!lines_counted && (ctx.repo->enable_log_filecount || diff --git a/ui-refs.c b/ui-refs.c index 295a4c7..0652b89 100644 --- a/ui-refs.c +++ b/ui-refs.c @@ -73,7 +73,7 @@ static int print_branch(struct refinfo *ref) html_txt(info->author); cgit_close_filter(ctx.repo->email_filter); html(""); - cgit_print_age(info->commit->date, -1, NULL); + cgit_print_age(info->commit->date, -1); } else { html(""); cgit_object_link(ref->object); @@ -161,9 +161,9 @@ static int print_tag(struct refinfo *ref) html(""); if (info) { if (info->tagger_date > 0) - cgit_print_age(info->tagger_date, -1, NULL); + cgit_print_age(info->tagger_date, -1); } else if (ref->object->type == OBJ_COMMIT) { - cgit_print_age(ref->commit->commit->date, -1, NULL); + cgit_print_age(ref->commit->commit->date, -1); } html("\n"); diff --git a/ui-repolist.c b/ui-repolist.c index 6010a39..6004469 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -79,7 +79,7 @@ static void print_modtime(struct cgit_repo *repo) { time_t t; if (get_repo_modtime(repo, &t)) - cgit_print_age(t, -1, NULL); + cgit_print_age(t, -1); } static int is_match(struct cgit_repo *repo) diff --git a/ui-shared.c b/ui-shared.c index 5b48734..34d3367 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -635,7 +635,7 @@ static void print_rel_date(time_t t, double value, htmlf("'>%.0f %s", value, suffix); } -void cgit_print_age(time_t t, time_t max_relative, const char *format) +void cgit_print_age(time_t t, time_t max_relative) { time_t now, secs; @@ -650,7 +650,7 @@ void cgit_print_age(time_t t, time_t max_relative, const char *format) html(""); - cgit_print_date(t, format, ctx.cfg.local_time); + cgit_print_date(t, FMT_SHORTDATE, ctx.cfg.local_time); html(""); return; } diff --git a/ui-shared.h b/ui-shared.h index 474e0c5..4d655d9 100644 --- a/ui-shared.h +++ b/ui-shared.h @@ -62,7 +62,7 @@ extern void cgit_print_error(const char *fmt, ...); __attribute__((format (printf,1,0))) extern void cgit_vprint_error(const char *fmt, va_list ap); extern void cgit_print_date(time_t secs, const char *format, int local_time); -extern void cgit_print_age(time_t t, time_t max_relative, const char *format); +extern void cgit_print_age(time_t t, time_t max_relative); extern void cgit_print_http_headers(void); extern void cgit_redirect(const char *url, bool permanent); extern void cgit_print_docstart(void); -- 2.7.0.226.gfe986fe