From d0714dfd5047eaeec8abe6c156dc279c0183b40f Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Wed, 3 Jul 2024 12:01:33 -0400 Subject: [PATCH] ubik: Correct thread creation function signatures The Solaris Studio compiler emits the following warnings: "ubik.c", line 363: warning: argument #3 is incompatible with prototype: prototype: pointer to function(pointer to void) returning pointer to void : "/usr/include/pthread.h", line 209 argument : pointer to void "ubik.c", line 363: warning: argument #3 is incompatible with prototype: prototype: pointer to function(pointer to void) returning pointer to void : "/usr/include/pthread.h", line 218 argument : pointer to void "ubik.c", line 508: warning: argument #3 is incompatible with prototype: prototype: pointer to function(pointer to void) returning pointer to void : "ubik.c", line 359 argument : pointer to void "ubik.c", line 522: warning: argument #3 is incompatible with prototype: prototype: pointer to function(pointer to void) returning pointer to void : "ubik.c", line 359 argument : pointer to void "ubik.c", line 533: warning: argument #3 is incompatible with prototype: prototype: pointer to function(pointer to void) returning pointer to void : "ubik.c", line 359 argument : pointer to void Adjust the signature for ubik_thread_create(). Remove any superfluous casts its callers make on argument #3. Change-Id: Id3cb3abfcd51fe263098371ac0fa1fdcd5e44f96 Reviewed-on: https://gerrit.openafs.org/16059 Reviewed-by: Cheyenne Wills Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Ben Huntsman Reviewed-by: Mark Vitale Tested-by: BuildBot --- src/ubik/ubik.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ubik/ubik.c b/src/ubik/ubik.c index 6adf9dd3f3..6dfab81eac 100644 --- a/src/ubik/ubik.c +++ b/src/ubik/ubik.c @@ -356,7 +356,8 @@ ContactQuorum_DISK_SetVersion(struct ubik_trans *atrans, int aflags, #if defined(AFS_PTHREAD_ENV) static int -ubik_thread_create(pthread_attr_t *tattr, pthread_t *thread, void *proc) { +ubik_thread_create(pthread_attr_t *tattr, pthread_t *thread, void *(* proc)(void *)) +{ opr_Verify(pthread_attr_init(tattr) == 0); opr_Verify(pthread_attr_setdetachstate(tattr, PTHREAD_CREATE_DETACHED) == 0); @@ -505,7 +506,7 @@ ubik_ServerInitCommon(afs_uint32 myHost, short myPort, * the "steplock" problem in ubik initialization. Defect 11037. */ #ifdef AFS_PTHREAD_ENV - ubik_thread_create(&rxServer_tattr, &rxServerThread, (void *)rx_ServerProc); + ubik_thread_create(&rxServer_tattr, &rxServerThread, rx_ServerProc); #else LWP_CreateProcess(rx_ServerProc, rx_stackSize, RX_PROCESS_PRIORITY, NULL, "rx_ServerProc", &junk); @@ -519,7 +520,7 @@ ubik_ServerInitCommon(afs_uint32 myHost, short myPort, /* now start up async processes */ #ifdef AFS_PTHREAD_ENV ubik_thread_create(&ubeacon_Interact_tattr, &ubeacon_InteractThread, - (void *)ubeacon_Interact); + ubeacon_Interact); #else code = LWP_CreateProcess(ubeacon_Interact, 16384 /*8192 */ , LWP_MAX_PRIORITY - 1, (void *)0, "beacon", @@ -530,7 +531,7 @@ ubik_ServerInitCommon(afs_uint32 myHost, short myPort, #ifdef AFS_PTHREAD_ENV ubik_thread_create(&urecovery_Interact_tattr, &urecovery_InteractThread, - (void *)urecovery_Interact); + urecovery_Interact); return 0; /* is this correct? - klm */ #else code = LWP_CreateProcess(urecovery_Interact, 16384 /*8192 */ ,