On 11/19/20 9:48 AM, Erik Skultety wrote:
where VIR_DECLARE_MEMBER() would assert() that 1 <<
VIR_DOMAIN_VIDEO_TYPE_LAST fits into 'unsigned int' (or whatever type we
will use), and also declare 'modelType' member for the struct. I'm not sure
a tags generator would be capable of seeing that.
Why do you have to do both at the same time? Why not putting the assert right
after the virDomainVideoType enum typedef? I think it's much more obvious if
the guard comes right after what it actually guards.
You mean to put the assert into domain_conf.h? I'm not sure it would
make sense. Because the assert actually guides virDomainCapsEnum struct
and the way we store info there and not virDomainVideoType per se. For
instance for enums not (yet) exposed on domCaps we don't care about
their size.
Moreover, if I leave those asserts where they are now, then during
compilation the compiler reports error right where the problem is and
not at a place where it leaves you wondering why the assert is there.
Michal