From: David van Moolenbroek Date: Sat, 31 Aug 2013 20:59:44 +0000 (+0200) Subject: Fix various file system warnings X-Git-Tag: v3.3.0~620 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/CHANGES?a=commitdiff_plain;h=refs%2Fchanges%2F38%2F938%2F2;p=minix.git Fix various file system warnings Change-Id: Ied10498c3ae14f9f2fd06914f23239df330fa296 --- diff --git a/lib/libpuffs/link.c b/lib/libpuffs/link.c index 039e820b1..b3a41ae54 100644 --- a/lib/libpuffs/link.c +++ b/lib/libpuffs/link.c @@ -28,7 +28,7 @@ int fs_ftrunc(void) if (end == 0) { struct vattr va; - if (pn->pn_va.va_size == start) + if (pn->pn_va.va_size == (u_quad_t) start) return(OK); if (global_pu->pu_ops.puffs_node_setattr == NULL) @@ -160,8 +160,8 @@ int fs_rdlink() char path[PATH_MAX]; PUFFS_MAKECRED(pcr, &global_kcred); - copylen = fs_m_in.REQ_MEM_SIZE < UMAX_FILE_POS ? - fs_m_in.REQ_MEM_SIZE : UMAX_FILE_POS; + copylen = (size_t) fs_m_in.REQ_MEM_SIZE < UMAX_FILE_POS ? + (size_t) fs_m_in.REQ_MEM_SIZE : UMAX_FILE_POS; assert(copylen <= PATH_MAX); diff --git a/lib/libpuffs/null.c b/lib/libpuffs/null.c index 5e1924062..65f176600 100644 --- a/lib/libpuffs/null.c +++ b/lib/libpuffs/null.c @@ -74,8 +74,8 @@ processvattr(const char *path, const struct vattr *va, int regular) return errno; /* sloppy */ - if (va->va_atime.tv_sec != (unsigned)PUFFS_VNOVAL - || va->va_mtime.tv_sec != (unsigned)PUFFS_VNOVAL) { + if (va->va_atime.tv_sec != PUFFS_VNOVAL + || va->va_mtime.tv_sec != PUFFS_VNOVAL) { /* FIXME: nsec too */ tbuf.actime = va->va_atime.tv_sec; tbuf.modtime = va->va_mtime.tv_sec; @@ -493,7 +493,7 @@ puffs_null_node_readdir(struct puffs_usermount *pu, puffs_cookie_t opc, /* FIXME: DIRENT_SIZE macro? For now do calculations here */ int namelen; char* cp; - int dirent_size; + size_t dirent_size; entry = readdir(dp); diff --git a/lib/libpuffs/open.c b/lib/libpuffs/open.c index fd56bcdce..f1f7c2508 100644 --- a/lib/libpuffs/open.c +++ b/lib/libpuffs/open.c @@ -318,7 +318,7 @@ int fs_slink() if (r != OK) return(r); target[fs_m_in.REQ_MEM_SIZE] = '\0'; - if (strlen(target) != fs_m_in.REQ_MEM_SIZE) { + if (strlen(target) != (size_t) fs_m_in.REQ_MEM_SIZE) { /* This can happen if the user provides a buffer * with a \0 in it. This can cause a lot of trouble * when the symlink is used later. We could just use diff --git a/lib/libpuffs/puffs.c b/lib/libpuffs/puffs.c index d6690dec6..7bda9e1ca 100644 --- a/lib/libpuffs/puffs.c +++ b/lib/libpuffs/puffs.c @@ -169,7 +169,7 @@ fillvnopmask(struct puffs_ops *pops, uint8_t *opmask) /*ARGSUSED*/ -static void +__dead static void puffs_defaulterror(struct puffs_usermount *pu, uint8_t type, int error, const char *str, puffs_cookie_t cookie) { @@ -190,7 +190,8 @@ puffs_getstate(struct puffs_usermount *pu) void puffs_setstacksize(struct puffs_usermount *pu, size_t ss) { - long psize, minsize; + size_t minsize; + int psize; int stackshift; int bonus; diff --git a/lib/libpuffs/read.c b/lib/libpuffs/read.c index 707accdbe..f3de5ed51 100644 --- a/lib/libpuffs/read.c +++ b/lib/libpuffs/read.c @@ -76,7 +76,7 @@ int fs_readwrite(void) return(EINVAL); puffs_vattr_null(&va); - if ( (pos + bytes_left) > pn->pn_va.va_size) + if ((u_quad_t)(pos + bytes_left) > pn->pn_va.va_size) va.va_size = bytes_left + pos; va.va_ctime = va.va_mtime = clock_timespec(); va.va_atime = pn->pn_va.va_atime; diff --git a/servers/mfs/stadir.c b/servers/mfs/stadir.c index 85d55d2b1..6b21d2952 100644 --- a/servers/mfs/stadir.c +++ b/servers/mfs/stadir.c @@ -93,7 +93,7 @@ int fs_statvfs() struct statvfs st; struct super_block *sp; int r, scale; - uint64_t used; + u64_t used; sp = get_super(fs_dev);