From ede12d99fc46ca3fd638d8b47f498497ef28b3df Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 27 Aug 2021 22:44:19 -0300 Subject: src/*.c: Add newline between function return type and its name The purpose of this change is two-fold: - make function and variable declarations grep-friendly (one can use a pattern /^fn_name/ to find the definition); - make the lines shorter, so less functions need to have their arguments span over many lines. This is more grep-friendly both for finding the function definition, but also for matching on the return type of the function or the variable. Update tests/c-lint.sh to enforce this. --- src/tar.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/tar.c') diff --git a/src/tar.c b/src/tar.c index cc8eaa0..8272eb4 100644 --- a/src/tar.c +++ b/src/tar.c @@ -30,7 +30,8 @@ About the ustar format: */ -static void logerr( +static void +logerr( const char *const s, const char *const msg, const int lineno @@ -38,7 +39,8 @@ static void logerr( logerr_file(s, msg, __FILE__, lineno); } -static void logerrs( +static void +logerrs( const char *const pre, const char *const mid, const char *const post, @@ -48,7 +50,8 @@ static void logerrs( logerrs_file(pre, mid, post, msg, __FILE__, lineno); } -static void logerrl( +static void +logerrl( const char *const pre, const size_t mid, const char *const post, @@ -66,8 +69,9 @@ struct TarEntry { // static int tar_write(FILE *const fd,  -int tarball_write_from_directory( - FILE *const fd, +int +tarball_write_from_directory( + const FILE *const fd, const char *const directory_path ) { int ret = 0; @@ -94,5 +98,6 @@ cleanup: } #ifdef TEST -void unit_tests_tar(void) {} +void +unit_tests_tar(void) {} #endif -- cgit v1.2.3