From owner-p4-projects@FreeBSD.ORG Tue May 27 10:18:42 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5092B1065677; Tue, 27 May 2008 10:18:42 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12A111065675 for ; Tue, 27 May 2008 10:18:42 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 014508FC12 for ; Tue, 27 May 2008 10:18:42 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m4RAIfFH070698 for ; Tue, 27 May 2008 10:18:41 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4RAIfXv070696 for perforce@freebsd.org; Tue, 27 May 2008 10:18:41 GMT (envelope-from piso@freebsd.org) Date: Tue, 27 May 2008 10:18:41 GMT Message-Id: <200805271018.m4RAIfXv070696@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 142380 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2008 10:18:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=142380 Change 142380 by piso@piso_ferret on 2008/05/27 10:17:55 -Style fixes -Safer variables initialization Affected files ... .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#30 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#30 (text+ko) ==== @@ -133,9 +133,10 @@ static int _attach_handler(struct proto_handler *p) { - struct proto_handler *b = NULL; + struct proto_handler *b; - LIBALIAS_WLOCK_ASSERT(); + LIBALIAS_WLOCK_ASSERT(); + b = NULL; LIST_FOREACH(b, &handler_chain, entries) { if ((b->pri == p->pri) && (b->dir == p->dir) && @@ -172,10 +173,11 @@ int LibAliasAttachHandlers(struct proto_handler *_p) { - int i, error = -1; + int i, error; LIBALIAS_WLOCK(); - for (i=0; 1; i++) { + error = -1; + for (i = 0; 1; i++) { if (*((int *)&_p[i]) == EOH) break; error = _attach_handler(&_p[i]); @@ -189,10 +191,11 @@ int LibAliasDetachHandlers(struct proto_handler *_p) { - int i, error = -1; + int i, error; LIBALIAS_WLOCK(); - for (i=0; 1; i++) { + error = -1; + for (i = 0; 1; i++) { if (*((int *)&_p[i]) == EOH) break; error = _detach_handler(&_p[i]); @@ -206,9 +209,10 @@ int detach_handler(struct proto_handler *_p) { - int error = -1; + int error; LIBALIAS_WLOCK(); + error = -1; error = _detach_handler(_p); LIBALIAS_WUNLOCK(); return (error); @@ -216,13 +220,13 @@ int find_handler(int8_t dir, int8_t proto, struct libalias *la, struct ip *pip, - struct alias_data *ad) + struct alias_data *ad) { struct proto_handler *p; - int error = ENOENT; + int error; LIBALIAS_RLOCK(); - + error = ENOENT; LIST_FOREACH(p, &handler_chain, entries) { if ((p->dir & dir) && (p->proto & proto)) if (p->fingerprint(la, pip, ad) == 0) { @@ -259,9 +263,11 @@ void * detach_dll(char *p) { - struct dll *b = NULL, *b_tmp; - void *error = NULL; + struct dll *b, *b_tmp; + void *error; + b = NULL; + error = NULL; SLIST_FOREACH_SAFE(b, &dll_chain, next, b_tmp) if (!strncmp(b->name, p, DLL_LEN)) { SLIST_REMOVE(&dll_chain, b, dll, next);