From nobody Fri Jul 19 17:07:48 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 4WQbhj0QwHz5Ryn4; Fri, 19 Jul 2024 17:07:49 +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 4WQbhh4cQSz59MX; Fri, 19 Jul 2024 17:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721408868; 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=v2UueTr1E0giCVeApgxMPYcRE3NYTuNu0Siv6Qq3SZU=; b=X6gpWjruNJ/1hlDcOA0eGvjZWhc7dGYHdDOm/0koIENEtfg2tkusrWGWOl3P6X/ctEKsSh 6To87oyH3jX/05rJsMFTta0P4DNrgtKQwFUu3rixyq/kHZmPV+S9YkE08m8v9VjLSfvriF Zr5IkxVTAwSv8SWQUOk6f4OWn09UMjCFjD8Qi7dbEkI4YObYHO3HZQSD4Hm8m/Oi5LDvSI gIWCJ7PUjyL1Z1PreT/LUxw7EICkLBbp86q9GBurJVpO7ajXqrQEhH5WWuorl7ablD8hU5 BbruLFU5EtnHUTr649IDnIDJnC9Y1lHm7Nl8VK5eQWJ1qQvIaXF5SZV2T2BnNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721408868; a=rsa-sha256; cv=none; b=ghWis5nMK/kHvVYREv/GUbIZ9eK7Iwp7npStAOJ8hYELtuqGGUMR+udAo5L77Qol5t8iKC U5jCoXch1Ox0CR8axbP1up1iksuKQUyEqgQtBR+lb/W8qOXm+1q6jYtsLBErxEXFhlrE51 yfA8ZO4GFqSJ6n0j5E7lQIJoxmtpSZcdWyEFxa8aAhgoBkhqe7Zk6g5TZ/ojEvrlRrl0Wp 81X80RoAQQ384Z95DRDqbV3xinzYFgwHG0s4csARJNErQk4YnkDfWtas0yzC4mvuj0uOGH JS19UFXclwA1vQQ8kFXlPucxg2v9HSV3Jz6t1zWHOscGoioo1iaGjt1WZl1WNA== 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=1721408868; 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=v2UueTr1E0giCVeApgxMPYcRE3NYTuNu0Siv6Qq3SZU=; b=ufDXFjB5w0U9OXwlmTgE5K6kv535lD2ybrFbZzYzJr77zmPDhaVFJ1oizHQwEnYSAfJWT7 1+e1AR0bIY59a70VETVKdj8OTb5DsFrca28tF5n358tDkZAQwE1AChBN2WLU8AqAMEbYcI I2ZRnklBKhQzfFv2e8W1ljW7gcQ4th74JCDZLB0DkoC+4J0Gty6aNiJr/CVqWPXWR+XQmr hhm5UAKafP9Wdw4dCkqFoE8Q/BMpffAB+D5fg/d6jDWLAyRnYAV/OAaJiz/txncui3Phxe yfGyJbppFF19XycHTy60CWe+nmwvtVo5SsAu+SNRB5GIiCLYv6r2imMIEgGdAw== 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 4WQbhh4CY7zgn6; Fri, 19 Jul 2024 17:07:48 +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 46JH7mgk028153; Fri, 19 Jul 2024 17:07:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46JH7mVw028150; Fri, 19 Jul 2024 17:07:48 GMT (envelope-from git) Date: Fri, 19 Jul 2024 17:07:48 GMT Message-Id: <202407191707.46JH7mVw028150@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: a971c6045622 - main - 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/main X-Git-Reftype: branch X-Git-Commit: a971c60456223b22c0b3c557d712b36660dbcff9 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a971c60456223b22c0b3c557d712b36660dbcff9 commit a971c60456223b22c0b3c557d712b36660dbcff9 Author: John Baldwin AuthorDate: 2024-07-19 17:05:12 +0000 Commit: John Baldwin CommitDate: 2024-07-19 17:06:38 +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 --- 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 6508ce3f2533..6967841a339f 100644 --- a/usr.bin/ministat/ministat.c +++ b/usr.bin/ministat/ministat.c @@ -152,7 +152,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); @@ -166,7 +166,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); @@ -355,7 +355,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); }