Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/irix Use uintptr_t instead of int when munging fc...
details: https://anonhg.NetBSD.org/src/rev/8851aded9497
branches: trunk
changeset: 747059:8851aded9497
user: dholland <dholland%NetBSD.org@localhost>
date: Mon Aug 31 05:34:16 2009 +0000
description:
Use uintptr_t instead of int when munging fcntl flags, which are
pointer-sized integers. Now builds in a 64-bit world, might even work :-)
diffstat:
sys/compat/irix/irix_fcntl.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diffs (72 lines):
diff -r c78c91297f0a -r 8851aded9497 sys/compat/irix/irix_fcntl.c
--- a/sys/compat/irix/irix_fcntl.c Mon Aug 31 03:39:00 2009 +0000
+++ b/sys/compat/irix/irix_fcntl.c Mon Aug 31 05:34:16 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: irix_fcntl.c,v 1.26 2009/06/28 09:50:57 tsutsui Exp $ */
+/* $NetBSD: irix_fcntl.c,v 1.27 2009/08/31 05:34:16 dholland Exp $ */
/*-
* Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.26 2009/06/28 09:50:57 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.27 2009/08/31 05:34:16 dholland Exp $");
#include <sys/types.h>
#include <sys/signal.h>
@@ -62,8 +62,8 @@
#include <compat/svr4/svr4_syscallargs.h>
static int fd_truncate(struct lwp *, int, int, off_t, register_t *);
-static int bsd_to_irix_fcntl_flags(int);
-static int irix_to_bsd_fcntl_flags(int);
+static uintptr_t bsd_to_irix_fcntl_flags(uintptr_t);
+static uintptr_t irix_to_bsd_fcntl_flags(uintptr_t);
int
irix_sys_lseek64(struct lwp *l, const struct irix_sys_lseek64_args *uap, register_t *retval)
@@ -161,12 +161,12 @@
* All unsupported flags are silently ignored
* except FDIRECT taht will return EINVAL
*/
- if ((int)SCARG(uap, arg) & IRIX_FDIRECT)
+ if ((uintptr_t)SCARG(uap, arg) & IRIX_FDIRECT)
return EINVAL;
SCARG(&bsd_ua, fd) = SCARG(uap, fd);
SCARG(&bsd_ua, arg) =
- (char *)irix_to_bsd_fcntl_flags((int)SCARG(uap, arg));
+ (char *)irix_to_bsd_fcntl_flags((uintptr_t)SCARG(uap, arg));
SCARG(&bsd_ua, cmd) = F_SETFL;
return sys_fcntl(l, &bsd_ua, retval);
break;
@@ -329,10 +329,10 @@
return 0;
}
-static int
-irix_to_bsd_fcntl_flags(int flags)
+static uintptr_t
+irix_to_bsd_fcntl_flags(uintptr_t flags)
{
- int ret = 0;
+ uintptr_t ret = 0;
if (flags & IRIX_FNDELAY) ret |= FNDELAY;
if (flags & IRIX_FAPPEND) ret |= FAPPEND;
@@ -355,10 +355,10 @@
return ret;
}
-static int
-bsd_to_irix_fcntl_flags(int flags)
+static uintptr_t
+bsd_to_irix_fcntl_flags(uintptr_t flags)
{
- int ret = 0;
+ uintptr_t ret = 0;
if (flags & FNDELAY) ret |= IRIX_FNDELAY;
if (flags & FAPPEND) ret |= IRIX_FAPPEND;
Home |
Main Index |
Thread Index |
Old Index