]> xenbits.xensource.com Git - xen.git/commitdiff
libfsimage: zfs build fix for NetBSD
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 15 Apr 2010 11:24:16 +0000 (12:24 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 15 Apr 2010 11:24:16 +0000 (12:24 +0100)
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>
tools/libfsimage/zfs/fsys_zfs.c
tools/libfsimage/zfs/zfs_lzjb.c

index 6b4b1830877fcf357f1da401bd97fdbfe8fce8ae..863232b18846354dcae3713d1547973903451c2a 100644 (file)
@@ -80,8 +80,8 @@ static int zio_read_data(blkptr_t *bp, void *buf, char *stack);
 static int
 zfs_bcmp(const void *s1, const void *s2, size_t n)
 {
-       const uchar_t *ps1 = s1;
-       const uchar_t *ps2 = s2;
+       const uint8_t *ps1 = s1;
+       const uint8_t *ps2 = s2;
 
        if (s1 != s2 && n != 0) {
                do {
@@ -802,11 +802,11 @@ dnode_get_path(dnode_phys_t *mdn, char *path, dnode_phys_t *dn,
        while (*path == '/')
                path++;
 
-       while (*path && !isspace(*path)) {
+       while (*path && !isspace((uint8_t)*path)) {
 
                /* get the next component name */
                cname = path;
-               while (*path && !isspace(*path) && *path != '/')
+               while (*path && !isspace((uint8_t)*path) && *path != '/')
                        path++;
                ch = *path;
                *path = 0;   /* ensure null termination */
@@ -914,23 +914,23 @@ get_objset_mdn(dnode_phys_t *mosmdn, char *fsname, uint64_t *obj,
        }
 
        /* take out the pool name */
-       while (*fsname && !isspace(*fsname) && *fsname != '/')
+       while (*fsname && !isspace((uint8_t)*fsname) && *fsname != '/')
                fsname++;
 
-       while (*fsname && !isspace(*fsname)) {
+       while (*fsname && !isspace((uint8_t)*fsname)) {
                uint64_t childobj;
 
                while (*fsname == '/')
                        fsname++;
 
                cname = fsname;
-               while (*fsname && !isspace(*fsname) && *fsname != '/')
+               while (*fsname && !isspace((uint8_t)*fsname) && *fsname != '/')
                        fsname++;
                ch = *fsname;
                *fsname = 0;
 
                snapname = cname;
-               while (*snapname && !isspace(*snapname) && *snapname != '@')
+               while (*snapname && !isspace((uint8_t)*snapname) && *snapname != '@')
                        snapname++;
                if (*snapname == '@') {
                        issnapshot = 1;
index ee41f8e4023f9a3b875bdcc1c5a6164a7a1c035a..c617362de3c200d4b0296f3c40be54f0a2f6a529 100644 (file)
 int
 lzjb_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len)
 {
-       uchar_t *src = s_start;
-       uchar_t *dst = d_start;
-       uchar_t *d_end = (uchar_t *)d_start + d_len;
-       uchar_t *cpy, copymap = '\0';
+       uint8_t *src = s_start;
+       uint8_t *dst = d_start;
+       uint8_t *d_end = (uint8_t *)d_start + d_len;
+       uint8_t *cpy, copymap = '\0';
        int copymask = 1 << (NBBY - 1);
 
        while (dst < d_end) {
@@ -49,7 +49,7 @@ lzjb_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len)
                        int mlen = (src[0] >> (NBBY - MATCH_BITS)) + MATCH_MIN;
                        int offset = ((src[0] << NBBY) | src[1]) & OFFSET_MASK;
                        src += 2;
-                       if ((cpy = dst - offset) < (uchar_t *)d_start)
+                       if ((cpy = dst - offset) < (uint8_t *)d_start)
                                return (-1);
                        while (--mlen >= 0 && dst < d_end)
                                *dst++ = *cpy++;