Squash pthreaded ubik warnings
authorAndrew Deason <adeason@sinenomine.net>
Mon, 25 Jan 2010 22:56:13 +0000 (16:56 -0600)
committerDerrick Brashear <shadow|account-1000005@unknown>
Tue, 2 Feb 2010 17:31:56 +0000 (09:31 -0800)
Fix/ignore some warnings with --enable-pthreaded-ubik:

 - ubik/ubik.c: move rx_stackSize decl to non-pthread code, since it's
   only used there

 - budb/db_dump.c: move 'code' decl to non-pthread code, since it's only
   used there

 - ubik/recovery.c: move return to outside the ifdef, so we still have a
   return statement in the pthreaded case

 - Add -Wno-error to beacon.c in tubik, to match the ubik case

Change-Id: I614f2425c36e77bb1a08838b45166d8edb080c73
Reviewed-on: http://gerrit.openafs.org/1211
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/budb/db_dump.c
src/budb/server.c
src/tubik/Makefile.in
src/ubik/recovery.c
src/ubik/ubik.c

index 80d7513..f971a4b 100644 (file)
@@ -62,7 +62,9 @@ dumpSyncP dumpSyncPtr = &dumpSync;
 afs_int32
 canWrite(int fid)
 {
+#ifndef AFS_PTHREAD_ENV
     afs_int32 code = 0;
+#endif
     extern dumpSyncP dumpSyncPtr;
 
     ObtainWriteLock(&dumpSyncPtr->ds_lock);
@@ -104,7 +106,9 @@ canWrite(int fid)
 void
 haveWritten(afs_int32 nbytes)
 {
+#ifndef AFS_PTHREAD_ENV
     afs_int32 code = 0;
+#endif
     extern dumpSyncP dumpSyncPtr;
 
     dumpSyncPtr->ds_bytes += nbytes;
@@ -129,7 +133,9 @@ haveWritten(afs_int32 nbytes)
 void
 doneWriting(afs_int32 error)
 {
+#ifndef AFS_PTHREAD_ENV
     afs_int32 code = 0;
+#endif
 
     /* wait for the reader */
     ObtainWriteLock(&dumpSyncPtr->ds_lock);
index f232cad..63e538a 100644 (file)
@@ -80,10 +80,10 @@ int lwps   = 3;
 afs_uint32 SHostAddrs[ADDRSPERSITE];
 
 #if defined(AFS_PTHREAD_ENV)
-char *
+static int
 threadNum(void)
 {
-    return pthread_getspecific(rx_thread_id_key);
+    return (intptr_t)pthread_getspecific(rx_thread_id_key);
 }
 #endif
 
index c475585..2e626f1 100644 (file)
@@ -199,7 +199,7 @@ remote.o: ${srcdir}/remote.c
        ${CCRULE}
 
 beacon.o: ${srcdir}/beacon.c
-       ${CCRULE}
+       ${CCRULE} @CFLAGS_NOERROR@
 
 lock.o: ${srcdir}/lock.c
        ${CCRULE}
index ccbd346..01f279e 100644 (file)
@@ -94,8 +94,8 @@ urecovery_LostServer(void)
 #if !defined(AFS_PTHREAD_ENV)
     /*  No corresponding LWP_WaitProcess found anywhere for this -- klm */
     LWP_NoYieldSignal(&urecovery_state);
-    return 0;
 #endif
+    return 0;
 }
 
 /*!
index f72032f..4bcfe49 100644 (file)
@@ -399,13 +399,13 @@ ubik_ServerInitCommon(afs_int32 myHost, short myPort,
     pthread_attr_t urecovery_Interact_tattr;
 #else
     PROCESS junk;
+    extern int rx_stackSize;
 #endif
 
     afs_int32 secIndex;
     struct rx_securityClass *secClass;
 
     struct rx_service *tservice;
-    extern int rx_stackSize;
 
     initialize_U_error_table();