Changeset 350 for trunk/idl-compiler


Ignore:
Timestamp:
Jun 7, 2008, 10:19:02 AM (17 years ago)
Author:
cinc
Message:

Fixed method macros so nomSelf parameter is evaluated only once.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/idl-compiler/h-emitter_c/h_file_emitter.c

    r326 r350  
    1616* The Initial Developer of the Original Code is
    1717* netlabs.org: Chris Wohlgemuth <cinc-ml@netlabs.org>.
    18 * Portions created by the Initial Developer are Copyright (C) 2007
     18* Portions created by the Initial Developer are Copyright (C) 2007-2008
    1919* the Initial Developer. All Rights Reserved.
    2020*
     
    205205      emitMethodParams(pLocalPI, pif, pm->pParamArray);
    206206      fprintf(fh, "    CORBA_Environment *ev);\n");
     207      fprintf(fh, "#error The macro is broken. It does not support ˚recursive˚ calls (Line: %d)\n", __LINE__);
    207208      /* Macro to be used when several parameters are checked */
    208209      fprintf(fh, "#define %s_%s(nomSelf,", pif->chrName, pm->chrName);
     
    241242        {
    242243          if(strcmp(pif->chrName , "NOMObject"))
    243             fprintf(fh, "        (nomCheckObjectPtr((NOMObject*)nomSelf, %sClassData.classObject,",pif->chrName);
     244            fprintf(fh, "        ({ %s* %s_nomSelf_ = (nomSelf) ;nomCheckObjectPtr((NOMObject*)%s_nomSelf_, %sClassData.classObject,", pif->chrName, pif->chrName, pif->chrName, pif->chrName);
    244245          else
    245             fprintf(fh, "        (nomCheckNOMObjectPtr(nomSelf, %sClassData.classObject,",pif->chrName);
     246            fprintf(fh, "        (nomCheckNOMObjectPtr(%s_nomSelf_, %sClassData.classObject,",pif->chrName, pif->chrName);
    246247          fprintf(fh, "\"%s_%s\", ev) ? \\\n", pif->chrName, pm->chrName);
    247           fprintf(fh, "        (NOM_Resolve(nomSelf, %s, %s) \\\n", pif->chrName, pm->chrName);
    248           fprintf(fh, "        (nomSelf,");
     248          fprintf(fh, "        (NOM_Resolve(%s_nomSelf_, %s, %s) \\\n", pif->chrName, pif->chrName, pm->chrName);
     249          fprintf(fh, "        (%s_nomSelf_,", pif->chrName);
    249250          /* Do parameters */
    250251          emitMethodParamsNoTypes(pLocalPI, pif, pm->pParamArray);
     
    252253          for(b=0;b<pm->mpReturn.uiStar;b++)
    253254            fprintf(fh, "*");
    254           fprintf(fh, ") NULL)\n");
     255          fprintf(fh, ") NULL; })\n");
    255256        }
    256257      else
Note: See TracChangeset for help on using the changeset viewer.