]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-stats.c
authors: specify maintainers
[ps-cgit] / ui-stats.c
index f74dc3337bb1cc47df376561dc97848bf93c7f7b..84b247c9a9c94a518483d5f0a66bdf114d8f7e85 100644 (file)
@@ -1,7 +1,7 @@
 #include "cgit.h"
 #include "cgit.h"
+#include "ui-stats.h"
 #include "html.h"
 #include "ui-shared.h"
 #include "html.h"
 #include "ui-shared.h"
-#include "ui-stats.h"
 
 #ifdef NO_C99_FORMAT
 #define SZ_FMT "%u"
 
 #ifdef NO_C99_FORMAT
 #define SZ_FMT "%u"
@@ -9,8 +9,6 @@
 #define SZ_FMT "%zu"
 #endif
 
 #define SZ_FMT "%zu"
 #endif
 
-#define MONTHS 6
-
 struct authorstat {
        long total;
        struct string_list list;
 struct authorstat {
        long total;
        struct string_list list;
@@ -83,7 +81,7 @@ static char *pretty_month(struct tm *tm)
 static void trunc_quarter(struct tm *tm)
 {
        trunc_month(tm);
 static void trunc_quarter(struct tm *tm)
 {
        trunc_month(tm);
-       while(tm->tm_mon % 3 != 0)
+       while (tm->tm_mon % 3 != 0)
                dec_month(tm);
 }
 
                dec_month(tm);
 }
 
@@ -211,8 +209,8 @@ static int cmp_total_commits(const void *a1, const void *a2)
 /* Walk the commit DAG and collect number of commits per author per
  * timeperiod into a nested string_list collection.
  */
 /* Walk the commit DAG and collect number of commits per author per
  * timeperiod into a nested string_list collection.
  */
-struct string_list collect_stats(struct cgit_context *ctx,
-       struct cgit_period *period)
+static struct string_list collect_stats(struct cgit_context *ctx,
+                                       struct cgit_period *period)
 {
        struct string_list authors;
        struct rev_info rev;
 {
        struct string_list authors;
        struct rev_info rev;
@@ -253,9 +251,12 @@ struct string_list collect_stats(struct cgit_context *ctx,
        return authors;
 }
 
        return authors;
 }
 
-void print_combined_authorrow(struct string_list *authors, int from, int to,
-       const char *name, const char *leftclass, const char *centerclass,
-       const char *rightclass, struct cgit_period *period)
+static void print_combined_authorrow(struct string_list *authors, int from,
+                                    int to, const char *name,
+                                    const char *leftclass,
+                                    const char *centerclass,
+                                    const char *rightclass,
+                                    struct cgit_period *period)
 {
        struct string_list_item *author;
        struct authorstat *authorstat;
 {
        struct string_list_item *author;
        struct authorstat *authorstat;
@@ -293,8 +294,8 @@ void print_combined_authorrow(struct string_list *authors, int from, int to,
        htmlf("<td class='%s'>%ld</td></tr>", rightclass, total);
 }
 
        htmlf("<td class='%s'>%ld</td></tr>", rightclass, total);
 }
 
-void print_authors(struct string_list *authors, int top,
-                  struct cgit_period *period)
+static void print_authors(struct string_list *authors, int top,
+                         struct cgit_period *period)
 {
        struct string_list_item *author;
        struct authorstat *authorstat;
 {
        struct string_list_item *author;
        struct authorstat *authorstat;
@@ -371,12 +372,11 @@ void cgit_show_stats(struct cgit_context *ctx)
 
        i = cgit_find_stats_period(code, &period);
        if (!i) {
 
        i = cgit_find_stats_period(code, &period);
        if (!i) {
-               cgit_print_error(fmt("Unknown statistics type: %c", code[0]));
+               cgit_print_error("Unknown statistics type: %c", code[0]);
                return;
        }
        if (i > ctx->repo->max_stats) {
                return;
        }
        if (i > ctx->repo->max_stats) {
-               cgit_print_error(fmt("Statistics type disabled: %s",
-                                    period->name));
+               cgit_print_error("Statistics type disabled: %s", period->name);
                return;
        }
        authors = collect_stats(ctx, period);
                return;
        }
        authors = collect_stats(ctx, period);