From nobody Tue Jun 20 21:04:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qlzdg4hBjz4ftWD; Tue, 20 Jun 2023 21:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qlzdg4FSvz421K; Tue, 20 Jun 2023 21:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687295047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OiLqvAZfWxdpzEd+fCFmZItFFDE2OsR7Sm/6W9lcIsc=; b=W+fXD3dQ4JFwWrolhnc3gKhRHktWxRjlKgRireOmhDp4B2tnROdwj9h78vjChJy8NgFWGp 5jCGg/zRsG4fnIuq4860XTq0O8bzAAaXT/Vn3XoGiuMBbPIfX2vfM00+8TS0fIwL2SX3sK Q70pvgCHeAtgUQR0tqAZsPqg30pgBPhp78bH5p3hb1iURvsddSvuIkXVr/+rbuhKm6NIdm cJPn1JoKAor3awxMVg+jjO8z2gMFt7xy/ma0WdUpuugJ6LbAvZBXKrCW9EBP0TxtLl/wQk m7YWmSneuUT6YZfvcj1fQiX5Wd4xy1vhjoh5OqKi/5F41avHgzvWmfOjHOkPKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687295047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OiLqvAZfWxdpzEd+fCFmZItFFDE2OsR7Sm/6W9lcIsc=; b=upDw4xNLw8f4SZUvd9jHwNiaik0yl1cZqIkzvRHMhXrlInrkBlMRhw84Lp08UacXZeYS/j mlqTrFiTYwpG8PfqxQDfR5KGJYUYgbnDJqMDOdQCyaJtazXRoxdN9VDlEcfHX2lF0rMGMh yoEF0HCfMT+4EndTwoHzLIIDF/OvlapPLyneSBx2i00vOAq34PwFc+4WzXhL4cBAh9Rzhd 1K1LiRBQNKIRIJcs817ozneyOYgH61lv7/Y3NEcBnZEL4oVi3mbmztFPRRJ+iv9Itap5cA Gjc5DrjBwdgi2PyUs5OECdJo7JLMo+Io3qFejIdzc/5UDGcHutHPyRzxZxDE4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687295047; a=rsa-sha256; cv=none; b=kx8P8/ufHWwxRy1MZTvELw6SeCaYR07KGF07dVDv0lINrVarGnObCo+dyNiq9N+bBr87Wz 4PAdhqGEmi86B7gHTDJzaV+K/up4Y4ai9IqqLRaPmzK9GB8D/gDQoKy66Mhjl/nwDV4KNP EzctfmFvoBSDyyV4o1GPwcEml8XH4V1kEl/XZUnHdZQS2+Ysb2vYwmLFeUHaZvUeEMHYZB 8sgvMAqtVuQeEUH6YOco37CEAultMdIHYdS6LB6DE5A9w9yyjNwDdcAI5yfBdyUfq16KNX sD+t8yRydm8fUbx6ELBTPMOyyNFC5CWd+7pl+9CWBLFmlY1AsFVgp16RXdAzAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qlzdg3J4hzF6q; Tue, 20 Jun 2023 21:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35KL476t007222; Tue, 20 Jun 2023 21:04:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35KL47a4007221; Tue, 20 Jun 2023 21:04:07 GMT (envelope-from git) Date: Tue, 20 Jun 2023 21:04:07 GMT Message-Id: <202306202104.35KL47a4007221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 4a0b57b0b4cb - main - fifolog: Trim some dead code and unused variables. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a0b57b0b4cbf7eb848927cf3f493163c3e76142 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4a0b57b0b4cbf7eb848927cf3f493163c3e76142 commit 4a0b57b0b4cbf7eb848927cf3f493163c3e76142 Author: John Baldwin AuthorDate: 2023-06-20 21:03:35 +0000 Commit: John Baldwin CommitDate: 2023-06-20 21:03:35 +0000 fifolog: Trim some dead code and unused variables. The gmt_ptr and gmt variables are not used, so the call to gmtime can be removed entirely. In addition, there isn't a need to call localtime twice. Reported by: GCC -Wunused-but-set-variable Reviewed by: phk, emaste Differential Revision: https://reviews.freebsd.org/D40656 --- usr.sbin/fifolog/lib/getdate.y | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/usr.sbin/fifolog/lib/getdate.y b/usr.sbin/fifolog/lib/getdate.y index 8e63e8112993..57f3cb1d46fb 100644 --- a/usr.sbin/fifolog/lib/getdate.y +++ b/usr.sbin/fifolog/lib/getdate.y @@ -818,30 +818,18 @@ yylex(void) time_t get_date(char *p) { - struct tm *tm, gmt; + struct tm *tm; time_t Start; time_t tod; time_t nowtime; - struct tm *gmt_ptr; yyInput = p; (void)time (&nowtime); - gmt_ptr = gmtime (&nowtime); - if (gmt_ptr != NULL) - { - /* Make a copy, in case localtime modifies *tm (I think - that comment now applies to *gmt_ptr, but I am too - lazy to dig into how gmtime and locatime allocate the - structures they return pointers to). */ - gmt = *gmt_ptr; - } - if (! (tm = localtime (&nowtime))) return -1; - tm = localtime(&nowtime); yyYear = tm->tm_year + 1900; yyMonth = tm->tm_mon + 1; yyDay = tm->tm_mday;