From 5e3be1be09c947810732e7be2a4bb1b0ed75de4a Mon Sep 17 00:00:00 2001 From: Madelyn Olson <34459052+madolson@users.noreply.github.com> Date: Tue, 2 May 2023 17:31:32 -0700 Subject: Remove prototypes with empty declarations (#12020) Technically declaring a prototype with an empty declaration has been deprecated since the early days of C, but we never got a warning for it. C2x will apparently be introducing a breaking change if you are using this type of declarator, so Clang 15 has started issuing a warning with -pedantic. Although not apparently a problem for any of the compiler we build on, if feels like the right thing is to properly adhere to the C standard and use (void). --- src/defrag.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/defrag.c') diff --git a/src/defrag.c b/src/defrag.c index 5b7fdb775..ff63cf8fd 100644 --- a/src/defrag.c +++ b/src/defrag.c @@ -781,7 +781,7 @@ float getAllocatorFragmentation(size_t *out_frag_bytes) { /* We may need to defrag other globals, one small allocation can hold a full allocator run. * so although small, it is still important to defrag these */ -void defragOtherGlobals() { +void defragOtherGlobals(void) { /* there are many more pointers to defrag (e.g. client argv, output / aof buffers, etc. * but we assume most of these are short lived, we only need to defrag allocations @@ -887,7 +887,7 @@ int defragLaterStep(redisDb *db, long long endtime) { #define LIMIT(y, min, max) ((y)<(min)? min: ((y)>(max)? max: (y))) /* decide if defrag is needed, and at what CPU effort to invest in it */ -void computeDefragCycles() { +void computeDefragCycles(void) { size_t frag_bytes; float frag_pct = getAllocatorFragmentation(&frag_bytes); /* If we're not already running, and below the threshold, exit. */ -- cgit v1.2.1