From nobody Sat Nov 30 16:51:43 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 4Y0x0J0qNnz5fJ8F; Sat, 30 Nov 2024 16:51:44 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y0x0H3HBpz4pDg; Sat, 30 Nov 2024 16:51:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732985503; 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=t8RArFrTC0MN/40EhGviWOakVOVqF5dOUURqRWlf1vs=; b=Aa+ftoYvRlnIs28luBHIeWQEN3At9VkdTqJamkQoYwJjQZmMaBQqEpDUOTPrRfU1cG18qK uNolom3qvhFZeAZ+4AcnVha0uKJNEXeu0bvD5VsJP8yq/7oox3i8sjcJvkwGy5NOn5f/ET gMOeGt/jgCrabFzPXWeqN58m9xt2MJyyqH6Bdob5h+Ft2CXuBN5y+RbaAxotWYDPnNHQOk oB211yLxAsVR+bYGBJRV6wVXwa4FyD9TOhQLQu+rMp4nY6XZSbdIgVYw8avSJzU1l4eub1 ZvNEfh/dtZspsDvHNaY6+jbgzcFwRd/87PLRlIQLBlDdrgkqF4+XAo4Jj8tK+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732985503; 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=t8RArFrTC0MN/40EhGviWOakVOVqF5dOUURqRWlf1vs=; b=NE9FC+BDuMxQC3sydKcTNdsTMQGMiiLuHjzVQ9rCv8j5CRyFWsQf/omzMmskf845sxFddv 2JuorUeu4H7ugOwsXalIbJ54E3uMYYEG4nYpR3YPLITjA63L841JyIU3TbzHZZJArfteKc 7V8TKDaTnZ93X2KoJayMnqc1I6GQmZJcrwE0PAGselzCkh4vZLGLseTXzIE3PRM/IwNPWb Rmvn1Jf5boVwzKUN1xm8Nh/N9ntHRtfDYhFYX6Q7VeM7sAl3OVvlre4YvcTN9fXWB7bIwV qPdOQv0tJ8BorBcy6KgFf0fKA8ronzGQik1MpAEC383YkGVqYizdZC3T5631Fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732985503; a=rsa-sha256; cv=none; b=cvt05jI7eOjPZggqDJGcOPVXRkp2gD9+FwfYyL7Fjso/WdLxaDaal+R60SH6Ad5nS7wC2C rrXNU9RERbwtuEL8EtIgZHP9DX9dWeHJfaeOuYBqjvRPCI7IXeHfzoa0JaqkWXpLWJFb81 fsfpNd1hp/TVJESZfpedMOOjPAL/OIzOBDTx5vJytpkF8TRYc11zPJEEqgo9tuXLOQcYaq UGU7iqc9HZ0p8cNoy7NckocTxcmjPnDAQ7w+IpmBoJ3PaFKAZeEigsBGidHuZVZyX7SAd/ XDn78N2YtqllxIlcvRNVn2DZ9B60VGHsBv2SC4QHnrcqxJeS4BK4kAVU3EzPMg== 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 4Y0x0H2p00zGNt; Sat, 30 Nov 2024 16:51:43 +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 4AUGphL1051764; Sat, 30 Nov 2024 16:51:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AUGphLg051761; Sat, 30 Nov 2024 16:51:43 GMT (envelope-from git) Date: Sat, 30 Nov 2024 16:51:43 GMT Message-Id: <202411301651.4AUGphLg051761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f9c59a50a327 - stable/13 - ministat: Consistently use item count as the first argument to calloc 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f9c59a50a327dbc74c37c3166dcd1beaafbed94b Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f9c59a50a327dbc74c37c3166dcd1beaafbed94b commit f9c59a50a327dbc74c37c3166dcd1beaafbed94b Author: John Baldwin AuthorDate: 2024-07-19 17:05:12 +0000 Commit: John Baldwin CommitDate: 2024-11-29 19:27:59 +0000 ministat: Consistently use item count as the first argument to calloc Reported by: GCC 14 -Wcalloc-transposed-args Reviewed by: rlibby, emaste Differential Revision: https://reviews.freebsd.org/D46011 (cherry picked from commit a971c60456223b22c0b3c557d712b36660dbcff9) --- usr.bin/ministat/ministat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/ministat/ministat.c b/usr.bin/ministat/ministat.c index 850c7408c272..b781ef37c50a 100644 --- a/usr.bin/ministat/ministat.c +++ b/usr.bin/ministat/ministat.c @@ -153,7 +153,7 @@ NewSet(void) ds = calloc(1, sizeof *ds); assert(ds != NULL); ds->lpoints = 100000; - ds->points = calloc(sizeof *ds->points, ds->lpoints); + ds->points = calloc(ds->lpoints, sizeof(*ds->points)); assert(ds->points != NULL); ds->syy = NAN; return(ds); @@ -167,7 +167,7 @@ AddPoint(struct dataset *ds, double a) if (ds->n >= ds->lpoints) { dp = ds->points; ds->lpoints *= 4; - ds->points = calloc(sizeof *ds->points, ds->lpoints); + ds->points = calloc(ds->lpoints, sizeof(*ds->points)); assert(ds->points != NULL); memcpy(ds->points, dp, sizeof *dp * ds->n); free(dp); @@ -356,7 +356,7 @@ PlotSet(struct dataset *ds, int val) bar = 0; if (pl->bar == NULL) { - pl->bar = calloc(sizeof(char *), pl->num_datasets); + pl->bar = calloc(pl->num_datasets, sizeof(char *)); assert(pl->bar != NULL); }