]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Avoid incomplete function type in casts
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 03657eb1a71741d7793a83814f2ee2c8e5ba1985..f29a56fdd9db2727f7abeff94a0777d88f6ebe21 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 43f094bc092219c2f1a9cf362772fa432f09ecc7..8612b70d94ded0dbf95f07a6337a1b6065d53d3a 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 f588d0f8ce7baa9fae72e45c5fb16be73f42a34e..51dbe3847c1621fb8c02571323be8315a35a48e3 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;
     }