cgit

commit 57ea1aa2a5eab7f6aba702b3366fe4dcc72124f6

Author: John Keeping <john@keeping.me.uk>

ui-shared: remove "format" from cgit_print_age()

We never use any format other than FMT_SHORTDATE, so move that into the
function.

Signed-off-by: John Keeping <john@keeping.me.uk>

 ui-log.c | 4 ++--
 ui-refs.c | 6 +++---
 ui-repolist.c | 2 +-
 ui-shared.c | 4 ++--
 ui-shared.h | 2 +-


diff --git a/ui-log.c b/ui-log.c
index a4dc7070c37b832f029bebf390c533672bd778ac..5f6a69ced50a34e1734179bbb89fcddb08890075 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -204,7 +204,7 @@ 		strbuf_setlen(&graphbuf, 0);
 	}
 	else {
 		html("<td>");
-		cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
+		cgit_print_age(commit->date, TM_WEEK * 2);
 		html("</td>");
 	}
 
@@ -244,7 +244,7 @@ 	cgit_close_filter(ctx.repo->email_filter);
 
 	if (revs->graph) {
 		html("</td><td>");
-		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 295a4c7b00923c1c2d31594ff8f737bad82ba4b6..0652b89edf0783a6a56241b86e38cf4016e727eb 100644
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -73,7 +73,7 @@ 		cgit_open_filter(ctx.repo->email_filter, info->author_email, "refs");
 		html_txt(info->author);
 		cgit_close_filter(ctx.repo->email_filter);
 		html("</td><td colspan='2'>");
-		cgit_print_age(info->commit->date, -1, NULL);
+		cgit_print_age(info->commit->date, -1);
 	} else {
 		html("</td><td></td><td>");
 		cgit_object_link(ref->object);
@@ -161,9 +161,9 @@ 	}
 	html("</td><td colspan='2'>");
 	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("</td></tr>\n");
 




diff --git a/ui-repolist.c b/ui-repolist.c
index 6010a39329b00b7f277ec293eeaa897c8b283297..60044699d176608913fc65b4622d5182414f4f43 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 54bbde757951df30824484969276578f8c0a8650..76aac60fd6defb6562782f3dd07b2448870d775a 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -635,7 +635,7 @@ 	html_attr(fmt_date(t, FMT_LONGDATE, ctx.cfg.local_time));
 	htmlf("'>%.0f %s</span>", 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 @@ 	if (secs > max_relative && max_relative >= 0) {
 		html("<span title='");
 		html_attr(fmt_date(t, FMT_LONGDATE, ctx.cfg.local_time));
 		html("'>");
-		cgit_print_date(t, format, ctx.cfg.local_time);
+		cgit_print_date(t, FMT_SHORTDATE, ctx.cfg.local_time);
 		html("</span>");
 		return;
 	}




diff --git a/ui-shared.h b/ui-shared.h
index de08e1b383932d19919fe0d75418327016d6f4c4..c9413ede7f769a3d0e3cc858acc2e12168de25d0 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);