Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net fix typo in function name (rn_satsifies_leaf -> sati...



details:   https://anonhg.NetBSD.org/src/rev/e5985521688e
branches:  trunk
changeset: 500710:e5985521688e
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sun Dec 17 10:23:19 2000 +0000

description:
fix typo in function name (rn_satsifies_leaf -> satisfies).  indent.
split rn_inithead() into two function - i'm putting some hook around here.

diffstat:

 sys/net/radix.c |  26 ++++++++++++++++++--------
 sys/net/radix.h |   3 ++-
 2 files changed, 20 insertions(+), 9 deletions(-)

diffs (93 lines):

diff -r 787d7cd6240e -r e5985521688e sys/net/radix.c
--- a/sys/net/radix.c   Sun Dec 17 10:08:08 2000 +0000
+++ b/sys/net/radix.c   Sun Dec 17 10:23:19 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radix.c,v 1.14 2000/03/30 09:45:38 augustss Exp $      */
+/*     $NetBSD: radix.c,v 1.15 2000/12/17 10:23:19 itojun Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1993
@@ -63,7 +63,7 @@
 #undef Bcmp
 #define Bcmp(a, b, l) (l == 0 ? 0 : bcmp((caddr_t)(a), (caddr_t)(b), (u_long)l))
 
-static int rn_satsifies_leaf __P((char *, struct radix_node *, int));
+static int rn_satisfies_leaf __P((char *, struct radix_node *, int));
 static int rn_lexobetter __P((void *, void *));
 static struct radix_mask *rn_new_radix_mask __P((struct radix_node *,
     struct radix_mask *));
@@ -186,7 +186,7 @@
 }
 
 static int
-rn_satsifies_leaf(trial, leaf, skip)
+rn_satisfies_leaf(trial, leaf, skip)
        char *trial;
        struct radix_node *leaf;
        int skip;
@@ -274,7 +274,7 @@
                if (t->rn_flags & RNF_NORMAL) {
                        if (rn_b <= t->rn_b)
                                return t;
-               } else if (rn_satsifies_leaf(v, t, matched_off))
+               } else if (rn_satisfies_leaf(v, t, matched_off))
                                return t;
        t = saved_t;
        /* start searching up the tree */
@@ -298,10 +298,10 @@
                                        x = rn_search_m(v, t, m->rm_mask);
                                        while (x && x->rn_mask != m->rm_mask)
                                                x = x->rn_dupedkey;
-                                       if (x && rn_satsifies_leaf(v, x, off))
+                                       if (x && rn_satisfies_leaf(v, x, off))
                                                    return x;
                                }
-                       m = m->rm_mklist;
+                               m = m->rm_mklist;
                        } while (m);
                }
        } while (t != top);
@@ -865,14 +865,24 @@
        int off;
 {
        struct radix_node_head *rnh;
-       struct radix_node *t, *tt, *ttt;
+
        if (*head)
                return (1);
        R_Malloc(rnh, struct radix_node_head *, sizeof (*rnh));
        if (rnh == 0)
                return (0);
+       *head = rnh;
+       return rn_inithead0(rnh, off);
+}
+
+int
+rn_inithead0(rnh, off)
+       struct radix_node_head *rnh;
+       int off;
+{
+       struct radix_node *t, *tt, *ttt;
+
        Bzero(rnh, sizeof (*rnh));
-       *head = rnh;
        t = rn_newpair(rn_zeros, off, rnh->rnh_nodes);
        ttt = rnh->rnh_nodes + 2;
        t->rn_r = ttt;
diff -r 787d7cd6240e -r e5985521688e sys/net/radix.h
--- a/sys/net/radix.h   Sun Dec 17 10:08:08 2000 +0000
+++ b/sys/net/radix.h   Sun Dec 17 10:23:19 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radix.h,v 1.10 2000/11/06 11:07:37 itojun Exp $        */
+/*     $NetBSD: radix.h,v 1.11 2000/12/17 10:23:20 itojun Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1993
@@ -142,6 +142,7 @@
 
 void    rn_init __P((void));
 int     rn_inithead __P((void **, int));
+int     rn_inithead0 __P((struct radix_node_head *, int));
 int     rn_refines __P((void *, void *));
 int     rn_walktree __P((struct radix_node_head *,
                          int (*)(struct radix_node *, void *), void *));



Home | Main Index | Thread Index | Old Index