On 06/11/2014 06:10 PM, Alexey Kardashevskiy wrote: >>> + * This program is free software; you can redistribute it and/or modify >>> + * it under the terms of the GNU General Public License as published by >>> + * the Free Software Foundation; either version 2 of the License, >>> + * or (at your option) any later version. >> >> For the GPL license to work, there has to be a Copyright line. > > Hm. Ok. include/hw/fw-path-provider.h (where I copied this from) does not > have one and it was ok. Just because there's existing bad practice in the code base doesn't mean new files should perpetuate it :) > >> >>> +static int do_nmi(Object *o, void *opaque) >>> +{ >>> + struct do_nmi_s *ns = opaque; >>> + NMI *n = (NMI *) object_dynamic_cast(o, TYPE_NMI); >> >> Is the cast to (NMI *) necessary, or does object_dynamic_cast() already >> return something that can be assigned to an arbitrary pointer type? > > > All the macros from include/qom/object.h do this cast and so do I. > > object_dynamic_cast returns Object*. Okay, then the cast is needed. (I wonder if object_dynamic_cast() should return void* to avoid the need for casting, but that probably invites more errors than what it saves from the eliminated casts). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org