Avoid old-style function definitions Avoid declaring old-style functions without any parameters. Functions not accepting any parameters should be declared with `void fn(void)`. See ISO C89 $3.5.4.3.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
diff --git a/src/diff_driver.c b/src/diff_driver.c
index bc35189..2ead551 100644
--- a/src/diff_driver.c
+++ b/src/diff_driver.c
@@ -59,7 +59,7 @@ static git_diff_driver global_drivers[3] = {
{ DIFF_DRIVER_TEXT, GIT_DIFF_FORCE_TEXT, 0 },
};
-git_diff_driver_registry *git_diff_driver_registry_new()
+git_diff_driver_registry *git_diff_driver_registry_new(void)
{
git_diff_driver_registry *reg =
git__calloc(1, sizeof(git_diff_driver_registry));
diff --git a/src/settings.c b/src/settings.c
index 0da19ea..00a3ef0 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -23,7 +23,7 @@ void git_libgit2_version(int *major, int *minor, int *rev)
*rev = LIBGIT2_VER_REVISION;
}
-int git_libgit2_features()
+int git_libgit2_features(void)
{
return 0
#ifdef GIT_THREADS
@@ -73,12 +73,12 @@ static int config_level_to_sysdir(int config_level)
extern char *git__user_agent;
extern char *git__ssl_ciphers;
-const char *git_libgit2__user_agent()
+const char *git_libgit2__user_agent(void)
{
return git__user_agent;
}
-const char *git_libgit2__ssl_ciphers()
+const char *git_libgit2__ssl_ciphers(void)
{
return git__ssl_ciphers;
}
diff --git a/tests/clar.c b/tests/clar.c
index 2caa871..4bee9f7 100644
--- a/tests/clar.c
+++ b/tests/clar.c
@@ -409,7 +409,7 @@ clar_test_init(int argc, char **argv)
}
int
-clar_test_run()
+clar_test_run(void)
{
if (_clar.argc > 1)
clar_parse_args(_clar.argc, _clar.argv);
@@ -424,7 +424,7 @@ clar_test_run()
}
void
-clar_test_shutdown()
+clar_test_shutdown(void)
{
clar_print_shutdown(
_clar.tests_ran,