From 03f537f1a134c8578ae4c16055596539fbbcc220 Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sun, 5 Oct 2014 10:59:03 +0100 Subject: ui-shared: remove toggle_ssdiff arg to cgit_diff_link() This argument is never used with a value other than zero, so remove it and simplify the code. Signed-off-by: John Keeping --- ui-commit.c | 2 +- ui-diff.c | 4 ++-- ui-shared.c | 8 ++++---- ui-shared.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui-commit.c b/ui-commit.c index ec99264..d5a888d 100644 --- a/ui-commit.c +++ b/ui-commit.c @@ -99,7 +99,7 @@ void cgit_print_commit(char *hex, const char *prefix) cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix); html(" ("); cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, - sha1_to_hex(p->item->object.sha1), prefix, 0); + sha1_to_hex(p->item->object.sha1), prefix); html(")"); parents++; } diff --git a/ui-diff.c b/ui-diff.c index 71273aa..49bd748 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -97,7 +97,7 @@ static void print_fileinfo(struct fileinfo *info) } htmlf("", class); cgit_diff_link(info->new_path, NULL, NULL, ctx.qry.head, ctx.qry.sha1, - ctx.qry.sha2, info->new_path, 0); + ctx.qry.sha2, info->new_path); if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED) { htmlf(" (%s from ", info->status == DIFF_STATUS_COPIED ? "copied" : "renamed"); @@ -175,7 +175,7 @@ static void cgit_print_diffstat(const unsigned char *old_sha1, html("
"); cgit_diff_link("Diffstat", NULL, NULL, ctx.qry.head, ctx.qry.sha1, - ctx.qry.sha2, NULL, 0); + ctx.qry.sha2, NULL); if (prefix) { html(" (limited to '"); html_txt(prefix); diff --git a/ui-shared.c b/ui-shared.c index 497dfd0..68e0d7c 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -385,7 +385,7 @@ void cgit_snapshot_link(const char *name, const char *title, const char *class, void cgit_diff_link(const char *name, const char *title, const char *class, const char *head, const char *new_rev, const char *old_rev, - const char *path, int toggle_ssdiff) + const char *path) { char *delim; @@ -402,7 +402,7 @@ void cgit_diff_link(const char *name, const char *title, const char *class, html_url_arg(old_rev); delim = "&"; } - if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) { + if (ctx.qry.ssdiff) { html(delim); html("ss=1"); delim = "&"; @@ -478,7 +478,7 @@ static void cgit_self_link(char *name, const char *title, const char *class) else if (!strcmp(ctx.qry.page, "diff")) cgit_diff_link(name, title, class, ctx.qry.head, ctx.qry.sha1, ctx.qry.sha2, - ctx.qry.path, 0); + ctx.qry.path); else if (!strcmp(ctx.qry.page, "stats")) cgit_stats_link(name, title, class, ctx.qry.head, ctx.qry.path); @@ -876,7 +876,7 @@ void cgit_print_pageheader(void) cgit_commit_link("commit", NULL, hc("commit"), ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath); cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head, - ctx.qry.sha1, ctx.qry.sha2, ctx.qry.vpath, 0); + ctx.qry.sha1, ctx.qry.sha2, ctx.qry.vpath); if (ctx.repo->max_stats) cgit_stats_link("stats", NULL, hc("stats"), ctx.qry.head, ctx.qry.vpath); diff --git a/ui-shared.h b/ui-shared.h index bb193ec..fc9be3b 100644 --- a/ui-shared.h +++ b/ui-shared.h @@ -43,7 +43,7 @@ extern void cgit_snapshot_link(const char *name, const char *title, extern void cgit_diff_link(const char *name, const char *title, const char *class, const char *head, const char *new_rev, const char *old_rev, - const char *path, int toggle_ssdiff); + const char *path); extern void cgit_stats_link(const char *name, const char *title, const char *class, const char *head, const char *path); -- cgit 1.4.1 ollow=1'>Add GPL header templateJune McEnroe 2019-11-01Add uber messageJune McEnroe 2019-11-01Use initial in git authorJune McEnroe 2019-11-01Add Hobo Johnson and The Lovemakers Tiny DeskJune McEnroe 2019-10-30Use braces in causal.agency MakefileJune McEnroe 2019-10-30Add scheme "screenshot" to causal.agencyJune McEnroe 2019-10-30Add pounce to causal.agencyJune McEnroe 2019-10-28Mark ' for \aJune McEnroe 2019-10-23Add The Book of the Unnamed MidwifeJune McEnroe 2019-10-22Add ConcreteJune McEnroe 2019-10-14Set the write variable for nvim man modeJune McEnroe 2019-10-13Add All Systems RedJune McEnroe 2019-10-10Add The Book of PhoenixJune McEnroe 2019-10-03Add two Kim Petras songsJune McEnroe 2019-10-02Update neovim 0.4.2June McEnroe 2019-10-02Claim to be curl(1) in titleJune McEnroe 2019-10-02Add The Red Threads of FortuneJune McEnroe 2019-09-28Add The Black Tides of HeavenJune McEnroe 2019-09-27Fail on HTTP failure status in titleJune McEnroe 2019-09-23Add Trail of LightningJune McEnroe 2019-09-22Revert "Enable cookies in title"June McEnroe 2019-09-20Enable cookies in titleJune McEnroe 2019-09-16Use sensitivity aliases in TF2June McEnroe 2019-09-16Add The Just CityJune McEnroe 2019-09-12Only GET the final redirect locationJune McEnroe 2019-09-12Consume entire bodyJune McEnroe 2019-09-10Add title -v flagJune McEnroe 2019-09-10Use curl error bufferJune McEnroe 2019-09-10Set Accept-Encoding in titleJune McEnroe 2019-09-08Set title User-AgentJune McEnroe 2019-09-07Add -x flag to titleJune McEnroe 2019-09-07Ignore SIGPIPE in relayJune McEnroe 2019-09-07Add A Memory Called EmpireJune McEnroe 2019-09-05Handle lack of Content-TypeJune McEnroe 2019-09-05Use CURLINFO_CONTENT_TYPEJune McEnroe 2019-09-05Decode entities in titlesJune McEnroe 2019-09-05Print title as soon as it's availableJune McEnroe 2019-09-05Use CURL_PREFIX to set flagsJune McEnroe 2019-09-05Add titleJune McEnroe 2019-09-04Add Avorter n'est pas tuerJune McEnroe 2019-08-29Unset executable on shell scriptsJune McEnroe 2019-08-29Add long-missing setopt to bin.7June McEnroe 2019-08-29Add editJune McEnroe