From 09aba81c50cbda2c8af7f1fcc977b7b946c1908e Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Fri, 17 Mar 2023 15:14:19 -0400 Subject: [PATCH] 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 Reviewed-by: Michael Meffie Tested-by: Michael Meffie --- src/vol/volume.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vol/volume.c b/src/vol/volume.c index 6c167caed2..4f1a7c5741 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -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;