Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/iopctl Add compile-time assertion to make sure the ...



details:   https://anonhg.NetBSD.org/src/rev/10dc3df4e48c
branches:  trunk
changeset: 768342:10dc3df4e48c
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Aug 14 23:13:43 2011 +0000

description:
Add compile-time assertion to make sure the previous doesn't go off the
rails sometime in the future.

diffstat:

 usr.sbin/iopctl/iopctl.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 1565cdfbeecc -r 10dc3df4e48c usr.sbin/iopctl/iopctl.c
--- a/usr.sbin/iopctl/iopctl.c  Sun Aug 14 20:42:09 2011 +0000
+++ b/usr.sbin/iopctl/iopctl.c  Sun Aug 14 23:13:43 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iopctl.c,v 1.20 2011/08/14 17:54:55 christos Exp $     */
+/*     $NetBSD: iopctl.c,v 1.21 2011/08/14 23:13:43 dholland Exp $     */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #ifndef lint
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: iopctl.c,v 1.20 2011/08/14 17:54:55 christos Exp $");
+__RCSID("$NetBSD: iopctl.c,v 1.21 2011/08/14 23:13:43 dholland Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -353,6 +353,7 @@
        i2ostrvis(p.di.revlevel, sizeof(p.di.revlevel), ident, sizeof(ident));
        show("module revision", "%s", ident);
        show("serial # format", "%d", p.di.snformat);
+       __CTASSERT(sizeof(serial) == sizeof(p.di.serialnumber));
        memcpy(serial, &p.di.serialnumber, sizeof(serial));
        show("serial #", "%08x%08x%08x", serial[0], serial[1], serial[2]);
 }



Home | Main Index | Thread Index | Old Index