From nobody Fri Apr 14 12:52:58 2023 X-Original-To: dev-commits-src-branches@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 4Pybvt54BKz45Bv9; Fri, 14 Apr 2023 12:52:58 +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 4Pybvt2D3Qz3rp7; Fri, 14 Apr 2023 12:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681476778; 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=K8C1lezXAyRk6IcrhbCjhTl5R3Syj4wFUN8CJ++eWyM=; b=l4VbYg9/OKHAomW6HtAudAJVCec/VH7N7Gyw1JMMNVQyQUMsd6ip9MvGV4O9ymb3zINLVV mdGXdZQ7rKPuRAtlIst1/sSPAJpLWwVOwsgl/FIUW/DnkptbnWowP37BQCCyb6TCb8hpMF wq9BeQ9d7vFlR8J/3GfqrVih/W+6YbvzeUM4jZDFCi8mfUi/nTx+wQmD+2IDDCgUOiy0or pdrT7WLT9ZQAJfJ+TEbGXN+aMKmb56+51HX/UKxFjUbVKb1JaBVMpp/uOT2TYQ5K37hT73 Lx1xwiLMX8Z28bb8JrHTfPAzy0xLt3nWe8QqCXJ83ADGporyn+xqe0QTCDjj2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681476778; 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=K8C1lezXAyRk6IcrhbCjhTl5R3Syj4wFUN8CJ++eWyM=; b=bzS3WiHJjVdEIHNExAj2VZh+114oZ9LxcRONy73Tj1P6+RN1FNObzqoU7SFJAq18yIniK7 plOjhLfcK6k2GUl1o7ReiHxc12xfzpVUZc/eQ3ObhpWV0/i+p0llLN1jNwEQd2b2OkoA2Q 741OeGE5T30WNceSuJJhC8Daf6D/IK4qAFa1QYFvaazC1LoKXkScqtG+mDhY6eicX/IukF VBFkYUv2H0Aj/uKbc+SYVHTxP0XECGmUvAQs34p8rWTWONmneKWrev+n1gxEWStGxKwHMc Atet4vIAsHA8G/d0UKqdoMLoooCSwCC30oEDQE3ILxzeAKhoShxAPFhadH5O4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681476778; a=rsa-sha256; cv=none; b=ptcULQpBgjXcd6aJjW+ijid8w25Q0VGe9UfgLuv8MhC8vZjQYvlEE4kt1N3Njk1e1oWql9 DSs5ZE8t0KeB6oLGJTKWN+705yXFZOFG++Vzp/7YWhnmxFdJ7uAgj83+OM/kxz/M2G1Pnt jL7izS7rgdhYqT6oA7nBXQRoEKRteDnGmMkn7HGVwJeNuKqJLfgN3H+umblaQNaCrX86O3 qdicMl/yksOHp7SKywGcr68w5fiW0DeIJpUFAfGyjx+zB86UMQaaAj3/5cu2b+fYA9j6n1 tfFqx6HgxvebZGSodtjH3QPp8uV6QzdOh6X4xJCtshjqhV8W7/Ly2NifaHnK0g== 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 4Pybvt0sklzPgW; Fri, 14 Apr 2023 12:52:58 +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 33ECqwAu074913; Fri, 14 Apr 2023 12:52:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33ECqw8f074912; Fri, 14 Apr 2023 12:52:58 GMT (envelope-from git) Date: Fri, 14 Apr 2023 12:52:58 GMT Message-Id: <202304141252.33ECqw8f074912@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: c821bafd9c8b - stable/13 - makefs: use size_t or ssize_t where appropriate List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c821bafd9c8bb03807823e4c0bdb062363f17869 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c821bafd9c8bb03807823e4c0bdb062363f17869 commit c821bafd9c8bb03807823e4c0bdb062363f17869 Author: Ed Maste AuthorDate: 2023-03-30 02:04:16 +0000 Commit: Ed Maste CommitDate: 2023-04-14 12:10:38 +0000 makefs: use size_t or ssize_t where appropriate Obtained from: NetBSD af7bc97830ac (cherry picked from commit 1d1ffa2efd2a54c435b7977dc1cfd21dce248671) --- usr.sbin/makefs/cd9660.c | 11 ++++++----- usr.sbin/makefs/cd9660.h | 4 ++-- usr.sbin/makefs/cd9660/cd9660_strings.c | 4 ++-- usr.sbin/makefs/ffs/buf.c | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 54c1794d1500..661eefc832da 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660.c,v 1.32 2011/08/23 17:09:11 christos Exp $ */ +/* $NetBSD: cd9660.c,v 1.56 2019/10/18 04:09:02 msaitoh Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause-NetBSD AND BSD-4-Clause @@ -115,7 +115,7 @@ __FBSDID("$FreeBSD$"); static void cd9660_finalize_PVD(iso9660_disk *); static cd9660node *cd9660_allocate_cd9660node(void); static void cd9660_set_defaults(iso9660_disk *); -static int cd9660_arguments_set_string(const char *, const char *, int, +static int cd9660_arguments_set_string(const char *, const char *, size_t, char, char *); static void cd9660_populate_iso_dir_record( struct _iso_directory_record_cd9660 *, u_char, u_char, u_char, @@ -324,10 +324,11 @@ cd9660_cleanup_opts(fsinfo_t *fsopts) } static int -cd9660_arguments_set_string(const char *val, const char *fieldtitle, int length, - char testmode, char * dest) +cd9660_arguments_set_string(const char *val, const char *fieldtitle, + size_t length, char testmode, char *dest) { - int len, test; + size_t len; + int test; if (val == NULL) warnx("error: '%s' requires a string argument", fieldtitle); diff --git a/usr.sbin/makefs/cd9660.h b/usr.sbin/makefs/cd9660.h index c4baa590101a..fae2d2077c00 100644 --- a/usr.sbin/makefs/cd9660.h +++ b/usr.sbin/makefs/cd9660.h @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660.h,v 1.17 2011/06/23 02:35:56 enami Exp $ */ +/* $NetBSD: cd9660.h,v 1.21 2015/12/24 15:52:37 christos Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause-NetBSD @@ -284,7 +284,7 @@ typedef struct _iso9660_disk { /************ FUNCTIONS **************/ int cd9660_valid_a_chars(const char *); int cd9660_valid_d_chars(const char *); -void cd9660_uppercase_characters(char *, int); +void cd9660_uppercase_characters(char *, size_t); /* ISO Data Types */ void cd9660_721(uint16_t, unsigned char *); diff --git a/usr.sbin/makefs/cd9660/cd9660_strings.c b/usr.sbin/makefs/cd9660/cd9660_strings.c index 12d7566e463d..da47084961bb 100644 --- a/usr.sbin/makefs/cd9660/cd9660_strings.c +++ b/usr.sbin/makefs/cd9660/cd9660_strings.c @@ -46,9 +46,9 @@ __FBSDID("$FreeBSD$"); void -cd9660_uppercase_characters(char *str, int len) +cd9660_uppercase_characters(char *str, size_t len) { - int p; + size_t p; for (p = 0; p < len; p++) { if (islower((unsigned char)str[p]) ) diff --git a/usr.sbin/makefs/ffs/buf.c b/usr.sbin/makefs/ffs/buf.c index c5f437d3a2cd..bc91df0b3ed3 100644 --- a/usr.sbin/makefs/ffs/buf.c +++ b/usr.sbin/makefs/ffs/buf.c @@ -78,7 +78,7 @@ bread(struct vnode *vp, daddr_t blkno, int size, struct ucred *u1 __unused, if (lseek((*bpp)->b_fs->fd, offset, SEEK_SET) == -1) err(1, "%s: lseek %lld (%lld)", __func__, (long long)(*bpp)->b_blkno, (long long)offset); - rv = read((*bpp)->b_fs->fd, (*bpp)->b_data, (*bpp)->b_bcount); + rv = read((*bpp)->b_fs->fd, (*bpp)->b_data, (size_t)(*bpp)->b_bcount); if (debug & DEBUG_BUF_BREAD) printf("%s: read %ld (%lld) returned %d\n", __func__, (*bpp)->b_bcount, (long long)offset, (int)rv); @@ -206,8 +206,8 @@ getblk(struct vnode *vp, daddr_t blkno, int size, int u1 __unused, } bp->b_bcount = size; if (bp->b_data == NULL || bp->b_bcount > bp->b_bufsize) { - n = erealloc(bp->b_data, size); - memset(n, 0, size); + n = erealloc(bp->b_data, (size_t)size); + memset(n, 0, (size_t)size); bp->b_data = n; bp->b_bufsize = size; }