diff options
| author | Michael Brown | 2009-03-13 01:13:38 +0100 |
|---|---|---|
| committer | Michael Brown | 2009-03-13 03:10:21 +0100 |
| commit | 3c68ff99eaff6e0d615349bdc85ea12ad8345284 (patch) | |
| tree | 969a335fe8d1685203f7bfe90d07868dcbc1fe34 /src/include/gpxe/features.h | |
| parent | [tables] Redefine methods for accessing linker tables (diff) | |
| download | ipxe-3c68ff99eaff6e0d615349bdc85ea12ad8345284.tar.gz ipxe-3c68ff99eaff6e0d615349bdc85ea12ad8345284.tar.xz ipxe-3c68ff99eaff6e0d615349bdc85ea12ad8345284.zip | |
[tables] Incorporate table data type information into table definition
Eliminate the potential for mismatches between table names and the
table entry data type by incorporating the data type into the
definition of the table, rather than specifying it explicitly in each
table accessor method.
Diffstat (limited to 'src/include/gpxe/features.h')
| -rw-r--r-- | src/include/gpxe/features.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/include/gpxe/features.h b/src/include/gpxe/features.h index e979ee7ca..8d3977cb6 100644 --- a/src/include/gpxe/features.h +++ b/src/include/gpxe/features.h @@ -51,10 +51,10 @@ /** @} */ /** DHCP feature table */ -#define DHCP_FEATURES "dhcp_features" +#define DHCP_FEATURES __table ( uint8_t, "dhcp_features" ) /** Declare a feature code for DHCP */ -#define __dhcp_feature __table ( uint8_t, DHCP_FEATURES, 01 ) +#define __dhcp_feature __table_entry ( DHCP_FEATURES, 01 ) /** Construct a DHCP feature table entry */ #define DHCP_FEATURE( feature_opt, ... ) \ @@ -73,11 +73,10 @@ struct feature { }; /** Named feature table */ -#define FEATURES "features" +#define FEATURES __table ( struct feature, "features" ) /** Declare a named feature */ -#define __feature_name( category ) \ - __table ( struct feature, FEATURES, category ) +#define __feature_name( category ) __table_entry ( FEATURES, category ) /** Construct a named feature */ #define FEATURE_NAME( category, text ) \ |
