Bugzilla bug #13361: fixed gcc compiler warnings. Thanks to
authorwtc%netscape.com
Mon, 20 Sep 1999 23:59:09 +0000
changeset 813 0f3c857585eeca2a5b0d99cd8d25de498dfb2267
parent 812 64cc1b28f39f47afa7d004c9cdaf114eab24a1c2
child 814 fef11f364bb98488a50a6c2e3c147ab26412ffc6
push idunknown
push userunknown
push dateunknown
bugs13361
Bugzilla bug #13361: fixed gcc compiler warnings. Thanks to Steve Lamm (slamm@netscape.com) for the bug report. Modified files: prtime.h, prmwait.c, pratom.c, ptio.c, ptthread.c.
pr/include/prtime.h
pr/src/io/prmwait.c
pr/src/misc/pratom.c
pr/src/pthreads/ptio.c
pr/src/pthreads/ptthread.c
--- a/pr/include/prtime.h
+++ b/pr/include/prtime.h
@@ -190,17 +190,18 @@ PR_ImplodeTime(const PRExplodedTime *exp
  *   - tm_month and tm_year: because the number of days in a month and
  *     number of days in a year are not constant, it is ambiguous to
  *     manipulate the month and year fields, although one may be tempted
  *     to.  For example, what does "a month from January 31st" mean?
  *   - tm_wday and tm_yday: these fields are calculated by NSPR.  Users
  *     should treat them as "read-only".
  */
 
-PR_EXTERN(void) PR_NormalizeTime(PRExplodedTime *time, PRTimeParamFn params);
+PR_EXTERN(void) PR_NormalizeTime(
+    PRExplodedTime *exploded, PRTimeParamFn params);
 
 /**********************************************************************/
 /*********************** TIME PARAMETER FUNCTIONS *********************/
 /**********************************************************************/
 
 /* Time parameters that suit current host machine */
 PR_EXTERN(PRTimeParameters) PR_LocalTimeParameters(const PRExplodedTime *gmt);
 
@@ -264,15 +265,15 @@ PR_EXTERN(PRStatus) PR_ParseTimeString (
 PR_EXTERN(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt, 
                                            const PRExplodedTime *tm);
 
 /* Format a time value into a buffer. Time is always in US English format, regardless
  * of locale setting.
  */
 PR_EXTERN(PRUint32)
 PR_FormatTimeUSEnglish( char* buf, PRUint32 bufSize,
-                        const char* format, const PRExplodedTime* time );
+                        const char* format, const PRExplodedTime* tm );
 
 #endif /* NO_NSPR_10_SUPPORT */
 
 PR_END_EXTERN_C
 
 #endif /* prtime_h___ */
--- a/pr/src/io/prmwait.c
+++ b/pr/src/io/prmwait.c
@@ -1055,65 +1055,63 @@ PR_IMPLEMENT(PRStatus) PR_CancelWaitFile
     }
 
     PR_Lock(group->ml);
 
     if (_prmw_running != group->state)
     {
         PR_SetError(PR_INVALID_STATE_ERROR, 0);
         rv = PR_FAILURE;
-        goto stopping;
+        goto unlock;
     }
 
 #ifdef WINNT
     if (InterlockedCompareExchange((PVOID *)&desc->outcome,
         (PVOID)PR_MW_INTERRUPT, (PVOID)PR_MW_PENDING) == (PVOID)PR_MW_PENDING)
     {
         PRFileDesc *bottom = PR_GetIdentitiesLayer(desc->fd, PR_NSPR_IO_LAYER);
         PR_ASSERT(NULL != bottom);
         if (NULL == bottom)
         {
             PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
-            goto invalid_arg;
+            goto unlock;
         }
         bottom->secret->state = _PR_FILEDESC_CLOSED;
 #if 0
         fprintf(stderr, "cancel wait recv: closing socket\n");
 #endif
         if (closesocket(bottom->secret->md.osfd) == SOCKET_ERROR)
         {
             fprintf(stderr, "closesocket failed: %d\n", WSAGetLastError());
             exit(1);
         }
     }
 #else
     if (NULL != (recv_wait = _MW_LookupInternal(group, desc->fd)))
     {
         /* it was in the wait table */
         _MW_DoneInternal(group, recv_wait, PR_MW_INTERRUPT);
-        goto found;
+        goto unlock;
     }
     if (!PR_CLIST_IS_EMPTY(&group->io_ready))
     {
         /* is it already complete? */
         PRCList *head = PR_LIST_HEAD(&group->io_ready);
         do
         {
             PRRecvWait *done = (PRRecvWait*)head;
-            if (done == desc) goto found;
+            if (done == desc) goto unlock;
             head = PR_NEXT_LINK(head);
         } while (head != &group->io_ready);
     }
     PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
     rv = PR_FAILURE;
 
-found:
 #endif
-stopping:
-invalid_arg:
+unlock:
     PR_Unlock(group->ml);
     return rv;
 }  /* PR_CancelWaitFileDesc */
 
 PR_IMPLEMENT(PRRecvWait*) PR_CancelWaitGroup(PRWaitGroup *group)
 {
     PRRecvWait **desc;
     PRRecvWait *recv_wait = NULL;
--- a/pr/src/misc/pratom.c
+++ b/pr/src/misc/pratom.c
@@ -81,17 +81,16 @@ static PRUint32 atomic_hash_mask = DEFAU
 			((PRUint32) (((PRUptrdiff) (ptr) >> 2)	^	\
 						((PRUptrdiff) (ptr) >> 8)) &	\
 						atomic_hash_mask)
 
 void _PR_MD_INIT_ATOMIC()
 {
 char *eval;
 int index;
-PRIntn lock_count;
 
 
 	PR_ASSERT(PR_FloorLog2(MAX_ATOMIC_LOCKS) ==
 						PR_CeilingLog2(MAX_ATOMIC_LOCKS));
 
 	PR_ASSERT(PR_FloorLog2(DEFAULT_ATOMIC_LOCKS) ==
 							PR_CeilingLog2(DEFAULT_ATOMIC_LOCKS));
 
--- a/pr/src/pthreads/ptio.c
+++ b/pr/src/pthreads/ptio.c
@@ -714,17 +714,16 @@ static void pt_ContinuationThreadInterna
              * This may work out okay. The rule is that only this thread,
              * the continuation thread, can remove elements from the list.
              * Therefore, the list is at worst, longer than when we built
              * the polling list.
              */
 
             for (pollIndex = 0; pollIndex < pollingListUsed; ++pollIndex)
             {
-                PRIntn fd = pollingList[pollIndex].fd;
                 PRInt16 events = pollingList[pollIndex].events;
                 PRInt16 revents = pollingList[pollIndex].revents;
 
                 op = pollingOps[pollIndex];  /* this is the operation */
 
                 /* (ref: Bug #153459)
                 ** In case of POLLERR we let the operation retry in hope
                 ** of getting a more definitive OS error.
@@ -1213,18 +1212,16 @@ static PRBool pt_hpux_transmitfile_cont(
     }
 
     return PR_TRUE;
 }
 #endif  /* HPUX11 */
 
 void _PR_InitIO()
 {
-    PRIntn rv;
-
     pt_tq.ml = PR_NewLock();
     PR_ASSERT(NULL != pt_tq.ml);
 
 #if defined(DEBUG)
     memset(&pt_debug, 0, sizeof(PTDebug));
     pt_debug.timeStarted = PR_Now();
 #endif
 
@@ -2285,17 +2282,16 @@ static PRInt32 pt_AcceptRead(
         /* copy the new info out where caller can see it */
         PRPtrdiff aligned = (PRPtrdiff)buf + amount + sizeof(void*) - 1;
         *raddr = (PRNetAddr*)(aligned & ~(sizeof(void*) - 1));
         memcpy(*raddr, &remote, PR_NETADDR_SIZE(&remote));
         *nd = accepted;
         return rv;
     }
 
-failed:
     PR_Close(accepted);
     return rv;
 }  /* pt_AcceptRead */
 
 static PRStatus pt_GetSockName(PRFileDesc *fd, PRNetAddr *addr)
 {
     PRIntn rv = -1;
     pt_SockLen addr_len = sizeof(PRNetAddr);
--- a/pr/src/pthreads/ptthread.c
+++ b/pr/src/pthreads/ptthread.c
@@ -196,17 +196,16 @@ static void *_pt_root(void *arg)
     }
 
     return NULL;
 }  /* _pt_root */
 
 static PRThread* pt_AttachThread(void)
 {
     PRThread *thred = NULL;
-    void *privateData = NULL;
 
     /*
      * NSPR must have been initialized when PR_AttachThread is called.
      * We cannot have PR_AttachThread call implicit initialization
      * because if multiple threads call PR_AttachThread simultaneously,
      * NSPR may be initialized more than once.
      * We can't call any function that calls PR_GetCurrentThread()
      * either (e.g., PR_SetError()) as that will result in infinite
@@ -950,17 +949,19 @@ static sigset_t javagc_intsoff_sigmask;
 
 #else /* defined(_PR_DCETHREADS) */
 
 /* a bogus signal mask for forcing a timed wait */
 /* Not so bogus in AIX as we really do a sigwait */
 static sigset_t sigwait_set;
 
 static struct timespec onemillisec = {0, 1000000L};
+#ifndef PT_NO_SIGTIMEDWAIT
 static struct timespec hundredmillisec = {0, 100000000L};
+#endif
 
 static void suspend_signal_handler(PRIntn sig);
 
 #ifdef PT_NO_SIGTIMEDWAIT
 static void null_signal_handler(PRIntn sig);
 #endif
 
 #endif /* defined(_PR_DCETHREADS) */