On 07/22/2015 11:34 AM, Eric Blake wrote: > > -typedef struct int32List { > +typedef struct boolList boolList; > + > +struct boolList { > > I can understand the minor change in #ifdef name, and even the > separation between typedef and struct declaration (even though the old > approach of doing it all at once works).
Actually, I don't see any clear-cut policy on the matter (all HACKING says is that "Typedefs are used to eliminate the redundant 'struct' keyword", but does not say how aggressively they must be used). In fact, it looks like most of qemu.git prefers the more compact representation, while your patch goes to the less-common one: $ git grep 'typedef struct .* {' | wc 1370 5549 71105 $ git grep 'typedef struct .*;' | wc 624 2515 41449 However, one thing that your style has going for it, that was not possible with the compact version, is to use: typedef struct intList intList; struct intList { union { int64_t value; uint64_t padding; }; - struct intList *next; + intList *next; }; that is, because your typedef is separate, you have the option of being able to drop the use of 'struct' from within the actual intList struct. Again, if we want that, it would be better to do that as a separate commit. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature