blob: 15ef54f80ea1f282f6685e907b5d9c6a2d6f4c95 [file] [log] [blame]
Andrew Geissler87f5cff2022-09-30 13:13:31 -05001From 6021d3d60e64d9174f41515d2d962df9b5d7645e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 29 Aug 2022 17:15:28 -0700
4Subject: [PATCH] Fix function protypes
5
6clang-15+ has started diagnosing them as errors
7
8thread.c:925:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
9| void STATS_UNLOCK() {
10| ^
11| void
12
13Upstream-Status: Submitted [https://github.com/memcached/memcached/pull/928]
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 assoc.c | 4 ++--
17 memcached.c | 4 ++--
18 slabs.c | 2 +-
19 testapp.c | 2 +-
20 thread.c | 4 ++--
21 5 files changed, 8 insertions(+), 8 deletions(-)
22
23diff --git a/assoc.c b/assoc.c
24index bc68695..01063a9 100644
25--- a/assoc.c
26+++ b/assoc.c
27@@ -261,7 +261,7 @@ static void *assoc_maintenance_thread(void *arg) {
28
29 static pthread_t maintenance_tid;
30
31-int start_assoc_maintenance_thread() {
32+int start_assoc_maintenance_thread(void) {
33 int ret;
34 char *env = getenv("MEMCACHED_HASH_BULK_MOVE");
35 if (env != NULL) {
36@@ -279,7 +279,7 @@ int start_assoc_maintenance_thread() {
37 return 0;
38 }
39
40-void stop_assoc_maintenance_thread() {
41+void stop_assoc_maintenance_thread(void) {
42 mutex_lock(&maintenance_lock);
43 do_run_maintenance_thread = 0;
44 pthread_cond_signal(&maintenance_cond);
45diff --git a/memcached.c b/memcached.c
46index 7871fe8..4d3b54a 100644
47--- a/memcached.c
48+++ b/memcached.c
49@@ -84,7 +84,7 @@ static int try_read_command_udp(conn *c);
50 static enum try_read_result try_read_network(conn *c);
51 static enum try_read_result try_read_udp(conn *c);
52
53-static int start_conn_timeout_thread();
54+static int start_conn_timeout_thread(void);
55
56 /* stats */
57 static void stats_init(void);
58@@ -374,7 +374,7 @@ static void *conn_timeout_thread(void *arg) {
59 return NULL;
60 }
61
62-static int start_conn_timeout_thread() {
63+static int start_conn_timeout_thread(void) {
64 int ret;
65
66 if (settings.idle_timeout == 0)
67diff --git a/slabs.c b/slabs.c
68index 3c78d8a..0dadd35 100644
69--- a/slabs.c
70+++ b/slabs.c
71@@ -638,7 +638,7 @@ static void *memory_allocate(size_t size) {
72 }
73
74 /* Must only be used if all pages are item_size_max */
75-static void memory_release() {
76+static void memory_release(void) {
77 void *p = NULL;
78 if (mem_base != NULL)
79 return;
80diff --git a/testapp.c b/testapp.c
81index 5face54..387a847 100644
82--- a/testapp.c
83+++ b/testapp.c
84@@ -80,7 +80,7 @@ static struct conn *con = NULL;
85 static bool allow_closed_read = false;
86 static bool enable_ssl = false;
87
88-static void close_conn() {
89+static void close_conn(void) {
90 if (con == NULL) return;
91 #ifdef TLS
92 if (con->ssl) {
93diff --git a/thread.c b/thread.c
94index d5ed052..f5efdc3 100644
95--- a/thread.c
96+++ b/thread.c
97@@ -918,11 +918,11 @@ enum store_item_type store_item(item *item, int comm, conn* c) {
98
99 /******************************* GLOBAL STATS ******************************/
100
101-void STATS_LOCK() {
102+void STATS_LOCK(void) {
103 pthread_mutex_lock(&stats_lock);
104 }
105
106-void STATS_UNLOCK() {
107+void STATS_UNLOCK(void) {
108 pthread_mutex_unlock(&stats_lock);
109 }
110