Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jun 2023 22:38:52 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 27cebb4eac3d - main - newfs: nextnum should be a u_int32_t, not an int
Message-ID:  <202306282238.35SMcqq1015552@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=27cebb4eac3d03b81defa2785eae350f6caca2c7

commit 27cebb4eac3d03b81defa2785eae350f6caca2c7
Author:     Alfonso Gregory <gfunni234@gmail.com>
AuthorDate: 2023-06-28 22:20:33 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-06-28 22:26:06 +0000

    newfs: nextnum should be a u_int32_t, not an int
    
    The function that uses nextnum expects to return a u_int32_t, not a mere
    int, so let's make nextnum a u_int32_t instead.
    
    Note: retained current u_int32_t style, since the rest of the file uses
    it.
    
    Reviewed by: imp, mckusick
    Pull Request: https://github.com/freebsd/freebsd-src/pull/734
---
 sbin/newfs/mkfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index 28b02d250e17..85137c7881f9 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -1230,7 +1230,7 @@ ilog2(int val)
 static u_int32_t
 newfs_random(void)
 {
-	static int nextnum = 1;
+	static u_int32_t nextnum = 1;
 
 	if (Rflag)
 		return (nextnum++);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202306282238.35SMcqq1015552>