From 5866121c7c05a606b390433d3fbd3edaa42cd012 Mon Sep 17 00:00:00 2001 From: pooka Date: Thu, 5 Nov 2009 13:28:18 +0000 Subject: [PATCH] more lp64 it's-a-sign! fixes --- usr.sbin/puffs/mount_psshfs/node.c | 9 +++++---- usr.sbin/puffs/mount_psshfs/psbuf.c | 12 ++++++------ usr.sbin/puffs/mount_psshfs/psshfs.h | 4 ++-- usr.sbin/puffs/mount_psshfs/subr.c | 13 +++++++------ usr.sbin/puffs/mount_sysctlfs/sysctlfs.c | 6 +++--- 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/usr.sbin/puffs/mount_psshfs/node.c b/usr.sbin/puffs/mount_psshfs/node.c index 789f26a96562..bd2b1c3cd1d2 100644 --- a/usr.sbin/puffs/mount_psshfs/node.c +++ b/usr.sbin/puffs/mount_psshfs/node.c @@ -1,4 +1,4 @@ -/* $NetBSD: node.c,v 1.58 2009/05/20 14:08:21 pooka Exp $ */ +/* $NetBSD: node.c,v 1.59 2009/11/05 13:28:18 pooka Exp $ */ /* * Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved. @@ -27,7 +27,7 @@ #include #ifndef lint -__RCSID("$NetBSD: node.c,v 1.58 2009/05/20 14:08:21 pooka Exp $"); +__RCSID("$NetBSD: node.c,v 1.59 2009/11/05 13:28:18 pooka Exp $"); #endif /* !lint */ #include @@ -332,7 +332,8 @@ psshfs_node_readdir(struct puffs_usermount *pu, puffs_cookie_t opc, struct puffs_node *pn = opc; struct psshfs_node *psn = pn->pn_data; struct psshfs_dir *pd; - int i, rv, set_readdir; + size_t i; + int rv, set_readdir; restart: if (psn->stat & PSN_READDIR) { @@ -580,7 +581,7 @@ psshfs_node_write(struct puffs_usermount *pu, puffs_cookie_t opc, uint8_t *buf, if (rv == 0) *resid = 0; - if (pn->pn_va.va_size < offset + writelen) + if (pn->pn_va.va_size < (uint64_t)offset + writelen) pn->pn_va.va_size = offset + writelen; out: diff --git a/usr.sbin/puffs/mount_psshfs/psbuf.c b/usr.sbin/puffs/mount_psshfs/psbuf.c index 758e0c8aeb04..21a8d08c5890 100644 --- a/usr.sbin/puffs/mount_psshfs/psbuf.c +++ b/usr.sbin/puffs/mount_psshfs/psbuf.c @@ -1,4 +1,4 @@ -/* $NetBSD: psbuf.c,v 1.14 2009/05/20 14:08:21 pooka Exp $ */ +/* $NetBSD: psbuf.c,v 1.15 2009/11/05 13:28:20 pooka Exp $ */ /* * Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved. @@ -27,7 +27,7 @@ #include #ifndef lint -__RCSID("$NetBSD: psbuf.c,v 1.14 2009/05/20 14:08:21 pooka Exp $"); +__RCSID("$NetBSD: psbuf.c,v 1.15 2009/11/05 13:28:20 pooka Exp $"); #endif /* !lint */ /* @@ -261,11 +261,11 @@ psbuf_put_vattr(struct puffs_framebuf *pb, const struct vattr *va) uint32_t flags; flags = 0; - if (va->va_size != PUFFS_VNOVAL) + if (va->va_size != (uint64_t)PUFFS_VNOVAL) flags |= SSH_FILEXFER_ATTR_SIZE; - if (va->va_uid != PUFFS_VNOVAL) + if (va->va_uid != (uid_t)PUFFS_VNOVAL) flags |= SSH_FILEXFER_ATTR_UIDGID; - if (va->va_mode != PUFFS_VNOVAL) + if (va->va_mode != (mode_t)PUFFS_VNOVAL) flags |= SSH_FILEXFER_ATTR_PERMISSIONS; if (va->va_atime.tv_sec != PUFFS_VNOVAL) @@ -418,7 +418,7 @@ static int emap[] = { EEXIST, /* FILE_ALREADY_EXISTS */ ENODEV /* WRITE_PROTECT */ }; -#define NERRORS (sizeof(emap) / sizeof(emap[0])) +#define NERRORS ((int)(sizeof(emap) / sizeof(emap[0]))) static int sftperr_to_errno(int error) diff --git a/usr.sbin/puffs/mount_psshfs/psshfs.h b/usr.sbin/puffs/mount_psshfs/psshfs.h index d4a9027db47d..3e2d94d0b787 100644 --- a/usr.sbin/puffs/mount_psshfs/psshfs.h +++ b/usr.sbin/puffs/mount_psshfs/psshfs.h @@ -1,4 +1,4 @@ -/* $NetBSD: psshfs.h,v 1.37 2009/05/20 14:08:21 pooka Exp $ */ +/* $NetBSD: psshfs.h,v 1.38 2009/11/05 13:28:20 pooka Exp $ */ /* * Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved. @@ -124,7 +124,7 @@ struct psshfs_node { int childcount; int stat; - int readcount; + unsigned readcount; time_t attrread; char *symlink; diff --git a/usr.sbin/puffs/mount_psshfs/subr.c b/usr.sbin/puffs/mount_psshfs/subr.c index 79b6f8b7187f..40568c283d50 100644 --- a/usr.sbin/puffs/mount_psshfs/subr.c +++ b/usr.sbin/puffs/mount_psshfs/subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr.c,v 1.46 2009/05/20 13:56:36 pooka Exp $ */ +/* $NetBSD: subr.c,v 1.47 2009/11/05 13:28:20 pooka Exp $ */ /* * Copyright (c) 2006 Antti Kantee. All Rights Reserved. @@ -27,7 +27,7 @@ #include #ifndef lint -__RCSID("$NetBSD: subr.c,v 1.46 2009/05/20 13:56:36 pooka Exp $"); +__RCSID("$NetBSD: subr.c,v 1.47 2009/11/05 13:28:20 pooka Exp $"); #endif /* !lint */ #include @@ -43,7 +43,7 @@ __RCSID("$NetBSD: subr.c,v 1.46 2009/05/20 13:56:36 pooka Exp $"); static void freedircache(struct psshfs_dir *base, size_t count) { - int i; + size_t i; for (i = 0; i < count; i++) { free(base[i].entryname); @@ -89,7 +89,7 @@ struct psshfs_dir * lookup(struct psshfs_dir *bdir, size_t ndir, const char *name) { struct psshfs_dir *test; - int i; + size_t i; for (i = 0; i < ndir; i++) { test = &bdir[i]; @@ -106,7 +106,7 @@ static struct psshfs_dir * lookup_by_entry(struct psshfs_dir *bdir, size_t ndir, struct puffs_node *entry) { struct psshfs_dir *test; - int i; + size_t i; for (i = 0; i < ndir; i++) { test = &bdir[i]; @@ -260,7 +260,8 @@ sftp_readdir(struct puffs_usermount *pu, struct psshfs_ctx *pctx, char *dhand = NULL; size_t nent; char *longname = NULL; - int idx, rv; + size_t idx; + int rv; assert(pn->pn_va.va_type == VDIR); idx = 0; diff --git a/usr.sbin/puffs/mount_sysctlfs/sysctlfs.c b/usr.sbin/puffs/mount_sysctlfs/sysctlfs.c index 4642d52906ff..4c5c09e8d525 100644 --- a/usr.sbin/puffs/mount_sysctlfs/sysctlfs.c +++ b/usr.sbin/puffs/mount_sysctlfs/sysctlfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysctlfs.c,v 1.11 2009/05/28 10:07:06 njoly Exp $ */ +/* $NetBSD: sysctlfs.c,v 1.12 2009/11/05 13:28:20 pooka Exp $ */ /* * Copyright (c) 2006, 2007 Antti Kantee. All Rights Reserved. @@ -33,7 +33,7 @@ #include #ifndef lint -__RCSID("$NetBSD: sysctlfs.c,v 1.11 2009/05/28 10:07:06 njoly Exp $"); +__RCSID("$NetBSD: sysctlfs.c,v 1.12 2009/11/05 13:28:20 pooka Exp $"); #endif /* !lint */ #include @@ -627,7 +627,7 @@ sysctlfs_node_read(struct puffs_usermount *pu, void *opc, uint8_t *buf, return EISDIR; doprint(sfs, &pn->pn_po, localbuf, sizeof(localbuf)); - if (strlen(localbuf) < offset) + if ((ssize_t)strlen(localbuf) < offset) xfer = 0; else xfer = MIN(*resid, strlen(localbuf) - offset);