On Thu, Aug 20, 2020 at 01:45:06PM -0400, Eduardo Habkost wrote: > (CCing Eric Blake, who reviewed the original patch. Sorry for > not CCing you previously, Eric) > > On Wed, Aug 19, 2020 at 08:12:22PM -0400, Eduardo Habkost wrote: > [...] > > +/** > > + * OBJECT_DECLARE_TYPE: > > + * @ModuleObjName: the object name with initial capitalization > > + * @module_obj_name: the object name in lowercase with underscore > > separators > > + * @MODULE_OBJ_NAME: the object name in uppercase with underscore > > separators > > We need to decide what to do with TYPE_SWIM: > > #define TYPE_SWIM "swim" > typedef struct SWIM SWIM; > #define SWIM(obj) OBJECT_CHECK(SWIM, (obj), TYPE_SWIM) > > Both the typedef and type checking macros are called "SWIM". > This makes usage of OBJECT_DECLARE_TYPE impossible (because the > type checking function can't have the same as the typedef). What > should be the recommended style here? Rename the struct to > "Swim"?
This would be the gobject style approach to the problem - structs always have initial-caps-only even if they are abbreviations. If that's unappealing we could add a suffix "struct SWIMInst" > We have similar issues with RXCPU and ARMSSE, but these type > checking macros can be easily renamed to RX_CPU and ARM_SSE. so > they won't be an issue. Or RSCPUInst and ARMSSEInst ? Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|