diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-06-07 20:36:08 +0400 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2017-06-20 14:31:32 +0200 |
commit | 76318657a803c542cdee232c8507dec8004e2478 (patch) | |
tree | 9695ca941d9ed5a9fbacc0903a2e86ce832a6839 /include/hw/qdev-properties.h | |
parent | 85bbd1e7a4aea4c6d4d636d300c3f405afa98285 (diff) |
qdev: wrap default property value in an union
Wrap the Property default value (an int64_t) in a union, to prepare
for the next patch adding a uint64_t.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20170607163635.17635-17-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'include/hw/qdev-properties.h')
-rw-r--r-- | include/hw/qdev-properties.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 05603805cb..34524d0bfe 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -42,7 +42,7 @@ extern PropertyInfo qdev_prop_arraylen; .info = &(_prop), \ .offset = offsetof(_state, _field) \ + type_check(_type,typeof_field(_state, _field)), \ - .defval = (_type)_defval, \ + .defval.i = (_type)_defval, \ } #define DEFINE_PROP_BIT(_name, _state, _field, _bit, _defval) { \ .name = (_name), \ @@ -50,7 +50,7 @@ extern PropertyInfo qdev_prop_arraylen; .bitnr = (_bit), \ .offset = offsetof(_state, _field) \ + type_check(uint32_t,typeof_field(_state, _field)), \ - .defval = (bool)_defval, \ + .defval.i = (bool)_defval, \ } #define DEFINE_PROP_BIT64(_name, _state, _field, _bit, _defval) { \ .name = (_name), \ @@ -58,7 +58,7 @@ extern PropertyInfo qdev_prop_arraylen; .bitnr = (_bit), \ .offset = offsetof(_state, _field) \ + type_check(uint64_t, typeof_field(_state, _field)), \ - .defval = (bool)_defval, \ + .defval.i = (bool)_defval, \ } #define DEFINE_PROP_BOOL(_name, _state, _field, _defval) { \ @@ -66,7 +66,7 @@ extern PropertyInfo qdev_prop_arraylen; .info = &(qdev_prop_bool), \ .offset = offsetof(_state, _field) \ + type_check(bool, typeof_field(_state, _field)), \ - .defval = (bool)_defval, \ + .defval.i = (bool)_defval, \ } #define PROP_ARRAY_LEN_PREFIX "len-" |