I don't see how those work with any vintage of C compiler. You can't just initialize any member of a union and expect the compiler to guess which one you mean.
On Wed, Jan 29, 2014 at 11:18:24AM -0800, Linda Sun wrote: > --- > lib/ovsdb-types.h | 20 ++++++++------------ > 1 file changed, 8 insertions(+), 12 deletions(-) > > diff --git a/lib/ovsdb-types.h b/lib/ovsdb-types.h > index efd83a7..d3aa262 100644 > --- a/lib/ovsdb-types.h > +++ b/lib/ovsdb-types.h > @@ -70,8 +70,8 @@ struct ovsdb_base_type { > /* No constraints for Boolean types. */ > > struct ovsdb_string_constraints { > - unsigned int minLen; /* minLength or 0. */ > - unsigned int maxLen; /* maxLength or UINT_MAX. */ > + uint64_t minLen; /* minLength or 0. */ > + uint64_t maxLen; /* maxLength or UINT_MAX. */ > } string; > > struct ovsdb_uuid_constraints { > @@ -82,16 +82,12 @@ struct ovsdb_base_type { > } u; > }; > > -#define OVSDB_BASE_VOID_INIT { .type = OVSDB_TYPE_VOID } > -#define OVSDB_BASE_INTEGER_INIT { .type = OVSDB_TYPE_INTEGER, \ > - .u.integer = { INT64_MIN, INT64_MAX } } > -#define OVSDB_BASE_REAL_INIT { .type = OVSDB_TYPE_REAL, \ > - .u.real = { -DBL_MAX, DBL_MAX } } > -#define OVSDB_BASE_BOOLEAN_INIT { .type = OVSDB_TYPE_BOOLEAN } > -#define OVSDB_BASE_STRING_INIT { .type = OVSDB_TYPE_STRING, \ > - .u.string = { 0, UINT_MAX } } > -#define OVSDB_BASE_UUID_INIT { .type = OVSDB_TYPE_UUID, \ > - .u.uuid = { NULL, NULL, 0 } } > +#define OVSDB_BASE_VOID_INIT {OVSDB_TYPE_VOID, NULL, {0, 0}} > +#define OVSDB_BASE_INTEGER_INIT {OVSDB_TYPE_INTEGER, NULL, {INT64_MIN, > INT64_MAX}} > +#define OVSDB_BASE_REAL_INIT {OVSDB_TYPE_REAL, NULL, {-DBL_MAX, DBL_MAX}} > +#define OVSDB_BASE_BOOLEAN_INIT {OVSDB_TYPE_BOOLEAN, NULL, {0, 0}} > +#define OVSDB_BASE_STRING_INIT {OVSDB_TYPE_STRING, NULL, {0, UINT_MAX}} > +#define OVSDB_BASE_UUID_INIT {OVSDB_TYPE_UUID, NULL, {0, 0}} > > void ovsdb_base_type_init(struct ovsdb_base_type *, enum ovsdb_atomic_type); > void ovsdb_base_type_clone(struct ovsdb_base_type *, > -- > 1.7.9.5 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > http://openvswitch.org/mailman/listinfo/dev _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev