From 073caa67f2aa221de113a21f8105940421a2da90 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 29 Aug 2022 19:53:28 -0700
Subject: [PATCH] Add missing prototypes to function declarations

With Clang 15+ compiler -Wstrict-prototypes is triggering warnings which
are turned into errors with -Werror, this fixes the problem by adding
missing prototypes

Fixes errors like
| log.c:134:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
| static void syslog_init()
|                        ^
|                         void

Upstream-Status: Submitted [https://lists.samba.org/archive/rsync/2022-August/032858.html]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
---
 checksum.c   | 2 +-
 exclude.c    | 2 +-
 log.c        | 2 +-
 main.c       | 2 +-
 zlib/crc32.c | 2 +-
 zlib/trees.c | 2 +-
 zlib/zutil.c | 4 ++--
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/checksum.c b/checksum.c
index 66e8089..b24b202 100644
--- a/checksum.c
+++ b/checksum.c
@@ -779,7 +779,7 @@ static void verify_digest(struct name_num_item *nni, BOOL check_auth_list)
 }
 #endif
 
-void init_checksum_choices()
+void init_checksum_choices(void)
 {
 #if defined SUPPORT_XXH3 || defined USE_OPENSSL
 	struct name_num_item *nni;
diff --git a/exclude.c b/exclude.c
index 87edbcf..ae0de2f 100644
--- a/exclude.c
+++ b/exclude.c
@@ -363,7 +363,7 @@ void implied_include_partial_string(const char *s_start, const char *s_end)
 	memcpy(partial_string_buf, s_start, partial_string_len);
 }
 
-void free_implied_include_partial_string()
+void free_implied_include_partial_string(void)
 {
 	if (partial_string_buf) {
 		if (partial_string_len)
diff --git a/log.c b/log.c
index e4ba1cc..8482b71 100644
--- a/log.c
+++ b/log.c
@@ -131,7 +131,7 @@ static void logit(int priority, const char *buf)
 	}
 }
 
-static void syslog_init()
+static void syslog_init(void)
 {
 	int options = LOG_PID;
 
diff --git a/main.c b/main.c
index 4f070ac..f59eaec 100644
--- a/main.c
+++ b/main.c
@@ -246,7 +246,7 @@ void read_del_stats(int f)
 	stats.deleted_files += stats.deleted_specials = read_varint(f);
 }
 
-static void become_copy_as_user()
+static void become_copy_as_user(void)
 {
 	char *gname;
 	uid_t uid;
diff --git a/zlib/crc32.c b/zlib/crc32.c
index 05733f4..50c6c02 100644
--- a/zlib/crc32.c
+++ b/zlib/crc32.c
@@ -187,7 +187,7 @@ local void write_table(out, table)
 /* =========================================================================
  * This function can be used by asm versions of crc32()
  */
-const z_crc_t FAR * ZEXPORT get_crc_table()
+const z_crc_t FAR * ZEXPORT get_crc_table(void)
 {
 #ifdef DYNAMIC_CRC_TABLE
     if (crc_table_empty)
diff --git a/zlib/trees.c b/zlib/trees.c
index 9c66770..0d9047e 100644
--- a/zlib/trees.c
+++ b/zlib/trees.c
@@ -231,7 +231,7 @@ local void send_bits(s, value, length)
 /* ===========================================================================
  * Initialize the various 'constant' tables.
  */
-local void tr_static_init()
+local void tr_static_init(void)
 {
 #if defined(GEN_TREES_H) || !defined(STDC)
     static int static_init_done = 0;
diff --git a/zlib/zutil.c b/zlib/zutil.c
index bbba7b2..61f8dc9 100644
--- a/zlib/zutil.c
+++ b/zlib/zutil.c
@@ -27,12 +27,12 @@ z_const char * const z_errmsg[10] = {
 ""};
 
 
-const char * ZEXPORT zlibVersion()
+const char * ZEXPORT zlibVersion(void)
 {
     return ZLIB_VERSION;
 }
 
-uLong ZEXPORT zlibCompileFlags()
+uLong ZEXPORT zlibCompileFlags(void)
 {
     uLong flags;
 
