From 1b704df8db4c7e2191b3683c03590aeb663af2f8 Mon Sep 17 00:00:00 2001 From: Benjamin Kaduk Date: Sat, 2 Feb 2019 18:39:53 -0600 Subject: [PATCH] Avoid incomplete function type in casts clang complains that these casts contain an incomplete function type (since the function argument is omitted rather than declared to be void). Since we just need the cast to pointer type, let the compiler do it implicitly and pass stock NULL, rather than trying to force a cast to function-pointer type. Reviewed-on: https://gerrit.openafs.org/13473 Tested-by: BuildBot Reviewed-by: Cheyenne Wills Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit 96c0b88947c7aab605170bdca633d3716051a58e) Change-Id: I950ff8de925a1ca03e50ad7ec394123445b5ce4a Reviewed-on: https://gerrit.openafs.org/13742 Reviewed-by: Andrew Deason Reviewed-by: Marcio Brito Barbosa Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Stephan Wiesand --- src/fsprobe/fsprobe.c | 2 +- src/rx/rx.c | 6 +++--- src/xstat/xstat_fs.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fsprobe/fsprobe.c b/src/fsprobe/fsprobe.c index 03657eb1a..f29a56fdd 100644 --- a/src/fsprobe/fsprobe.c +++ b/src/fsprobe/fsprobe.c @@ -509,7 +509,7 @@ fsprobe_Init(int a_numServers, struct sockaddr_in *a_socketArray, a_ProbeFreqInSecs); arg_errfound = 1; } - if (a_ProbeHandler == (int (*)())0) { + if (a_ProbeHandler == NULL) { fprintf(stderr, "[%s] Null probe handler function argument\n", rn); arg_errfound = 1; } diff --git a/src/rx/rx.c b/src/rx/rx.c index 43f094bc0..8612b70d9 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -2380,7 +2380,7 @@ rx_EndCall(struct rx_call *call, afs_int32 rc) call->abortCount = 0; } - call->arrivalProc = (void (*)())0; + call->arrivalProc = NULL; if (rc && call->error == 0) { rxi_CallError(call, rc); call->app.mode = RX_MODE_ERROR; @@ -3961,7 +3961,7 @@ rxi_ReceiveDataPacket(struct rx_call *call, if (call->arrivalProc) { (*call->arrivalProc) (call, call->arrivalProcHandle, call->arrivalProcArg); - call->arrivalProc = (void (*)())0; + call->arrivalProc = NULL; } /* Update last packet received */ @@ -5307,7 +5307,7 @@ rxi_ResetCall(struct rx_call *call, int newcall) if (call->arrivalProc) { (*call->arrivalProc) (call, call->arrivalProcHandle, call->arrivalProcArg); - call->arrivalProc = (void (*)())0; + call->arrivalProc = NULL; } diff --git a/src/xstat/xstat_fs.c b/src/xstat/xstat_fs.c index f588d0f8c..51dbe3847 100644 --- a/src/xstat/xstat_fs.c +++ b/src/xstat/xstat_fs.c @@ -443,7 +443,7 @@ xstat_fs_Init(int a_numServers, struct sockaddr_in *a_socketArray, a_ProbeFreqInSecs); arg_errfound = 1; } - if (a_ProbeHandler == (int (*)())0) { + if (a_ProbeHandler == NULL) { fprintf(stderr, "[%s] Null probe handler function argument\n", rn); arg_errfound = 1; } -- 2.39.5