]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
show: apply const to right part of pointer
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 31 Oct 2022 14:38:58 +0000 (15:38 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 31 Oct 2022 14:39:30 +0000 (15:39 +0100)
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 <Jason@zx2c4.com>
src/show.c

index a61a06ef06465246098e79e31c60baa3f837cdfb..3fd3d9e2a151354aa2453f4ee1fc6dd99dd6f09f 100644 (file)
@@ -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;