Ignore:
Timestamp:
Nov 26, 2006, 3:23:22 PM (19 years ago)
Author:
cinc
Message:

Fixed missing parameters in parent method calls of method templates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ORBit2-2.14.0/src/idl-compiler/orbit-idl-c-stubs.c

    r92 r115  
    5959}
    6060
     61static
     62void VoyagerWriteParamsForParentCall(IDL_tree curif, InheritedOutputInfo *ioi)
     63{
     64  IDL_tree curitem;
     65  char* overridenMethodName;
     66
     67  if(curif == ioi->realif)
     68    return;
     69
     70  overridenMethodName=ioi->chrOverridenMethodName;
     71
     72  for(curitem = IDL_INTERFACE(curif).body; curitem; curitem = IDL_LIST(curitem).next) {
     73    IDL_tree curop = IDL_LIST(curitem).data;
     74
     75    switch(IDL_NODE_TYPE(curop)) {
     76    case IDLN_OP_DCL:
     77      {
     78        /* Check if the current method (introduced by some parent) is the one to be
     79           overriden. */
     80        if(!strcmp(overridenMethodName, IDL_IDENT(IDL_OP_DCL(curop).ident).str)){
     81          IDL_tree  sub;
     82
     83          for (sub = IDL_OP_DCL (curop).parameter_dcls; sub; sub = IDL_LIST (sub).next) {
     84            IDL_tree parm = IDL_LIST (sub).data;
     85            fprintf (ioi->of, "%s, ", IDL_IDENT (IDL_PARAM_DCL (parm).simple_declarator).str);
     86          }
     87        }
     88        break;
     89      }
     90        default:
     91          break;
     92    }
     93  }
     94}
    6195
    6296void
     
    70104  char * id2;
    71105  char * ptr;
    72  
     106  IDL_tree tmptree;
     107
    73108  g_assert (IDL_NODE_TYPE(op) == IDLN_OP_DCL);
    74109 
     
    86121                         id, id2);
    87122
    88     g_free(id2);
    89 
    90 
    91123        fprintf (of, "(");
    92 
    93     fprintf (of, "nomSelf, ", id);
    94 
    95         g_free (id);
    96 
     124    fprintf (of, "nomSelf, ");
     125
     126
     127    tmptree = IDL_get_parent_node(op, IDLN_INTERFACE, NULL);
     128
     129    if(IDL_INTERFACE(tmptree).inheritance_spec) {
     130      InheritedOutputInfo ioi;
     131     
     132      ioi.of = of;
     133      ioi.realif = tmptree;
     134      ioi.chrOverridenMethodName=id2;
     135      IDL_tree_traverse_parents(IDL_INTERFACE(tmptree).inheritance_spec, (GFunc)VoyagerWriteParamsForParentCall, &ioi);
     136    }
     137
     138#if 0
    97139        for (sub = IDL_OP_DCL (op).parameter_dcls; sub; sub = IDL_LIST (sub).next) {
    98140                IDL_tree parm = IDL_LIST (sub).data;
     
    101143                fprintf (of, " %s, ", IDL_IDENT (IDL_PARAM_DCL (parm).simple_declarator).str);
    102144        }
    103 
     145#endif
     146    g_free(id2);
     147        g_free (id);
    104148        fprintf (of, " ev);\n");
    105149}
     
    181225        fprintf (of, "}\n");
    182226#else
     227    /* This is Voyager stuff... */
    183228    if(strstr(opname, NOM_INSTANCEVAR_STRING)==NULL &&
    184229       strstr(opname, NOM_OVERRIDE_STRING)==NULL)
     
    230275
    231276        fprintf (of, "#endif\n");
    232         //        fprintf(of, "/*  %s_%s_parent_resolved()*/\n",
    233         //      realid, IDL_IDENT(IDL_OP_DCL(curop).ident).str);
    234 
    235277#if 0
    236278        /* Inherited */
Note: See TracChangeset for help on using the changeset viewer.