]> git.cameronkatri.com Git - cgit.git/commitdiff
ui-shared: remove toggle_ssdiff arg to cgit_diff_link()
authorJohn Keeping <john@keeping.me.uk>
Sun, 5 Oct 2014 09:59:03 +0000 (10:59 +0100)
committerLukas Fleischer <cgit@cryptocrack.de>
Sat, 13 Dec 2014 11:38:42 +0000 (12:38 +0100)
This argument is never used with a value other than zero, so remove it
and simplify the code.

Signed-off-by: John Keeping <john@keeping.me.uk>
ui-commit.c
ui-diff.c
ui-shared.c
ui-shared.h

index ec9926480f5539334d7233c1c8b5be0ecfffbf36..d5a888dc92fc117947ef9ce42b34fc9ece433d41 100644 (file)
@@ -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++;
        }
index 71273aa4a92399473ca184ca87dba3f85b522c69..49bd7480c573df06c41abb9d305d1ae8ac3e459c 100644 (file)
--- 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);
index 497dfd011b19e91d628092b42fbb992522cc3a8d..68e0d7cdf40c2573a532af1e80a109106b90b485 100644 (file)
@@ -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);
index bb193ec6349b7deaf5b3e3d2744b7dadee72c6c0..fc9be3bc6d2dde9198209d2edeccf6b2d312320a 100644 (file)
@@ -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);