Module Name:    src
Committed By:   christos
Date:           Sun Aug 14 17:54:55 UTC 2011

Modified Files:
        src/usr.sbin/iopctl: Makefile iopctl.c

Log Message:
remove gcc type punned warnings


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/iopctl/Makefile
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/iopctl/iopctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/iopctl/Makefile
diff -u src/usr.sbin/iopctl/Makefile:1.2 src/usr.sbin/iopctl/Makefile:1.3
--- src/usr.sbin/iopctl/Makefile:1.2	Tue Jun 21 22:49:45 2011
+++ src/usr.sbin/iopctl/Makefile	Sun Aug 14 13:54:55 2011
@@ -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

Index: src/usr.sbin/iopctl/iopctl.c
diff -u src/usr.sbin/iopctl/iopctl.c:1.19 src/usr.sbin/iopctl/iopctl.c:1.20
--- src/usr.sbin/iopctl/iopctl.c:1.19	Wed Apr 15 04:40:59 2009
+++ src/usr.sbin/iopctl/iopctl.c	Sun Aug 14 13:54:55 2011
@@ -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

Reply via email to