From nobody Sun Sep 15 06:31:24 2024 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 4X5yqc6JkWz5Wcgb; Sun, 15 Sep 2024 06:31:24 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X5yqc41Xtz4cvM; Sun, 15 Sep 2024 06:31:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726381884; 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=drmO+e9fcvK44HxkX1QED6gvqVoqZvwbWuL6f9ghRbQ=; b=f8oiNREBcpCoQuCgEJldVJ4bm7QQ+bse7Gm+W8lRVSR5zmOzx0g4wFoTdTfypCuCOCaEg6 +PGvuE2XzsqJnwgRp9TPkmgXlnkXEsNWzZh3xw0ME9jmxZiT1qbYuqY3YDNSYJJXnZkjqF J7eJ9zTN8PPkH31x5dj8eOmj9o4GCKo88vWUiWoj+YQNIOvYDW51XuccDyHLokCAypEzyx Bhkmfzb63a+AmMmdfMmRAOream+A3M82BZE/h0P9xTgIn/tZei4eLtwA8Im78hvaOa4SMU 3ULeree4aTasfhSIhGuq4WiDbMq/mheyCymS+62i+1300MDDmC0PHCiVOE+V+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726381884; a=rsa-sha256; cv=none; b=pHsbXjfoeeZCjEAi6dKMyob4qulLwtiOVuOgYLN6wAOs3TGnoYBeIy9bn1Oi4J0poOqXcg nsId+53kWzx56bo8pxt16oJcVFBRwgQwtaevz9SX409SV2VOtHQ8iiNmQ++OL9ejaeb7qx jZemfhlX7eKpysP+Y/Bj64dbCvx2lcocU+VTSdiWcIWjfnlbnBG0hnBoqCRq417i0dglfn TRJJfMVIslU5Qiz9U+abJ+Giw1zNv6V596tApod3lKB4tW3nV51cELzckGRBQqbZdpbxuf H63tCRN5MzTUAY760nAykbHUPMjt7fj02sFt1MESsJbykfTASgTpnmVbw2LeqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726381884; 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=drmO+e9fcvK44HxkX1QED6gvqVoqZvwbWuL6f9ghRbQ=; b=t9Y+HnlxzVLwuuMJIV1czMGGLD6rd3UpIr2jYmKJbUKX2h++sb/tHrxVLTPjQDhhk52eU9 HEsv97l8RswjfGrwhgkJQZPs/T/Iyi4Fzm27ocODqGhulcfyvGe0915VeQFyqvGd+Ee9II K6jQE8h7uknY2MByxeSHnbp6iUa2HwX+5P0p++czNUlBDKOJTlhlqOGlBRzNbCH8MUut24 DGKWcAcZhs5bihdX1kjwrLg5OerA9j8c/fViRcSxq/PxArHSlukrch1YF2bn4ufc9bh3dI JzcnX67MrVJ7+5aVjNdOXgwFX3ghzwGL3Lqqd2U5Rb8vDZUYFSzE+1bvf4XWuw== 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 4X5yqc3cg9z1038; Sun, 15 Sep 2024 06:31:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48F6VOIa072796; Sun, 15 Sep 2024 06:31:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48F6VOH0072793; Sun, 15 Sep 2024 06:31:24 GMT (envelope-from git) Date: Sun, 15 Sep 2024 06:31:24 GMT Message-Id: <202409150631.48F6VOH0072793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e3b777534bae - main - procstat(1): make rlimit_param[] size assertion automatic 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3b777534baeb69a1ee88d0b18c76a68eacdb34e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e3b777534baeb69a1ee88d0b18c76a68eacdb34e commit e3b777534baeb69a1ee88d0b18c76a68eacdb34e Author: Konstantin Belousov AuthorDate: 2024-09-14 13:15:20 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-15 06:30:13 +0000 procstat(1): make rlimit_param[] size assertion automatic Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46619 --- usr.bin/procstat/procstat_rlimit.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr.bin/procstat/procstat_rlimit.c b/usr.bin/procstat/procstat_rlimit.c index 1881f8ddbebf..3900ef7dcc14 100644 --- a/usr.bin/procstat/procstat_rlimit.c +++ b/usr.bin/procstat/procstat_rlimit.c @@ -47,7 +47,7 @@ static struct { const char *name; const char *suffix; -} rlimit_param[15] = { +} rlimit_param[] = { {"cputime", "sec"}, {"filesize", "B "}, {"datasize", "B "}, @@ -65,9 +65,8 @@ static struct { {"umtxp", " "}, }; -#if RLIM_NLIMITS > 15 -#error "Resource limits have grown. Add new entries to rlimit_param[]." -#endif +_Static_assert(nitems(rlimit_param) == RLIM_NLIMITS, + "Resource limits have grown. Add new entries to rlimit_param[]."); static const char * humanize_rlimit(int indx, rlim_t limit)