aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gistatic.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/gistatic.c b/src/gistatic.c
index fce6959..1b36910 100644
--- a/src/gistatic.c
+++ b/src/gistatic.c
@@ -1,3 +1,6 @@
+#include "config.h"
+#include "gistatic.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@ -32,7 +35,7 @@ static void testing(const char *const message) {
);
}
-static void test_ok() {
+static void test_ok(void) {
assert(fprintf(stderr, " " COLOUR_GREEN "OK" COLOUR_RESET ".\n") > 0);
}
#endif
@@ -105,7 +108,7 @@ static const char *const MSGS[] = {
};
#ifdef TEST
-static void dump_translatable_strings() {
+static void dump_translatable_strings(void) {
const size_t size =
strlen(__FILE__) - strlen(".c") + strlen(".msg") + sizeof('\0');
char *const catalog_path = malloc(size);
@@ -338,7 +341,7 @@ static const char *_(int msg_id) {
}
#ifdef TEST
-static void test_underscore() {
+static void test_underscore(void) {
test_start("test_underscore");
const char *const original_locale = setlocale(LC_ALL, NULL);
setlocale(LC_ALL, "");
@@ -392,7 +395,7 @@ static char *remove_suffix(char *const s, const char *const suffix) {
}
#ifdef TEST
-static void test_remove_suffix() {
+static void test_remove_suffix(void) {
test_start("test_remove_suffix");
{
testing("empty string");
@@ -513,7 +516,7 @@ static char *strjoin(const char *const s1, const char *const s2) {
}
#ifdef TEST
-static void test_strjoin() {
+static void test_strjoin(void) {
test_start("test_strjoin");
{
testing("joining empty strings");
@@ -585,7 +588,7 @@ static char *formatted_date(const time_t time_sec) {
}
#ifdef TEST
-static void test_formatted_date() {
+static void test_formatted_date(void) {
test_start("test_formatted_date");
{
testing("when given 0");
@@ -733,7 +736,7 @@ static char *escape_html(const char *s) {
}
#ifdef TEST
-static void test_escape_html() {
+static void test_escape_html(void) {
test_start("test_escape_html");
{
testing("string with no escapable chars");
@@ -820,7 +823,7 @@ static bool should_trim(const char c) {
}
#ifdef TEST
-static void test_should_trim() {
+static void test_should_trim(void) {
test_start("test_should_trim");
{
testing("the \\0 null character");
@@ -870,7 +873,7 @@ static void strtrim(char *const s) {
}
#ifdef TEST
-static void test_strtrim() {
+static void test_strtrim(void) {
test_start("test_strtrim");
{
testing("empty string");
@@ -1022,7 +1025,7 @@ static int index_write_header(FILE *const fd, const char *const idx_title) {
return 0;
}
-static char *footer_signature_string() {
+static char *footer_signature_string(void) {
const size_t signature_size = strlen(_(MSG_FOOTER_TEMPLATE))
- strlen("%s") + strlen(PROJECT_HOMEPAGE_LINK) + sizeof('\0');
char *const signature_text = malloc(signature_size);
@@ -1098,7 +1101,7 @@ cleanup:
}
#ifdef TEST
-static void test_last_commit_date() {
+static void test_last_commit_date(void) {
test_start("test_last_commit_date");
{
testing("embedded Git repository"