summaryrefslogtreecommitdiffabout
authorJohan Herland <johan@herland.net>2010-11-15 17:39:48 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2010-11-16 05:56:54 (UTC)
commit17596459fe9a43428a261e66f65b227d15bf7ee5 (patch) (unidiff)
treeea30f9af3e534a2d2400ece912939475f84211da
parent7618cac1ee3bf83424d9237c3c362a43c5b246e9 (diff)
downloadcgit-17596459fe9a43428a261e66f65b227d15bf7ee5.zip
cgit-17596459fe9a43428a261e66f65b227d15bf7ee5.tar.gz
cgit-17596459fe9a43428a261e66f65b227d15bf7ee5.tar.bz2
ui-stats: Remove unnecessary #include
<string-list.h> is already #included from cgit.h Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (more/less context) (show 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,50 +1,48 @@
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;
35 gmtime_r(&t, tm); 33 gmtime_r(&t, tm);
36} 34}
37 35
38static void inc_week(struct tm *tm) 36static void inc_week(struct tm *tm)
39{ 37{
40 time_t t = timegm(tm); 38 time_t t = timegm(tm);
41 t += WEEK_SECS; 39 t += WEEK_SECS;
42 gmtime_r(&t, tm); 40 gmtime_r(&t, tm);
43} 41}
44 42
45static char *pretty_week(struct tm *tm) 43static char *pretty_week(struct tm *tm)
46{ 44{
47 static char buf[10]; 45 static char buf[10];
48 46
49 strftime(buf, sizeof(buf), "W%V %G", tm); 47 strftime(buf, sizeof(buf), "W%V %G", tm);
50 return buf; 48 return buf;