Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/sys Don't nest structure definitions.
details: https://anonhg.NetBSD.org/src/rev/fe712a916039
branches: trunk
changeset: 332034:fe712a916039
user: matt <matt%NetBSD.org@localhost>
date: Fri Sep 05 05:47:40 2014 +0000
description:
Don't nest structure definitions.
diffstat:
sys/sys/device.h | 12 +++++++-----
sys/sys/disklabel.h | 41 +++++++++++++++++++++--------------------
sys/sys/resourcevar.h | 21 +++++++++++----------
3 files changed, 39 insertions(+), 35 deletions(-)
diffs (137 lines):
diff -r 51f7b6287b20 -r fe712a916039 sys/sys/device.h
--- a/sys/sys/device.h Fri Sep 05 05:46:54 2014 +0000
+++ b/sys/sys/device.h Fri Sep 05 05:47:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.144 2013/10/12 16:49:01 christos Exp $ */
+/* $NetBSD: device.h,v 1.145 2014/09/05 05:47:40 matt Exp $ */
/*
* Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -138,6 +138,11 @@
#define DEVICE_SUSPENSORS_MAX 16
+struct device_garbage {
+ device_t *dg_devs;
+ int dg_ndevs;
+};
+
struct device {
devclass_t dv_class; /* this device's classification */
TAILQ_ENTRY(device) dv_list; /* entry on list of all devices */
@@ -182,10 +187,7 @@
*dv_bus_suspensors[DEVICE_SUSPENSORS_MAX],
*dv_driver_suspensors[DEVICE_SUSPENSORS_MAX],
*dv_class_suspensors[DEVICE_SUSPENSORS_MAX];
- struct device_garbage {
- device_t *dg_devs;
- int dg_ndevs;
- } dv_garbage;
+ struct device_garbage dv_garbage;
};
/* dv_flags */
diff -r 51f7b6287b20 -r fe712a916039 sys/sys/disklabel.h
--- a/sys/sys/disklabel.h Fri Sep 05 05:46:54 2014 +0000
+++ b/sys/sys/disklabel.h Fri Sep 05 05:47:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disklabel.h,v 1.116 2013/11/05 00:36:02 msaitoh Exp $ */
+/* $NetBSD: disklabel.h,v 1.117 2014/09/05 05:47:40 matt Exp $ */
/*
* Copyright (c) 1987, 1988, 1993
@@ -98,6 +98,24 @@
#define DISKMAGIC ((uint32_t)0x82564557) /* The disk magic number */
#ifndef _LOCORE
+struct partition { /* the partition table */
+ uint32_t p_size; /* number of sectors in partition */
+ uint32_t p_offset; /* starting sector */
+ union {
+ uint32_t fsize; /* FFS, ADOS: filesystem basic fragment size */
+ uint32_t cdsession; /* ISO9660: session offset */
+ } __partition_u2;
+#define p_fsize __partition_u2.fsize
+#define p_cdsession __partition_u2.cdsession
+ uint8_t p_fstype; /* filesystem type, see below */
+ uint8_t p_frag; /* filesystem fragments per block */
+ union {
+ uint16_t cpg; /* UFS: FS cylinders per group */
+ uint16_t sgs; /* LFS: FS segment shift */
+ } __partition_u1;
+#define p_cpg __partition_u1.cpg
+#define p_sgs __partition_u1.sgs
+};
struct disklabel {
uint32_t d_magic; /* the magic number */
uint16_t d_type; /* drive type */
@@ -181,25 +199,8 @@
uint16_t d_npartitions; /* number of partitions in following */
uint32_t d_bbsize; /* size of boot area at sn0, bytes */
uint32_t d_sbsize; /* max size of fs superblock, bytes */
- struct partition { /* the partition table */
- uint32_t p_size; /* number of sectors in partition */
- uint32_t p_offset; /* starting sector */
- union {
- uint32_t fsize; /* FFS, ADOS:
- filesystem basic fragment size */
- uint32_t cdsession; /* ISO9660: session offset */
- } __partition_u2;
-#define p_fsize __partition_u2.fsize
-#define p_cdsession __partition_u2.cdsession
- uint8_t p_fstype; /* filesystem type, see below */
- uint8_t p_frag; /* filesystem fragments per block */
- union {
- uint16_t cpg; /* UFS: FS cylinders per group */
- uint16_t sgs; /* LFS: FS segment shift */
- } __partition_u1;
-#define p_cpg __partition_u1.cpg
-#define p_sgs __partition_u1.sgs
- } d_partitions[MAXPARTITIONS]; /* actually may be more */
+ struct partition d_partitions[MAXPARTITIONS];
+ /* the partition table, actually may be more */
};
#if defined(__HAVE_OLD_DISKLABEL) && !HAVE_NBTOOL_CONFIG_H
diff -r 51f7b6287b20 -r fe712a916039 sys/sys/resourcevar.h
--- a/sys/sys/resourcevar.h Fri Sep 05 05:46:54 2014 +0000
+++ b/sys/sys/resourcevar.h Fri Sep 05 05:47:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: resourcevar.h,v 1.54 2012/11/03 23:22:22 njoly Exp $ */
+/* $NetBSD: resourcevar.h,v 1.55 2014/09/05 05:47:40 matt Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -43,6 +43,15 @@
/*
* Kernel per-process accounting / statistics
*/
+struct uprof { /* profile arguments */
+ char * pr_base; /* buffer base */
+ size_t pr_size; /* buffer size */
+ u_long pr_off; /* pc offset */
+ u_int pr_scale; /* pc scaling */
+ u_long pr_addr; /* temp storage for addr until AST */
+ u_long pr_ticks; /* temp storage for ticks until AST */
+};
+
struct pstats {
#define pstat_startzero p_ru
struct rusage p_ru; /* stats for this proc */
@@ -51,15 +60,7 @@
#define pstat_startcopy p_timer
struct itimerspec p_timer[3]; /* virtual-time timers */
-
- struct uprof { /* profile arguments */
- char * pr_base; /* buffer base */
- size_t pr_size; /* buffer size */
- u_long pr_off; /* pc offset */
- u_int pr_scale; /* pc scaling */
- u_long pr_addr; /* temp storage for addr until AST */
- u_long pr_ticks; /* temp storage for ticks until AST */
- } p_prof;
+ struct uprof p_prof; /* profile arguments */
#define pstat_endcopy p_start
struct timeval p_start; /* starting time */
};
Home |
Main Index |
Thread Index |
Old Index