From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 04:45:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36561106566C; Wed, 25 Nov 2009 04:45:46 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 251A88FC08; Wed, 25 Nov 2009 04:45:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP4jjOu039525; Wed, 25 Nov 2009 04:45:45 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAP4jjQS039517; Wed, 25 Nov 2009 04:45:45 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <200911250445.nAP4jjQS039517@svn.freebsd.org> From: Garrett Wollman Date: Wed, 25 Nov 2009 04:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199784 - in head/lib/libc: gen rpc stdio yp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 04:45:46 -0000 Author: wollman Date: Wed Nov 25 04:45:45 2009 New Revision: 199784 URL: http://svn.freebsd.org/changeset/base/199784 Log: Eliminate more dead stores. Found by: Clang static analyzer MFC after: 7 days Modified: head/lib/libc/gen/getcap.c head/lib/libc/gen/getusershell.c head/lib/libc/gen/wordexp.c head/lib/libc/rpc/getnetconfig.c head/lib/libc/rpc/key_call.c head/lib/libc/stdio/fgetws.c head/lib/libc/yp/yplib.c Modified: head/lib/libc/gen/getcap.c ============================================================================== --- head/lib/libc/gen/getcap.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/gen/getcap.c Wed Nov 25 04:45:45 2009 (r199784) @@ -647,7 +647,7 @@ int cgetnext(char **bp, char **db_array) { size_t len; - int done, hadreaderr, i, savederrno, status; + int done, hadreaderr, savederrno, status; char *cp, *line, *rp, *np, buf[BSIZE], nbuf[BSIZE]; u_int dummy; @@ -658,7 +658,7 @@ cgetnext(char **bp, char **db_array) (void)cgetclose(); return (-1); } - for(;;) { + for (;;) { if (toprec && !gottoprec) { gottoprec = 1; line = toprec; @@ -709,7 +709,6 @@ cgetnext(char **bp, char **db_array) /* * Line points to a name line. */ - i = 0; done = 0; np = nbuf; for (;;) { Modified: head/lib/libc/gen/getusershell.c ============================================================================== --- head/lib/libc/gen/getusershell.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/gen/getusershell.c Wed Nov 25 04:45:45 2009 (r199784) @@ -124,7 +124,7 @@ _local_initshells(rv, cb_data, ap) if ((fp = fopen(_PATH_SHELLS, "r")) == NULL) return NS_UNAVAIL; - sp = cp = line; + cp = line; while (fgets(cp, MAXPATHLEN + 1, fp) != NULL) { while (*cp != '#' && *cp != '/' && *cp != '\0') cp++; Modified: head/lib/libc/gen/wordexp.c ============================================================================== --- head/lib/libc/gen/wordexp.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/gen/wordexp.c Wed Nov 25 04:45:45 2009 (r199784) @@ -320,7 +320,7 @@ we_check(const char *words, int flags) if (c == '\0' || level != 0) return (WRDE_SYNTAX); } else - c = *--words; + --words; break; default: break; Modified: head/lib/libc/rpc/getnetconfig.c ============================================================================== --- head/lib/libc/rpc/getnetconfig.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/rpc/getnetconfig.c Wed Nov 25 04:45:45 2009 (r199784) @@ -412,13 +412,13 @@ void *handlep; * Noone needs these entries anymore, then frees them. * Make sure all info in netconfig_info structure has been reinitialized. */ - q = p = ni.head; + q = ni.head; ni.eof = ni.ref = 0; ni.head = NULL; ni.tail = NULL; mutex_unlock(&ni_lock); - while (q) { + while (q != NULL) { p = q->next; if (q->ncp->nc_lookups != NULL) free(q->ncp->nc_lookups); free(q->ncp); Modified: head/lib/libc/rpc/key_call.c ============================================================================== --- head/lib/libc/rpc/key_call.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/rpc/key_call.c Wed Nov 25 04:45:45 2009 (r199784) @@ -302,7 +302,7 @@ int vers; void *localhandle; struct netconfig *nconf; struct netconfig *tpconf; - struct key_call_private *kcp = key_call_private_main; + struct key_call_private *kcp; struct timeval wait_time; struct utsname u; int main_thread; Modified: head/lib/libc/stdio/fgetws.c ============================================================================== --- head/lib/libc/stdio/fgetws.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/stdio/fgetws.c Wed Nov 25 04:45:45 2009 (r199784) @@ -89,7 +89,7 @@ fgetws(wchar_t * __restrict ws, int n, F if (!__mbsinit(&fp->_mbstate)) /* Incomplete character */ goto error; - *wsp++ = L'\0'; + *wsp = L'\0'; FUNLOCKFILE(fp); return (ws); Modified: head/lib/libc/yp/yplib.c ============================================================================== --- head/lib/libc/yp/yplib.c Wed Nov 25 04:35:54 2009 (r199783) +++ head/lib/libc/yp/yplib.c Wed Nov 25 04:45:45 2009 (r199784) @@ -241,7 +241,7 @@ static bool_t ypmatch_cache_lookup(struct dom_binding *ypdb, char *map, keydat *key, valdat *val) { - struct ypmatch_ent *c = ypdb->cache; + struct ypmatch_ent *c; ypmatch_cache_expire(ypdb);