wierd TC generation ...



In the code fragment:

  /* subtypes */
  switch(IDL_NODE_TYPE(tci->ts)) {
  case IDLN_EXCEPT_DCL:
  case IDLN_TYPE_STRUCT:
    if(!IDL_TYPE_STRUCT(tci->ts).member_list)
      break;
    fprintf(tci->of, "static const CORBA_TypeCode anon_subtypes_array%d[]
= {",
	    subtypes_id);
    for(curitem = IDL_TYPE_STRUCT(tci->ts).member_list; curitem;
	curitem = IDL_LIST(curitem).next) {
      IDL_tree curdcl;

      curdcl = IDL_MEMBER(IDL_LIST(curitem).data).type_spec;
      switch(IDL_NODE_TYPE(curdcl)) {
      case IDLN_IDENT:
      case IDLN_INTERFACE:
      case IDLN_TYPE_OBJECT:
      case IDLN_FORWARD_DCL:
	curdcl = orbit_cbe_get_typespec(curdcl);
	if(IDL_NODE_TYPE(curdcl) == IDLN_TYPE_OBJECT
	   || IDL_NODE_TYPE(curdcl) == IDLN_INTERFACE
	   || IDL_NODE_TYPE(curdcl) == IDLN_FORWARD_DCL) {
	  ctmp = g_strdup("Object");
	  break;
	}
      default:
	ctmp = orbit_cbe_get_typespec_str(IDL_MEMBER(IDL_LIST(curitem).data).type_spec);
      }


	The switch in this loop looks wrong to me - we discard valuable
type information on the interfaces etc. which we can use for nice checking
in scripting bindings.

	We do similar, but subtly different things for sequence / unions
etc. in orbit-idl-corba-typecode.c

	Essentialy:

		* Why are they different between sequence, union, struct
		* Why are we doing this at all ?

	I'd quite like to get rid of this; if that's ok ?

	Regards,

		Michael.

-- 
 mmeeks@gnu.org  <><, Pseudo Engineer, itinerant idiot





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]