summaryrefslogtreecommitdiff
path: root/ui-summary.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-10-27 10:06:03 +0200
committerLars Hjemli <hjemli@gmail.com>2007-10-27 10:53:27 +0200
commitf6310fec783d2721ef61815a0eec525d6a904452 (patch)
tree04882b1a89dcbaaaec17ceca8a5210f92dd6f920 /ui-summary.c
parentfe211c7eef6c7d3e39486d6a7484d3b4debff88f (diff)
downloadcgit-f6310fec783d2721ef61815a0eec525d6a904452.tar.gz
cgit-f6310fec783d2721ef61815a0eec525d6a904452.tar.bz2
cgit-f6310fec783d2721ef61815a0eec525d6a904452.zip
Move logic for age comparision from cmp_tag_age into cmp_age()
Simple refactoring to enable later filtering of branches based on age. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-summary.c')
-rw-r--r--ui-summary.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/ui-summary.c b/ui-summary.c
index 3d5eda8..05170cc 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -10,23 +10,28 @@
static int header;
-static int cmp_tag_age(void *a, void *b)
+static int cmp_age(int age1, int age2)
{
- struct refinfo *r1 = *(struct refinfo **)a;
- struct refinfo *r2 = *(struct refinfo **)b;
-
- if (r1->tag->tagger_date != 0 && r2->tag->tagger_date != 0)
- return r2->tag->tagger_date - r1->tag->tagger_date;
+ if (age1 != 0 && age2 != 0)
+ return age2 - age1;
- if (r1->tag->tagger_date == 0 && r2->tag->tagger_date == 0)
+ if (age1 == 0 && age2 == 0)
return 0;
- if (r1 == 0)
+ if (age1 == 0)
return +1;
return -1;
}
+static int cmp_tag_age(const void *a, const void *b)
+{
+ struct refinfo *r1 = *(struct refinfo **)a;
+ struct refinfo *r2 = *(struct refinfo **)b;
+
+ return cmp_age(r1->tag->tagger_date, r2->tag->tagger_date);
+}
+
static void cgit_print_branch(struct refinfo *ref)
{
struct commit *commit;
='insertions'>+3 2008-03-18keep i18n up2dateRené 'Necoro' Neumann3-326/+366 2008-03-18corrected header commentRené 'Necoro' Neumann1-2/+2 2008-03-18Removed gtk subdirRené 'Necoro' Neumann21-134/+79 2008-03-18Removed wrapperRené 'Necoro' Neumann2-238/+184 2008-03-18Split and renamed gui_helperRené 'Necoro' Neumann4-249/+266 2008-03-18Splitted windows.pyRené 'Necoro' Neumann10-424/+549 2008-03-12Moved get_dependencies to top package classRené 'Necoro' Neumann4-50/+85 2008-03-11improved performance by caching the use_expand queriesRené 'Necoro' Neumann1-5/+14 2008-03-11use catapult varsRené 'Necoro' Neumann2-4/+6 2008-03-11Updated catapult stuffRené 'Necoro' Neumann5-56/+108 2008-03-10Generate correct KeyNotFoundExceptionRené 'Necoro' Neumann1-2/+2 2008-03-09Small changesRené 'Necoro' Neumann3-1/+4 2008-03-07Better session handlingRené 'Necoro' Neumann1-5/+54 2008-03-07Small changesRené 'Necoro' Neumann1-1/+4 2008-03-07Updated shm module to 1.2René 'Necoro' Neumann1-8/+21 2008-03-07Update TODORené 'Necoro' Neumann1-3/+1 2008-03-07hmm ... yesRené 'Necoro' Neumann1-1/+1 2008-03-06Used better exceptions for configuration parserRené 'Necoro' Neumann1-26/+114 2008-03-06Update translationRené 'Necoro' Neumann2-349/+393 2008-03-06Update createpot.shRené 'Necoro' Neumann1-3/+2 2008-03-06Use 'nofork' instead of 'nolistener'René 'Necoro' Neumann1-3/+3 2008-03-05Install glade files into template dir and not data dirRené 'Necoro' Neumann2-2/+1 2008-03-05Added dependency listRené 'Necoro' Neumann3-117/+237