On Wed, Apr 8, 2020 at 10:47 PM Jonathon Jongsma <jjongsma@xxxxxxxxxx> wrote: > > On Fri, 2020-04-03 at 17:15 +0200, Rafael Fonseca wrote: > > > > #define virCheckAdmServerReturn(obj, retval) \ > > do { \ > > - virAdmServerPtr _srv = (obj); \ > > - if (!virObjectIsClass(_srv, virAdmServerClass) || \ > > + virAdmServerPtr _srv = VIR_ADM_SERVER(obj); \ > > + if (!G_IS_OBJECT(_srv) || !(G_OBJECT_TYPE(_srv) == > > VIR_TYPE_ADM_SERVER) || \ > > This additional check is unnecessary with GObject. The VIR_ADM_SERVER() > casting macro that is provided by G_DECLARE_FINAL_TYPE() does this > internally. This function already checks that the type of obj is > correct and castable. If the pointer is not castable to the type, it > emits a warning and returns NULL. So you can just check for (_srv == > NULL). Thank you for the reviews and comments! I'm afraid all the patches related to `datatypes.c` will have this same problem. They'll be fixed in v2. Att. -- Rafael Fonseca