Avoid intermediate (void*) casts.

Replace aliased pointer magic with shift/mask arithmetic.
This commit is contained in:
martin 2003-08-10 15:17:55 +00:00
parent 7406b873ca
commit 965abb5c4c
2 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_machdep.c,v 1.13 2003/07/15 03:36:10 lukem Exp $ */
/* $NetBSD: svr4_32_machdep.c,v 1.14 2003/08/10 15:17:55 martin Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_machdep.c,v 1.13 2003/07/15 03:36:10 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_machdep.c,v 1.14 2003/08/10 15:17:55 martin Exp $");
#ifndef _LKM
#include "opt_ddb.h"
@ -632,8 +632,8 @@ svr4_32_trap(type, l)
tm = (u_quad_t) tv.tv_sec * 1000000000 +
(u_quad_t) tv.tv_usec * 1000;
tf->tf_out[0] = ((u_int32_t *)(void *) &tm)[0];
tf->tf_out[1] = ((u_int32_t *)(void *) &tm)[1];
tf->tf_out[0] = (tm >> 32) & 0x00000000ffffffffffUL;
tf->tf_out[1] = tm & 0x00000000ffffffffffUL;
}
break;
@ -662,8 +662,8 @@ svr4_32_trap(type, l)
tv.tv_usec -
spc->spc_runtime.tv_usec)
* 1000;
tf->tf_out[0] = ((u_int32_t *)(void *) &tm)[0];
tf->tf_out[1] = ((u_int32_t *)(void *) &tm)[1];
tf->tf_out[0] = (tm >> 32) & 0x00000000ffffffffffUL;
tf->tf_out[1] = tm & 0x00000000ffffffffffUL;
}
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_machdep.c,v 1.30 2003/07/15 03:36:10 lukem Exp $ */
/* $NetBSD: svr4_machdep.c,v 1.31 2003/08/10 15:17:55 martin Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_machdep.c,v 1.30 2003/07/15 03:36:10 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_machdep.c,v 1.31 2003/08/10 15:17:55 martin Exp $");
#ifndef _LKM
#include "opt_ddb.h"
@ -667,8 +667,8 @@ svr4_trap(type, l)
tm = (u_quad_t) tv.tv_sec * 1000000000 +
(u_quad_t) tv.tv_usec * 1000;
tf->tf_out[0] = ((u_int32_t *)(void *) &tm)[0];
tf->tf_out[1] = ((u_int32_t *)(void *) &tm)[1];
tf->tf_out[0] = (tm >> 32) & 0x00000000ffffffffffUL;
tf->tf_out[1] = tm & 0x00000000ffffffffffUL;
}
break;
@ -697,8 +697,8 @@ svr4_trap(type, l)
tv.tv_usec -
spc->spc_runtime.tv_usec)
* 1000;
tf->tf_out[0] = ((u_int32_t *)(void *) &tm)[0];
tf->tf_out[1] = ((u_int32_t *)(void *) &tm)[1];
tf->tf_out[0] = (tm >> 32) & 0x00000000ffffffffffUL;
tf->tf_out[1] = tm & 0x00000000ffffffffffUL;
}
break;