Avoid incomplete function type in casts 42/13742/5
authorBenjamin Kaduk <kaduk@mit.edu>
Sun, 3 Feb 2019 00:39:53 +0000 (18:39 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Sun, 26 Jan 2020 17:53:58 +0000 (12:53 -0500)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 96c0b88947c7aab605170bdca633d3716051a58e)

Change-Id: I950ff8de925a1ca03e50ad7ec394123445b5ce4a
Reviewed-on: https://gerrit.openafs.org/13742
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

src/fsprobe/fsprobe.c
src/rx/rx.c
src/xstat/xstat_fs.c

index 03657eb..f29a56f 100644 (file)
@@ -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;
     }
index 43f094b..8612b70 100644 (file)
@@ -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;
     }
 
 
index f588d0f..51dbe38 100644 (file)
@@ -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;
     }