git: sys/vfs/hammer2: Fix -Wpointer-sign warnings on hammer2_dirhash()
Tomohiro Kusumi
tkusumi at crater.dragonflybsd.org
Thu Jan 26 23:24:06 PST 2023
commit 1d5238a4edac2ad536b2e07c77567161dfe5bbf9
Author: Tomohiro Kusumi <tkusumi at netbsd.org>
Date: Fri Jan 27 00:34:13 2023 -0800
sys/vfs/hammer2: Fix -Wpointer-sign warnings on hammer2_dirhash()
Warned on Linux user space.
Change hammer2_dirhash() and user space dirhash() to take
const char* instead of const unsigned char* for entry "name".
* hammer2_dirhash() callers always pass char* or const char*,
except for one in sbin/newfs_hammer2/mkfs_hammer2.c where filename[]
in ondisk inode (unterminated unsigned char array) is used.
* hammer2_dirhash() only compares name with ascii characters,
and passes substring to hammer2_icrc32() which takes const void*,
so it doesn't need to be unsigned.
* Also change hammer2_inode_create_pfs() (another function whose
callers only pass char* or const char* for PFS "name") to take
const char* instead of const uint8_t* so that hammer2_dirhash()
doesn't get warned after changes above.
Summary of changes:
sbin/fsck_hammer2/destroy.c | 6 ++----
sbin/hammer2/cmd_debug.c | 2 +-
sbin/hammer2/hammer2_subs.h | 2 +-
sbin/hammer2/subs.c | 3 +--
sbin/newfs_hammer2/mkfs_hammer2.c | 2 +-
sys/vfs/hammer2/hammer2.h | 4 ++--
sys/vfs/hammer2/hammer2_inode.c | 2 +-
sys/vfs/hammer2/hammer2_subr.c | 3 +--
8 files changed, 10 insertions(+), 14 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1d5238a4edac2ad536b2e07c77567161dfe5bbf9
--
DragonFly BSD source repository
More information about the Commits
mailing list