From ed0cb4eb6df1a87cc015b2bc1e419bab7bcd32ee Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Wed, 6 Jun 2001 23:00:09 +0000 Subject: [PATCH] lwp-warnings-and-unused-variables-cleanup-20010606 make lwp warnings and unused variables go away --- src/lwp/Makefile | 2 +- src/lwp/lwp.c | 29 +++++++++++++++++++---------- src/lwp/lwp.h | 3 ++- src/lwp/process.c | 11 ++++++++--- src/lwp/threadname.c | 7 +++++++ 5 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/lwp/Makefile b/src/lwp/Makefile index 2b0c9be..37144e8 100644 --- a/src/lwp/Makefile +++ b/src/lwp/Makefile @@ -13,7 +13,7 @@ include ../config/Makefile.${SYS_NAME} # subtle bugs that may have been introduced in process.s, be warned! OPTIMIZE=${LWP_OPTMZ} -CFLAGS=${OPTIMIZE} -I${SRCDIR}include ${XCFLAGS} +CFLAGS=${OPTIMIZE} -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS} include ../config/Makefile.version diff --git a/src/lwp/lwp.c b/src/lwp/lwp.c index 1a40ca8..853f562 100644 --- a/src/lwp/lwp.c +++ b/src/lwp/lwp.c @@ -125,7 +125,7 @@ int lwp_nextindex; /* Minimum stack size */ int lwp_MinStackSize=0; -static lwp_remove(p, q) +static int lwp_remove(p, q) register PROCESS p; register struct QUEUE *q; { @@ -141,9 +141,10 @@ static lwp_remove(p, q) if (q->head == p) q -> head = p -> next; q->count--; p -> next = p -> prev = NULL; + return 0; } -static insert(p, q) +static int insert(p, q) register PROCESS p; register struct QUEUE *q; { @@ -157,9 +158,10 @@ static insert(p, q) p -> next = q -> head; } q->count++; + return 0; } -static move(p, from, to) +static int move(p, from, to) PROCESS p; struct QUEUE *from, *to; { @@ -167,7 +169,7 @@ static move(p, from, to) lwp_remove(p, from); insert(p, to); - + return 0; } /* Iterator macro */ @@ -520,7 +522,7 @@ int LWP_DispatchProcess() /* explicit voluntary preemption */ } #ifdef DEBUG -Dump_Processes() +int Dump_Processes() { if (lwp_init) { register int i; @@ -532,6 +534,7 @@ Dump_Processes() for_all_elts(x, blocked, { Dump_One_Process(x); }) } else printf("***LWP: LWP support not initialized\n"); + return 0; } #endif @@ -719,6 +722,7 @@ static void Abort_LWP(msg) Exit_LWP(); else savecontext(Exit_LWP, &tempcontext, LWPANCHOR.outersp); + return; } static int Create_Process_Part2 () /* creates a context for the new process */ @@ -730,9 +734,10 @@ static int Create_Process_Part2 () /* creates a context for the new process */ savecontext(Dispatcher, &temp->context, NULL); (*temp->ep)(temp->parm); LWP_DestroyProcess(temp); + return 0; } -static Delete_PCB(pid) /* remove a PCB from the process list */ +static int Delete_PCB(pid) /* remove a PCB from the process list */ register PROCESS pid; { Debug(4, ("Entered Delete_PCB")) @@ -740,10 +745,11 @@ static Delete_PCB(pid) /* remove a PCB from the process list */ ? &blocked : &runnable[pid->priority])); LWPANCHOR.processcnt--; + return 0; } #ifdef DEBUG -static Dump_One_Process(pid) +static int Dump_One_Process(pid) PROCESS pid; { int i; @@ -779,17 +785,19 @@ static Dump_One_Process(pid) } if (pid->wakevent>0) printf("***LWP: Number of last wakeup event: %d\n", pid->wakevent); + return 0; } #endif -static purge_dead_pcbs() +static int purge_dead_pcbs() { for_all_elts(cur, blocked, { if (cur->status == DESTROYED) Dispose_of_Dead_PCB(cur); }) + return 0; } int LWP_TraceProcesses = 0; -static Dispatcher() /* Lightweight process dispatcher */ +static int Dispatcher() /* Lightweight process dispatcher */ { register int i; #ifdef DEBUG @@ -895,7 +903,7 @@ static void Dispose_of_Dead_PCB (cur) */ } -static Exit_LWP() +static int Exit_LWP() { abort(); } @@ -1000,6 +1008,7 @@ static afs_int32 Initialize_Stack(stackptr, stacksize) #else *(afs_int32 *)stackptr = STACKMAGIC; #endif + return 0; } static int Stack_Used(stackptr, stacksize) diff --git a/src/lwp/lwp.h b/src/lwp/lwp.h index 359d5c2..0b3de23 100644 --- a/src/lwp/lwp.h +++ b/src/lwp/lwp.h @@ -336,7 +336,8 @@ extern void IOMGR_Sleep(int seconds); extern int IOMGR_Cancel(PROCESS pid); extern int IOMGR_Initialize(void); extern void IOMGR_FreeFDSet(fd_set * fds); -static void SignalTimeout(int code, struct timeval *timeout); +extern int IOMGR_SoftSig( int (*aproc)(), char *arock); + /* fasttime.c */ extern int FT_GetTimeOfDay(struct timeval *tv, struct timezone *tz); diff --git a/src/lwp/process.c b/src/lwp/process.c index 32aa938..897cff7 100644 --- a/src/lwp/process.c +++ b/src/lwp/process.c @@ -12,6 +12,10 @@ #include #include #include "lwp.h" +#include +#ifdef HAVE_STDLIB_H +#include +#endif #if defined(AFS_OSF_ENV) || defined(AFS_S390_LINUX20_ENV) extern int PRE_Block; /* used in lwp.c and process.s */ @@ -80,9 +84,8 @@ static jmp_buf jmp_tmp; static char (*EP)(); static int rc; static jmp_buf_type *jmpBuffer; -static int code; -savecontext(ep, savearea, sp) +afs_int32 savecontext(ep, savearea, sp) char (*ep)(); struct lwp_context *savearea; char* sp; @@ -140,9 +143,10 @@ char* sp; perror("Error in setjmp2 : restoring\n"); exit(3); } + return 0; } -returnto(savearea) +afs_int32 returnto(savearea) struct lwp_context *savearea; { #if defined(DEBUG) @@ -158,5 +162,6 @@ struct lwp_context *savearea; #endif PRE_Block = 0; longjmp(savearea->setjmp_buffer, 2); + return 0; } diff --git a/src/lwp/threadname.c b/src/lwp/threadname.c index 0b31bd7..b56161f 100644 --- a/src/lwp/threadname.c +++ b/src/lwp/threadname.c @@ -20,6 +20,13 @@ /* ********************************************************************** */ #include +#include +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STRINGS_H +#include +#endif #if defined(AFS_PTHREAD_ENV) #include #else /* defined(AFS_PTHREAD_ENV) */ -- 1.9.4