server/addrmap.c (hash): Visually tighten the arithmetic.
[tripe] / server / addrmap.c
index e1a9b0f..6091dbf 100644 (file)
@@ -72,13 +72,13 @@ void am_destroy(addrmap *m)
  * Returns:    The hash of the address.
  */
 
-uint32 hash(const addr *a)
+static uint32 hash(const addr *a)
 {
   switch (a->sa.sa_family) {
     case AF_INET:
-      return (U32((AF_INET * 0x4eaac1b7ul) +
-                 (a->sin.sin_addr.s_addr * 0xa5dbc837) +
-                 (a->sin.sin_port * 0x3b049e83)));
+      return (U32(0x4eaac1b7ul*AF_INET +
+                 0xa5dbc837ul*a->sin.sin_addr.s_addr +
+                 0x3b049e83ul*a->sin.sin_port));
     default:
       abort();
   }
@@ -91,7 +91,7 @@ uint32 hash(const addr *a)
  * Returns:    Nonzero if the addresses are equal.
  */
 
-int addreq(const addr *a, const addr *b)
+static int addreq(const addr *a, const addr *b)
 {
   if (a->sa.sa_family != b->sa.sa_family)
     return (0);