From nobody Thu Oct 13 08:24:19 2022 X-Original-To: dev-commits-src-main@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 4Mp2cM6nFRz4fQKY; Thu, 13 Oct 2022 08:24:19 +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 4Mp2cM6DTpz3qGM; Thu, 13 Oct 2022 08:24:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665649459; 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=ZLIGRW3cIT3cXzzthNGTx9b4wUQTFu85oA3xMvmAejg=; b=H2iTT0aEmUxIqXFh04/egpc8o/lzkFP+lrOGBhDQjEnpbf7rAG73wIhO8QUfAMrHwth7EQ iGEhwhTE7tTioW0wh4WvhFJ6WuYEjqMD2JD7WHaZzSZnPLmGBARh9RUif33vQks+whkDjQ hVpjaXL+4JmCHZ63DslXCahygHvRVGmKshZ+mUUo8gUQ2QDBAriCsvF+gmt8MzAAMltG5L zMgr4woTRz813IaTQusdfPYMwwSreka9M2WJrpDulrXBeB3PkBiY32MOCoQiaicRlOMglp 2UDywhsxMje4IUmESxDMxoa93W6Gs6oyIrwycu0aF+yUoMrnDnxtSMiJHdFtOg== 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 4Mp2cM5G93zMRR; Thu, 13 Oct 2022 08:24:19 +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 29D8OJ4o075586; Thu, 13 Oct 2022 08:24:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29D8OJ1f075585; Thu, 13 Oct 2022 08:24:19 GMT (envelope-from git) Date: Thu, 13 Oct 2022 08:24:19 GMT Message-Id: <202210130824.29D8OJ1f075585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: f02c78375736 - main - sort: use memset to initialize structure when possible List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f02c783757365340763739e58ef0e68ec13a0f8f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665649459; 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=ZLIGRW3cIT3cXzzthNGTx9b4wUQTFu85oA3xMvmAejg=; b=s9ZgCx0wGQgwvel9QPMrblFDHd+nmt55vTdFF3I6gPAEWFJ8K85TxPEMEtH4AX5E2uu5E6 PbB0VJ58K4OdmAU7VErk3AsIDqZKL0yxEchkh4fYAOrd4yXeu6lGdW9UmN4bf7VZzKYIFG SIhEboDgaPnNukdfJErfqYRyIdyLgKICOn4Uj+QyO5FWtGTFehGbunLkMEslIBFJDd8bwY YKs9fCJh0xmCYxa1Oqs6E+USPnRpEjrTp7Y6x6eKQFI3CJGxt1S+F7Vdfg2DqMdVa5XSYR 3LnlEib/NIB/lYq7Q7sw4iCu9pSwyBOR+Cy1SzmFhu5pEfzj8J5ZZapjIwaT3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665649459; a=rsa-sha256; cv=none; b=iwm7vP2DXUUOJJy7aSRoPAipOaJg/MePHcnbLcmmmLdR4ypNJdtRdVhQJLZuLazVV4eY9F RoVZuOxnh18L41WkdEmlufuKfX+WXENpV6uV11m+9z/hdYI+TNmNTuXLOloBbuap2iTzru 6GyCUyZn4o6y1kn0YjrZ7LcrX3EzkgH1+dFT/bEgFELIpdFVSLeY/LOJyTOJxTTnbr5kee owGVvxfwZ/pDjDz8sdXc0a1djJ/YKGPsncNQBAkiNFuwBPeSVdwu/3XYXREOz2W/Aza37/ aXqEU1MbrUEEq/TP8q3Ou0j4uHnsRZci5orFQtECMS8XIl8NFnmQ/HKrW9kEmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=f02c783757365340763739e58ef0e68ec13a0f8f commit f02c783757365340763739e58ef0e68ec13a0f8f Author: Baptiste Daroussin AuthorDate: 2022-10-13 07:07:46 +0000 Commit: Baptiste Daroussin CommitDate: 2022-10-13 08:24:11 +0000 sort: use memset to initialize structure when possible --- usr.bin/sort/file.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/usr.bin/sort/file.c b/usr.bin/sort/file.c index 3e5754442ac1..92371d7a15b2 100644 --- a/usr.bin/sort/file.c +++ b/usr.bin/sort/file.c @@ -216,9 +216,7 @@ file_list_init(struct file_list *fl, bool tmp) { if (fl) { - fl->count = 0; - fl->sz = 0; - fl->fns = NULL; + memset(fl, 0, sizeof(*fl)); fl->tmp = tmp; } } @@ -293,10 +291,8 @@ sort_list_init(struct sort_list *l) { if (l) { - l->count = 0; - l->size = 0; + memset(l, 0, sizeof(*l)); l->memsize = sizeof(struct sort_list); - l->list = NULL; } }