]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Cleanup changes
authorOndrej Zajicek <santiago@crfreenet.org>
Tue, 31 Mar 2009 19:17:00 +0000 (21:17 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 31 Mar 2009 19:17:00 +0000 (21:17 +0200)
filter/trie.c
lib/bitops.c

index 7f9f5f88fa929c32303d6562e9d6298dd99f4727..ffb9b99fbd99415905a1982633bcbfb24603df51 100644 (file)
  * final node (if it is not in the trie) and we came to node that
  * is either extension of our prefix, or completely out of path
  * In the first case, we also have to check M2.
-
- * There also might be
- * a problem that interval of acceptance (on path from root to the
- * final node) might be completely missing (for example if we have
- * prefix patterns 192.168.128.0/24{8,10} and 192.168.1.0/24
  *
  * Second, we really need not to maintain two separate bitmasks.
  * Checks for mask M1 are always larger than &applen and we need
index 88cef78a5541b4cefeb7d226e3b4608d946ce7e9..b63274b8f1df30d917cd7f88f9ec1e467e7b3279 100644 (file)
@@ -52,12 +52,13 @@ u32_masklen(u32 x)
  *
  * This function computes a integral part of binary logarithm of given
  * integer @v and returns it. The computed value is also an index of the
- * first non-zero bit position.
+ * most significant non-zero bit position.
  */
 
 u32
 u32_log2(u32 v)
 {
+  /* The code from http://www-graphics.stanford.edu/~seander/bithacks.html */
   u32 r, shift;
   r =     (v > 0xFFFF) << 4; v >>= r;
   shift = (v > 0xFF  ) << 3; v >>= shift; r |= shift;
@@ -66,3 +67,4 @@ u32_log2(u32 v)
   r |= (v >> 1);
   return r;
 }
+