Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/mlxctl avoid type punned warnings



details:   https://anonhg.NetBSD.org/src/rev/532d260b4177
branches:  trunk
changeset: 768336:532d260b4177
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Aug 14 17:57:44 2011 +0000

description:
avoid type punned warnings

diffstat:

 usr.sbin/mlxctl/Makefile |   8 +-------
 usr.sbin/mlxctl/cmds.c   |  16 +++++++++-------
 2 files changed, 10 insertions(+), 14 deletions(-)

diffs (57 lines):

diff -r ac6609c26710 -r 532d260b4177 usr.sbin/mlxctl/Makefile
--- a/usr.sbin/mlxctl/Makefile  Sun Aug 14 17:54:55 2011 +0000
+++ b/usr.sbin/mlxctl/Makefile  Sun Aug 14 17:57:44 2011 +0000
@@ -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
diff -r ac6609c26710 -r 532d260b4177 usr.sbin/mlxctl/cmds.c
--- a/usr.sbin/mlxctl/cmds.c    Sun Aug 14 17:54:55 2011 +0000
+++ b/usr.sbin/mlxctl/cmds.c    Sun Aug 14 17:57:44 2011 +0000
@@ -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) {
-               mlx_enquiry(&enq);
+               uint32_t hid, 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));
+               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(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);



Home | Main Index | Thread Index | Old Index