From: Jason A. Donenfeld Date: Mon, 31 Oct 2022 14:38:58 +0000 (+0100) Subject: show: apply const to right part of pointer X-Git-Tag: v1.0.20250521~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ca2e89ff21794b1853f628b8d5cb0f91eb140461;p=thirdparty%2Fwireguard-tools.git show: apply const to right part of pointer Without this -Wcast-qual complains: show.c:30:43: warning: cast from 'const void *' to 'const void **' drops const qualifier [-Wcast-qual] const struct wgpeer *a = *(const void **)first, *b = *(const void **)second; ^ show.c:30:71: warning: cast from 'const void *' to 'const void **' drops const qualifier [-Wcast-qual] const struct wgpeer *a = *(const void **)first, *b = *(const void **)second; Signed-off-by: Jason A. Donenfeld --- diff --git a/src/show.c b/src/show.c index a61a06e..3fd3d9e 100644 --- a/src/show.c +++ b/src/show.c @@ -27,7 +27,7 @@ static int peer_cmp(const void *first, const void *second) { time_t diff; - const struct wgpeer *a = *(const void **)first, *b = *(const void **)second; + const struct wgpeer *a = *(void *const *)first, *b = *(void *const *)second; if (!a->last_handshake_time.tv_sec && !a->last_handshake_time.tv_nsec && (b->last_handshake_time.tv_sec || b->last_handshake_time.tv_nsec)) return 1;