Skip to content

Commit 8fd74c0

Browse files
committed
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 parent bb0edf8 commit 8fd74c0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/diff_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static git_diff_driver global_drivers[3] = {
5959
{ DIFF_DRIVER_TEXT, GIT_DIFF_FORCE_TEXT, 0 },
6060
};
6161

62-
git_diff_driver_registry *git_diff_driver_registry_new()
62+
git_diff_driver_registry *git_diff_driver_registry_new(void)
6363
{
6464
git_diff_driver_registry *reg =
6565
git__calloc(1, sizeof(git_diff_driver_registry));

src/settings.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void git_libgit2_version(int *major, int *minor, int *rev)
2323
*rev = LIBGIT2_VER_REVISION;
2424
}
2525

26-
int git_libgit2_features()
26+
int git_libgit2_features(void)
2727
{
2828
return 0
2929
#ifdef GIT_THREADS
@@ -73,12 +73,12 @@ static int config_level_to_sysdir(int config_level)
7373
extern char *git__user_agent;
7474
extern char *git__ssl_ciphers;
7575

76-
const char *git_libgit2__user_agent()
76+
const char *git_libgit2__user_agent(void)
7777
{
7878
return git__user_agent;
7979
}
8080

81-
const char *git_libgit2__ssl_ciphers()
81+
const char *git_libgit2__ssl_ciphers(void)
8282
{
8383
return git__ssl_ciphers;
8484
}

tests/clar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ clar_test_init(int argc, char **argv)
409409
}
410410

411411
int
412-
clar_test_run()
412+
clar_test_run(void)
413413
{
414414
if (_clar.argc > 1)
415415
clar_parse_args(_clar.argc, _clar.argv);
@@ -424,7 +424,7 @@ clar_test_run()
424424
}
425425

426426
void
427-
clar_test_shutdown()
427+
clar_test_shutdown(void)
428428
{
429429
clar_print_shutdown(
430430
_clar.tests_ran,

0 commit comments

Comments
 (0)