Module Name:    src
Committed By:   christos
Date:           Sun Aug 14 17:57:44 UTC 2011

Modified Files:
        src/usr.sbin/mlxctl: Makefile cmds.c

Log Message:
avoid type punned warnings


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/mlxctl/Makefile
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/mlxctl/cmds.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/mlxctl/Makefile
diff -u src/usr.sbin/mlxctl/Makefile:1.2 src/usr.sbin/mlxctl/Makefile:1.3
--- src/usr.sbin/mlxctl/Makefile:1.2	Tue Jun 21 22:49:45 2011
+++ src/usr.sbin/mlxctl/Makefile	Sun Aug 14 13:57:44 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2011/06/22 02:49:45 mrg Exp $
+#	$NetBSD: Makefile,v 1.3 2011/08/14 17:57:44 christos Exp $
 
 PROG=	mlxctl
 SRCS=	cmds.c config.c dklist.c main.c util.c
@@ -8,9 +8,3 @@
 DPADD=	${LIBKVM}
 
 .include <bsd.prog.mk>
-
-# XXX
-.if ${HAVE_GCC} == 45
-COPTS.mlxctl.c+=	-fno-strict-aliasing
-COPTS.cmds.c+=	-fno-strict-aliasing
-.endif

Index: src/usr.sbin/mlxctl/cmds.c
diff -u src/usr.sbin/mlxctl/cmds.c:1.12 src/usr.sbin/mlxctl/cmds.c:1.13
--- src/usr.sbin/mlxctl/cmds.c:1.12	Fri Apr 17 00:03:39 2009
+++ src/usr.sbin/mlxctl/cmds.c	Sun Aug 14 13:57:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmds.c,v 1.12 2009/04/17 04:03:39 lukem Exp $	*/
+/*	$NetBSD: cmds.c,v 1.13 2011/08/14 17:57:44 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
 
 #ifndef lint
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: cmds.c,v 1.12 2009/04/17 04:03:39 lukem Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.13 2011/08/14 17:57:44 christos Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -210,12 +210,14 @@
 	printf("\n");
 
 	if (verbosity > 0 && ci.ci_iftype > 1) {
+		uint32_t hid, sid;
+
 		mlx_enquiry(&enq);
+		memcpy(&hid, enq.me_hardware_id, sizeof(hid));
+		memcpy(&sid, enq.me_firmware_id, sizeof(sid));
 
-		printf("  Hardware ID\t\t\t0x%08x\n",
-		    le32toh(*(u_int32_t *)enq.me_hardware_id));
-		printf("  Firmware ID\t\t\t0x%08x\n",
-		    le32toh(*(u_int32_t *)enq.me_firmware_id));
+		printf("  Hardware ID\t\t\t0x%08x\n", le32toh(hid));
+		printf("  Firmware ID\t\t\t0x%08x\n", le32toh(sid));
 		printf("  Configured/Actual channels\t%d/%d\n",
 		    enq.me_configured_channels, enq.me_actual_channels);
 		printf("  Max Targets\t\t\t%d\n", enq.me_max_targets);

Reply via email to