Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc vax-specific lint fixes.
details: https://anonhg.NetBSD.org/src/rev/7cad6958cf08
branches: trunk
changeset: 778340:7cad6958cf08
user: christos <christos%NetBSD.org@localhost>
date: Thu Mar 22 17:32:21 2012 +0000
description:
vax-specific lint fixes.
diffstat:
lib/libc/arch/vax/gen/_lwp.c | 20 ++++++++++----------
lib/libc/arch/vax/gen/makecontext.c | 14 +++++++-------
lib/libc/rpc/xdr_float.c | 23 ++++++++++++-----------
3 files changed, 29 insertions(+), 28 deletions(-)
diffs (164 lines):
diff -r ca5cec0352db -r 7cad6958cf08 lib/libc/arch/vax/gen/_lwp.c
--- a/lib/libc/arch/vax/gen/_lwp.c Thu Mar 22 16:06:01 2012 +0000
+++ b/lib/libc/arch/vax/gen/_lwp.c Thu Mar 22 17:32:21 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: _lwp.c,v 1.2 2012/01/07 16:47:42 chs Exp $ */
+/* $NetBSD: _lwp.c,v 1.3 2012/03/22 17:32:22 christos Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _lwp.c,v 1.2 2012/01/07 16:47:42 chs Exp $");
+__RCSID("$NetBSD: _lwp.c,v 1.3 2012/03/22 17:32:22 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -68,20 +68,20 @@
sp[1] = 0x20000000; /* make this a CALLS frame */
sp[2] = 0; /* saved argument pointer */
sp[3] = 0; /* saved frame pointer */
- sp[4] = (intptr_t)_lwp_exit + 2;/* return via _lwp_exit */
+ sp[4] = (int)(uintptr_t)_lwp_exit + 2;/* return via _lwp_exit */
sp[5] = 1; /* argc */
- sp[6] = (intptr_t)arg; /* argv */
+ sp[6] = (int)(uintptr_t)arg; /* argv */
- gr[_REG_AP] = (__greg_t)(sp + 5);
- gr[_REG_SP] = (__greg_t)sp;
- gr[_REG_FP] = (__greg_t)sp;
- gr[_REG_PC] = (__greg_t)start + 2;
+ gr[_REG_AP] = (__greg_t)(uintptr_t)(sp + 5);
+ gr[_REG_SP] = (__greg_t)(uintptr_t)sp;
+ gr[_REG_FP] = (__greg_t)(uintptr_t)sp;
+ gr[_REG_PC] = (__greg_t)(uintptr_t)start + 2;
/*
* Push the TLS pointer onto the new stack also.
* The _UC_TLSBASE flag tells the kernel to pop it and use it.
*/
- *--sp = (intptr_t)private;
- gr[_REG_SP] = (__greg_t)sp;
+ *--sp = (int)(intptr_t)private;
+ gr[_REG_SP] = (__greg_t)(uintptr_t)sp;
u->uc_flags |= _UC_TLSBASE;
}
diff -r ca5cec0352db -r 7cad6958cf08 lib/libc/arch/vax/gen/makecontext.c
--- a/lib/libc/arch/vax/gen/makecontext.c Thu Mar 22 16:06:01 2012 +0000
+++ b/lib/libc/arch/vax/gen/makecontext.c Thu Mar 22 17:32:21 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: makecontext.c,v 1.3 2008/04/28 20:22:57 martin Exp $ */
+/* $NetBSD: makecontext.c,v 1.4 2012/03/22 17:32:22 christos Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: makecontext.c,v 1.3 2008/04/28 20:22:57 martin Exp $");
+__RCSID("$NetBSD: makecontext.c,v 1.4 2012/03/22 17:32:22 christos Exp $");
#endif
#include <stddef.h>
@@ -69,11 +69,11 @@
sp[1] = 0x20000000; /* make this a CALLS frame */
sp[2] = 0; /* saved argument pointer */
sp[3] = 0; /* saved frame pointer */
- sp[4] = (int)_resumecontext+2; /* return via trampoline code */
+ sp[4] = (int)(uintptr_t)_resumecontext+2;/* return via trampoline code */
- gr[_REG_AP] = (__greg_t)(sp + 5);
- gr[_REG_SP] = (__greg_t)sp;
- gr[_REG_FP] = (__greg_t)sp;
- gr[_REG_PC] = (__greg_t)func+2;
+ gr[_REG_AP] = (__greg_t)(uintptr_t)(sp + 5);
+ gr[_REG_SP] = (__greg_t)(uintptr_t)sp;
+ gr[_REG_FP] = (__greg_t)(uintptr_t)sp;
+ gr[_REG_PC] = (__greg_t)(uintptr_t)func+2;
}
diff -r ca5cec0352db -r 7cad6958cf08 lib/libc/rpc/xdr_float.c
--- a/lib/libc/rpc/xdr_float.c Thu Mar 22 16:06:01 2012 +0000
+++ b/lib/libc/rpc/xdr_float.c Thu Mar 22 17:32:21 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xdr_float.c,v 1.35 2009/02/14 06:26:42 lukem Exp $ */
+/* $NetBSD: xdr_float.c,v 1.36 2012/03/22 17:32:21 christos Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
static char *sccsid = "@(#)xdr_float.c 1.12 87/08/11 Copyr 1984 Sun Micro";
static char *sccsid = "@(#)xdr_float.c 2.1 88/07/29 4.0 RPCSRC";
#else
-__RCSID("$NetBSD: xdr_float.c,v 1.35 2009/02/14 06:26:42 lukem Exp $");
+__RCSID("$NetBSD: xdr_float.c,v 1.36 2012/03/22 17:32:21 christos Exp $");
#endif
#endif
@@ -125,7 +125,7 @@
#ifdef IEEEFP
return (XDR_PUTINT32(xdrs, (int32_t *)(void *)fp));
#else
- vs = *((struct vax_single *)fp);
+ vs = *((struct vax_single *)(void *)fp);
for (i = 0, lim = sgl_limits;
i < sizeof(sgl_limits)/sizeof(struct sgl_limits);
i++, lim++) {
@@ -147,7 +147,7 @@
#ifdef IEEEFP
return (XDR_GETINT32(xdrs, (int32_t *)(void *)fp));
#else
- vsp = (struct vax_single *)fp;
+ vsp = (struct vax_single *)(void *)fp;
if (!XDR_GETINT32(xdrs, (int32_t *)(void *)&is))
return (FALSE);
for (i = 0, lim = sgl_limits;
@@ -161,7 +161,7 @@
}
vsp->exp = is.exp - IEEE_SNG_BIAS + VAX_SNG_BIAS;
vsp->mantissa2 = is.mantissa;
- vsp->mantissa1 = (is.mantissa >> 16);
+ vsp->mantissa1 = ((unsigned int)is.mantissa >> 16);
doneit:
vsp->sign = is.sign;
return (TRUE);
@@ -245,7 +245,7 @@
#endif
return (rv);
#else
- vd = *((struct vax_double *)dp);
+ vd = *((struct vax_double *)(void *)dp);
for (i = 0, lim = dbl_limits;
i < sizeof(dbl_limits)/sizeof(struct dbl_limits);
i++, lim++) {
@@ -259,10 +259,11 @@
}
}
id.exp = vd.exp - VAX_DBL_BIAS + IEEE_DBL_BIAS;
- id.mantissa1 = (vd.mantissa1 << 13) | (vd.mantissa2 >> 3);
+ id.mantissa1 = (vd.mantissa1 << 13) |
+ ((unsigned int)vd.mantissa2 >> 3);
id.mantissa2 = ((vd.mantissa2 & MASK(3)) << 29) |
(vd.mantissa3 << 13) |
- ((vd.mantissa4 >> 3) & MASK(13));
+ (((unsigned int)vd.mantissa4 >> 3) & MASK(13));
shipit:
id.sign = vd.sign;
lp = (int32_t *)(void *)&id;
@@ -300,10 +301,10 @@
}
}
vd.exp = id.exp - IEEE_DBL_BIAS + VAX_DBL_BIAS;
- vd.mantissa1 = (id.mantissa1 >> 13);
+ vd.mantissa1 = ((unsigned int)id.mantissa1 >> 13);
vd.mantissa2 = ((id.mantissa1 & MASK(13)) << 3) |
- (id.mantissa2 >> 29);
- vd.mantissa3 = (id.mantissa2 >> 13);
+ ((unsigned int)id.mantissa2 >> 29);
+ vd.mantissa3 = ((unsigned int)id.mantissa2 >> 13);
vd.mantissa4 = (id.mantissa2 << 3);
doneit:
vd.sign = id.sign;
Home |
Main Index |
Thread Index |
Old Index