summaryrefslogtreecommitdiffabout
path: root/ui-stats.c
Unidiff
Diffstat (limited to 'ui-stats.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-stats.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/ui-stats.c b/ui-stats.c
index 946a6ea..2a0c174 100644
--- a/ui-stats.c
+++ b/ui-stats.c
@@ -1,34 +1,32 @@
1#include <string-list.h>
2
3#include "cgit.h" 1#include "cgit.h"
4#include "html.h" 2#include "html.h"
5#include "ui-shared.h" 3#include "ui-shared.h"
6#include "ui-stats.h" 4#include "ui-stats.h"
7 5
8#ifdef NO_C99_FORMAT 6#ifdef NO_C99_FORMAT
9#define SZ_FMT "%u" 7#define SZ_FMT "%u"
10#else 8#else
11#define SZ_FMT "%zu" 9#define SZ_FMT "%zu"
12#endif 10#endif
13 11
14#define MONTHS 6 12#define MONTHS 6
15 13
16struct authorstat { 14struct authorstat {
17 long total; 15 long total;
18 struct string_list list; 16 struct string_list list;
19}; 17};
20 18
21#define DAY_SECS (60 * 60 * 24) 19#define DAY_SECS (60 * 60 * 24)
22#define WEEK_SECS (DAY_SECS * 7) 20#define WEEK_SECS (DAY_SECS * 7)
23 21
24static void trunc_week(struct tm *tm) 22static void trunc_week(struct tm *tm)
25{ 23{
26 time_t t = timegm(tm); 24 time_t t = timegm(tm);
27 t -= ((tm->tm_wday + 6) % 7) * DAY_SECS; 25 t -= ((tm->tm_wday + 6) % 7) * DAY_SECS;
28 gmtime_r(&t, tm); 26 gmtime_r(&t, tm);
29} 27}
30 28
31static void dec_week(struct tm *tm) 29static void dec_week(struct tm *tm)
32{ 30{
33 time_t t = timegm(tm); 31 time_t t = timegm(tm);
34 t -= WEEK_SECS; 32 t -= WEEK_SECS;