List for cgit developers and users
 help / color / mirror / Atom feed
From: john at keeping.me.uk (John Keeping)
Subject: [PATCH 2/4] ui-shared: remove toggle_ssdiff arg to cgit_diff_link()
Date: Sun,  5 Oct 2014 10:59:03 +0100	[thread overview]
Message-ID: <f11ca8a92fcca6c21a4c841951a32b38f6fcb24e.1412502867.git.john@keeping.me.uk> (raw)
In-Reply-To: <cover.1412502867.git.john@keeping.me.uk>

This argument is never used with a value other than zero, so remove it
and simplify the code.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 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(")</td></tr>");
 		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("</td><td class='%s'>", 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("<div class='diffstat-header'>");
 	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 = "&amp;";
 	}
-	if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) {
+	if (ctx.qry.ssdiff) {
 		html(delim);
 		html("ss=1");
 		delim = "&amp;";
@@ -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);
-- 
2.1.0.374.g390713e



  parent reply	other threads:[~2014-10-05  9:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-05  9:59 [PATCH 0/4] Add "stat only" diff mode john
2014-10-05  9:59 ` [PATCH 1/4] ui-shared: remove toggle_ssdiff arg to cgit_commit_link() john
2014-12-24  1:48   ` Jason
2014-10-05  9:59 ` john [this message]
2014-12-24  1:49   ` [PATCH 2/4] ui-shared: remove toggle_ssdiff arg to cgit_diff_link() Jason
2014-10-05  9:59 ` [PATCH 3/4] Change "ss" diff flag to an enum john
2014-12-24  1:49   ` Jason
2014-10-05  9:59 ` [PATCH 4/4] ui-diff: add "stat only" diff type john
2014-12-24  1:49   ` Jason
2014-10-06  3:01 ` [PATCH 0/4] Add "stat only" diff mode Jason
2014-10-06  6:10   ` cgit
2014-10-06 13:25     ` mricon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f11ca8a92fcca6c21a4c841951a32b38f6fcb24e.1412502867.git.john@keeping.me.uk \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).