[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.
This commit is contained in:
@@ -14,11 +14,10 @@ struct init_fn {
|
||||
};
|
||||
|
||||
/** Initialisation function table */
|
||||
#define INIT_FNS "init_fns"
|
||||
#define INIT_FNS __table ( struct init_fn, "init_fns" )
|
||||
|
||||
/** Declare an initialisation functon */
|
||||
#define __init_fn( init_order ) \
|
||||
__table ( struct init_fn, INIT_FNS, init_order )
|
||||
#define __init_fn( init_order ) __table_entry ( INIT_FNS, init_order )
|
||||
|
||||
/** @defgroup initfn_order Initialisation function ordering
|
||||
* @{
|
||||
@@ -53,11 +52,11 @@ struct startup_fn {
|
||||
};
|
||||
|
||||
/** Startup/shutdown function table */
|
||||
#define STARTUP_FNS "startup_fns"
|
||||
#define STARTUP_FNS __table ( struct startup_fn, "startup_fns" )
|
||||
|
||||
/** Declare a startup/shutdown function */
|
||||
#define __startup_fn( startup_order ) \
|
||||
__table ( struct startup_fn, STARTUP_FNS, startup_order )
|
||||
__table_entry ( STARTUP_FNS, startup_order )
|
||||
|
||||
/** @defgroup startfn_order Startup/shutdown function ordering
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user