On (04/02/09 10:25), James Carlson wrote:
>
> I happen to like type checking, so I'd suggest using a union of types
> instead of a 'void **'. Perhaps something like:
me too.
In fact, I myself would prefer to see the addition of a DLD_GET_RANGE to
dld_ioc_macprop_t, and have the drivers return a structure like
the one Jim suggest below. This way, we don't need an explosion in
the property-number space (2 propnums per prop, one for value and one
for range).
ymmv.
--Sowmini
> typedef struct mac_propval_int_range_s {
> uint32_t range_min;
> uint32_t range_max;
> } mac_propval_int_range_t;
>
> typedef enum mac_propval_rtype_e {
> pvlInteger
> } mac_propval_rtype_t;
>
> typedef struct mac_propval_range_s {
> uint_t range_num;
> mac_propval_rtype_t range_type;
> union {
> mac_propval_int_range_t **pvl_ir;
> } u;
> } mac_propval_range_t;
>
> #define range_int u.pvl_ir
>
> ... but it's probably not a big issue.
>