debuggers.hg

changeset 21228:960ed5e75e64

libfsimage: zfs build fix for NetBSD

uchar_t is not defined because both FSYS_ZFS and FSIMAGE
are defined at build time.
Also fix warnings with ctype.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Apr 15 12:24:16 2010 +0100 (2010-04-15)
parents 9d5ecf79f1b5
children b90f92d0f06b
files tools/libfsimage/zfs/fsys_zfs.c tools/libfsimage/zfs/zfs_lzjb.c
line diff
     1.1 --- a/tools/libfsimage/zfs/fsys_zfs.c	Thu Apr 15 12:21:00 2010 +0100
     1.2 +++ b/tools/libfsimage/zfs/fsys_zfs.c	Thu Apr 15 12:24:16 2010 +0100
     1.3 @@ -80,8 +80,8 @@ static int zio_read_data(blkptr_t *bp, v
     1.4  static int
     1.5  zfs_bcmp(const void *s1, const void *s2, size_t n)
     1.6  {
     1.7 -	const uchar_t *ps1 = s1;
     1.8 -	const uchar_t *ps2 = s2;
     1.9 +	const uint8_t *ps1 = s1;
    1.10 +	const uint8_t *ps2 = s2;
    1.11  
    1.12  	if (s1 != s2 && n != 0) {
    1.13  		do {
    1.14 @@ -802,11 +802,11 @@ dnode_get_path(dnode_phys_t *mdn, char *
    1.15  	while (*path == '/')
    1.16  		path++;
    1.17  
    1.18 -	while (*path && !isspace(*path)) {
    1.19 +	while (*path && !isspace((uint8_t)*path)) {
    1.20  
    1.21  		/* get the next component name */
    1.22  		cname = path;
    1.23 -		while (*path && !isspace(*path) && *path != '/')
    1.24 +		while (*path && !isspace((uint8_t)*path) && *path != '/')
    1.25  			path++;
    1.26  		ch = *path;
    1.27  		*path = 0;   /* ensure null termination */
    1.28 @@ -914,23 +914,23 @@ get_objset_mdn(dnode_phys_t *mosmdn, cha
    1.29  	}
    1.30  
    1.31  	/* take out the pool name */
    1.32 -	while (*fsname && !isspace(*fsname) && *fsname != '/')
    1.33 +	while (*fsname && !isspace((uint8_t)*fsname) && *fsname != '/')
    1.34  		fsname++;
    1.35  
    1.36 -	while (*fsname && !isspace(*fsname)) {
    1.37 +	while (*fsname && !isspace((uint8_t)*fsname)) {
    1.38  		uint64_t childobj;
    1.39  
    1.40  		while (*fsname == '/')
    1.41  			fsname++;
    1.42  
    1.43  		cname = fsname;
    1.44 -		while (*fsname && !isspace(*fsname) && *fsname != '/')
    1.45 +		while (*fsname && !isspace((uint8_t)*fsname) && *fsname != '/')
    1.46  			fsname++;
    1.47  		ch = *fsname;
    1.48  		*fsname = 0;
    1.49  
    1.50  		snapname = cname;
    1.51 -		while (*snapname && !isspace(*snapname) && *snapname != '@')
    1.52 +		while (*snapname && !isspace((uint8_t)*snapname) && *snapname != '@')
    1.53  			snapname++;
    1.54  		if (*snapname == '@') {
    1.55  			issnapshot = 1;
     2.1 --- a/tools/libfsimage/zfs/zfs_lzjb.c	Thu Apr 15 12:21:00 2010 +0100
     2.2 +++ b/tools/libfsimage/zfs/zfs_lzjb.c	Thu Apr 15 12:24:16 2010 +0100
     2.3 @@ -34,10 +34,10 @@
     2.4  int
     2.5  lzjb_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len)
     2.6  {
     2.7 -	uchar_t *src = s_start;
     2.8 -	uchar_t *dst = d_start;
     2.9 -	uchar_t *d_end = (uchar_t *)d_start + d_len;
    2.10 -	uchar_t *cpy, copymap = '\0';
    2.11 +	uint8_t *src = s_start;
    2.12 +	uint8_t *dst = d_start;
    2.13 +	uint8_t *d_end = (uint8_t *)d_start + d_len;
    2.14 +	uint8_t *cpy, copymap = '\0';
    2.15  	int copymask = 1 << (NBBY - 1);
    2.16  
    2.17  	while (dst < d_end) {
    2.18 @@ -49,7 +49,7 @@ lzjb_decompress(void *s_start, void *d_s
    2.19  			int mlen = (src[0] >> (NBBY - MATCH_BITS)) + MATCH_MIN;
    2.20  			int offset = ((src[0] << NBBY) | src[1]) & OFFSET_MASK;
    2.21  			src += 2;
    2.22 -			if ((cpy = dst - offset) < (uchar_t *)d_start)
    2.23 +			if ((cpy = dst - offset) < (uint8_t *)d_start)
    2.24  				return (-1);
    2.25  			while (--mlen >= 0 && dst < d_end)
    2.26  				*dst++ = *cpy++;