GNOME Bugzilla – Bug 95791
imodules ommit typecodes for nested structs
Last modified: 2004-12-22 21:47:04 UTC
While investigating bug 95591, I ran into another imodule bug: nested structures are not returned by ORBit_small_get_types(). If I have the following input: module testing { struct ParentStruct { struct ChildStruct { long a; } a; }; }; and generate an imodule, the imodule will only list TC_testing_ParentStruct and skip TC_testing_ParentStruct_ChildStruct. I see a similar behaviour for structs nested in unions (and would probably see the same for unions nested in structs and unions nested in unions). I would expect the nested struct type code to be listed after the parent one.
Created attachment 11590 [details] [review] patch to list nested structs in imodules
Created attachment 11591 [details] [review] patch v2: enum defs can also be nested, and exceptions can have nested structs, etc
The above patch adds support for nested structs, unions and enums inside structs, unions and exceptions. It also puts enumeration discriminants after their unions, as suggested in bug 95591. If this patch looks okay, it should probably be applied to HEAD and gnome-2-0 branches.
PAtch looks fine, it might be nice to move this cut and paste block: + gchar *id; + id = orbit_cbe_get_typespec_str (tree); + fprintf (ci->fh, "\tTC_%s,\n", id); + (*count)++; + g_free (id); into a separate method if it makes sense. Apart from that looks great for HEAD & stable; please commit; thanks.
patch committed to HEAD and gnome-2-0 branches.