Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/iopctl remove gcc type punned warnings
details: https://anonhg.NetBSD.org/src/rev/ac6609c26710
branches: trunk
changeset: 768335:ac6609c26710
user: christos <christos%NetBSD.org@localhost>
date: Sun Aug 14 17:54:55 2011 +0000
description:
remove gcc type punned warnings
diffstat:
usr.sbin/iopctl/Makefile | 7 +------
usr.sbin/iopctl/iopctl.c | 12 ++++++------
2 files changed, 7 insertions(+), 12 deletions(-)
diffs (63 lines):
diff -r e6350a1986ed -r ac6609c26710 usr.sbin/iopctl/Makefile
--- a/usr.sbin/iopctl/Makefile Sun Aug 14 17:50:16 2011 +0000
+++ b/usr.sbin/iopctl/Makefile Sun Aug 14 17:54:55 2011 +0000
@@ -1,11 +1,6 @@
-# $NetBSD: Makefile,v 1.2 2011/06/22 02:49:45 mrg Exp $
+# $NetBSD: Makefile,v 1.3 2011/08/14 17:54:55 christos Exp $
PROG= iopctl
MAN= iopctl.8
.include <bsd.prog.mk>
-
-# XXX
-.if ${HAVE_GCC} == 45
-COPTS.iopctl.c+= -fno-strict-aliasing
-.endif
diff -r e6350a1986ed -r ac6609c26710 usr.sbin/iopctl/iopctl.c
--- a/usr.sbin/iopctl/iopctl.c Sun Aug 14 17:50:16 2011 +0000
+++ b/usr.sbin/iopctl/iopctl.c Sun Aug 14 17:54:55 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iopctl.c,v 1.19 2009/04/15 08:40:59 lukem Exp $ */
+/* $NetBSD: iopctl.c,v 1.20 2011/08/14 17:54:55 christos Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#ifndef lint
#include <sys/cdefs.h>
-__RCSID("$NetBSD: iopctl.c,v 1.19 2009/04/15 08:40:59 lukem Exp $");
+__RCSID("$NetBSD: iopctl.c,v 1.20 2011/08/14 17:54:55 christos Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -234,7 +234,7 @@
errx(EXIT_FAILURE, "I2O_UTIL_PARAMS_GET failed (FAIL)");
if (rf->reqstatus != 0)
errx(EXIT_FAILURE, "I2O_UTIL_PARAMS_GET failed (%d)",
- ((struct i2o_reply *)buf)->reqstatus);
+ rf->reqstatus);
}
void
@@ -343,6 +343,7 @@
char padding[128];
} __packed p;
char ident[128];
+ uint32_t serial[3];
getparam(gettid(argv), I2O_PARAM_DDM_IDENTITY, &p, sizeof(p));
@@ -352,9 +353,8 @@
i2ostrvis(p.di.revlevel, sizeof(p.di.revlevel), ident, sizeof(ident));
show("module revision", "%s", ident);
show("serial # format", "%d", p.di.snformat);
- show("serial #", "%08x%08x%08x", *(u_int32_t *)&p.di.serialnumber[0],
- *(u_int32_t *)&p.di.serialnumber[4],
- *(u_int32_t *)&p.di.serialnumber[8]);
+ memcpy(serial, &p.di.serialnumber, sizeof(serial));
+ show("serial #", "%08x%08x%08x", serial[0], serial[1], serial[2]);
}
void
Home |
Main Index |
Thread Index |
Old Index