From owner-svn-src-all@freebsd.org Mon Nov 28 06:36:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7DFFC580D8; Mon, 28 Nov 2016 06:36:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DB441BAA; Mon, 28 Nov 2016 06:36:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS6aAaf018130; Mon, 28 Nov 2016 06:36:10 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS6aAPC018128; Mon, 28 Nov 2016 06:36:10 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280636.uAS6aAPC018128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 06:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309233 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 06:36:11 -0000 Author: delphij Date: Mon Nov 28 06:36:10 2016 New Revision: 309233 URL: https://svnweb.freebsd.org/changeset/base/309233 Log: Eliminate variables that are computed, assigned but never used. MFC after: 2 weeks Modified: head/usr.bin/sort/bwstring.c head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/bwstring.c ============================================================================== --- head/usr.bin/sort/bwstring.c Mon Nov 28 06:32:05 2016 (r309232) +++ head/usr.bin/sort/bwstring.c Mon Nov 28 06:36:10 2016 (r309233) @@ -910,7 +910,6 @@ bws_month_score(const struct bwstring *s if (MB_CUR_MAX == 1) { const unsigned char *end, *s; - size_t len; s = s0->data.cstr; end = s + s0->len; @@ -918,8 +917,6 @@ bws_month_score(const struct bwstring *s while (isblank(*s) && s < end) ++s; - len = strlen((const char*)s); - for (int i = 11; i >= 0; --i) { if (cmonths[i] && (s == (unsigned char*)strstr((const char*)s, (char*)(cmonths[i])))) @@ -928,7 +925,6 @@ bws_month_score(const struct bwstring *s } else { const wchar_t *end, *s; - size_t len; s = s0->data.wstr; end = s + s0->len; @@ -936,8 +932,6 @@ bws_month_score(const struct bwstring *s while (iswblank(*s) && s < end) ++s; - len = wcslen(s); - for (int i = 11; i >= 0; --i) { if (wmonths[i] && (s == wcsstr(s, wmonths[i]))) return (i); Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Mon Nov 28 06:32:05 2016 (r309232) +++ head/usr.bin/sort/sort.c Mon Nov 28 06:36:10 2016 (r309233) @@ -209,14 +209,10 @@ sort_modifier_empty(struct sort_mods *sm static void usage(bool opt_err) { - struct option *o; FILE *out; - out = stdout; - o = &(long_options[0]); + out = opt_err ? stderr : stdout; - if (opt_err) - out = stderr; fprintf(out, getstr(12), getprogname()); if (opt_err) exit(2);