Remove some more warnings from rx
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Sat, 26 Sep 2009 17:04:06 +0000 (18:04 +0100)
committerDerrick Brashear <shadow|account-1000005@unknown>
Mon, 28 Sep 2009 08:36:20 +0000 (01:36 -0700)
The mtu variable in InitPeerParams is in the wrong place. It's only
required when the (never used) AFS_USERSPACE_IP_ADDR code is enabled.
Move the variable to the appropriate location, and indent the if and
endif directives in this section to try to make it clearer what the
control flow is (my brain hurt)

Remove the unused rx_pthread_n_event_wakeups variable

ANSIfy rxi_syscall - we can't prototype it yet, sadly.

Reviewed-on: http://gerrit.openafs.org/503
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/rx/rx_kcommon.c
src/rx/rx_pthread.c
src/rx/rx_user.c

index 00b7cce..d6f5be3 100644 (file)
@@ -409,10 +409,10 @@ rxi_InitPeerParams(struct rx_peer *pp)
     u_short rxmtu;
 
 #ifdef ADAPT_MTU
-    afs_int32 mtu;
-#ifndef AFS_SUN5_ENV
-#ifdef AFS_USERSPACE_IP_ADDR
+# ifndef AFS_SUN5_ENV
+#  ifdef AFS_USERSPACE_IP_ADDR
     afs_int32 i;
+    afs_int32 mtu;
 
     i = rxi_Findcbi(pp->host);
     if (i == -1) {
@@ -436,26 +436,26 @@ rxi_InitPeerParams(struct rx_peer *pp)
     } else {                   /* couldn't find the interface, so assume the worst */
        pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize);
     }
-#else /* AFS_USERSPACE_IP_ADDR */
+#  else /* AFS_USERSPACE_IP_ADDR */
     AFS_IFNET_T ifn;
 
-#if !defined(AFS_SGI62_ENV)
+#   if !defined(AFS_SGI62_ENV)
     if (numMyNetAddrs == 0)
        (void)rxi_GetIFInfo();
-#endif
+#   endif
 
     ifn = rxi_FindIfnet(pp->host, NULL);
     if (ifn) {
        pp->timeout.sec = 2;
        /* pp->timeout.usec = 0; */
        pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize);
-#ifdef IFF_POINTOPOINT
+#   ifdef IFF_POINTOPOINT
        if (ifnet_flags(ifn) & IFF_POINTOPOINT) {
            /* wish we knew the bit rate and the chunk size, sigh. */
            pp->timeout.sec = 4;
            pp->ifMTU = RX_PP_PACKET_SIZE;
        }
-#endif /* IFF_POINTOPOINT */
+#   endif /* IFF_POINTOPOINT */
        /* Diminish the packet size to one based on the MTU given by
         * the interface. */
        if (ifnet_mtu(ifn) > (RX_IPUDP_SIZE + RX_HEADER_SIZE)) {
@@ -468,8 +468,10 @@ rxi_InitPeerParams(struct rx_peer *pp)
        /* pp->timeout.usec = 0; */
        pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize);
     }
-#endif /* else AFS_USERSPACE_IP_ADDR */
-#else /* AFS_SUN5_ENV */
+#  endif /* else AFS_USERSPACE_IP_ADDR */
+# else /* AFS_SUN5_ENV */
+    afs_int32 mtu;
+
     mtu = rxi_FindIfMTU(pp->host);
 
     if (mtu <= 0) {
@@ -493,7 +495,7 @@ rxi_InitPeerParams(struct rx_peer *pp)
     } else {                   /* couldn't find the interface, so assume the worst */
        pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE,rx_MyMaxSendSize);
     }
-#endif /* AFS_SUN5_ENV */
+# endif /* AFS_SUN5_ENV */
 #else /* ADAPT_MTU */
     pp->rateFlag = 2;          /* start timing after two full packets */
     pp->timeout.sec = 2;
index 88e1c03..c3996ef 100644 (file)
 #include <rx/rx_pthread.h>
 #include <rx/rx_clock.h>
 
-/*
- * Number of times the event handling thread was signalled because a new
- * event was scheduled earlier than the lastest event.
- *
- * Protected by event_handler_mutex
- */
-static long rx_pthread_n_event_wakeups;
-
 /* Set rx_pthread_event_rescheduled if event_handler should just try
  * again instead of sleeping.
  *
index 36d3b1f..4f331e4 100644 (file)
@@ -9,6 +9,8 @@
 
 /* rx_user.c contains routines specific to the user space UNIX implementation of rx */
 
+/* rxi_syscall is currently not prototyped */
+
 #include <afsconfig.h>
 #include <afs/param.h>
 
@@ -459,9 +461,7 @@ fudge_netmask(afs_uint32 addr)
 
 #if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) 
 int
-rxi_syscall(a3, a4, a5)
-     afs_uint32 a3, a4;
-     void *a5;
+rxi_syscall(afs_uint32 a3, afs_uint32 a4, void *a5)
 {
     afs_uint32 rcode;
     void (*old) (int);