Cast LWP event functions to void pointer

When building with Solaris Studio, we receive warnings about the type of
the event passed to the LWP functions.

  CC  /export/home/vagrant/openafs/src/vol/volume.o
  "volume.c", line 662: warning: argument #1 is incompatible with prototype:
     prototype: pointer to void : ".../include/lwp.h", line 273
     argument : pointer to function(enum  {volumeSalvager(7), ...)
                  returning int (E_ARG_INCOMPATIBLE_WITH_ARG_L)

In particular, this happens in src/vol/volume.c because our "events" are
function pointers and the LWP functions expect a pointer to a void.

As needed, cast the event pointer to the expected (void *) to eliminate
the warnings.

[mmeffie: Rebase and update commit message.]

Change-Id: I619a52326914aeff66263e62490de3b6d3b0c9ac
Reviewed-on: https://gerrit.openafs.org/15356
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
This commit is contained in:
Mark Vitale 2023-03-17 15:14:19 -04:00 committed by Michael Meffie
parent 9ae6552c4b
commit 09aba81c50

View File

@ -659,7 +659,7 @@ VInitAttachVolumes(ProgramType pt)
}
VOL_LOCK;
VSetVInit_r(2); /* Initialized, and all volumes have been attached */
LWP_NoYieldSignal(VInitAttachVolumes);
LWP_NoYieldSignal((void *)VInitAttachVolumes);
VOL_UNLOCK;
return 0;
}
@ -1326,7 +1326,7 @@ VShutdown_r(void)
#ifdef AFS_PTHREAD_ENV
VOL_CV_WAIT(&vol_init_attach_cond);
#else
LWP_WaitProcess(VInitAttachVolumes);
LWP_WaitProcess((void *)VInitAttachVolumes);
#endif /* AFS_PTHREAD_ENV */
}
}
@ -4237,7 +4237,7 @@ GetVolume(Error * ec, Error * client_ec, VolumeId volumeId, Volume * hint,
/* LWP has no timed wait, so the caller better not be
* expecting one */
opr_Assert(!timeout);
LWP_WaitProcess(VPutVolume);
LWP_WaitProcess((void *)VPutVolume);
#endif /* AFS_PTHREAD_ENV */
continue;
}
@ -4384,7 +4384,7 @@ VForceOffline_r(Volume * vp, int flags)
#ifdef AFS_PTHREAD_ENV
opr_cv_broadcast(&vol_put_volume_cond);
#else /* AFS_PTHREAD_ENV */
LWP_NoYieldSignal(VPutVolume);
LWP_NoYieldSignal((void *)VPutVolume);
#endif /* AFS_PTHREAD_ENV */
VReleaseVolumeHandles_r(vp);
@ -5070,7 +5070,7 @@ VCheckDetach(Volume * vp)
#if defined(AFS_PTHREAD_ENV)
opr_cv_broadcast(&vol_put_volume_cond);
#else /* AFS_PTHREAD_ENV */
LWP_NoYieldSignal(VPutVolume);
LWP_NoYieldSignal((void *)VPutVolume);
#endif /* AFS_PTHREAD_ENV */
}
}
@ -5170,7 +5170,7 @@ VCheckOffline(Volume * vp)
#ifdef AFS_PTHREAD_ENV
opr_cv_broadcast(&vol_put_volume_cond);
#else /* AFS_PTHREAD_ENV */
LWP_NoYieldSignal(VPutVolume);
LWP_NoYieldSignal((void *)VPutVolume);
#endif /* AFS_PTHREAD_ENV */
}
return ret;