Changeset 289 for trunk/idl-compiler


Ignore:
Timestamp:
Apr 1, 2007, 2:03:04 PM (18 years ago)
Author:
cinc
Message:

Hunting bugs...

Location:
trunk/idl-compiler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/idl-compiler/c/nom-idl-compiler.c

    r280 r289  
    624624
    625625  g_scanner_destroy(gScanner);
    626   close(fd);
    627   fclose(parseInfo.outFile);
     626  if(0!=fd)
     627    close(fd); /* We read from stdin */
     628  if(parseInfo.outFile)
     629    fclose(parseInfo.outFile);
    628630  return 0;
    629631}
  • trunk/idl-compiler/h-emitter_c/h_file_emitter.c

    r287 r289  
    328328    {
    329329      PINTERFACE pif=g_ptr_array_index(pLocalPI->pInterfaceArray, a);
     330
    330331      /* Only interfaces from the file given on the command line */
    331332      if(!strcmp(pif->chrSourceFileName, pLocalPI->chrRootSourceFile))
    332333        {
    333           gchar*  chrTemp;
    334          
    335           chrTemp=g_strconcat(pif->chrFileStem, ".h", NULL);
    336 
    337           //printInterface(pif);
    338           if((pLocalPI->outFile=openOutfile(gScanner, chrTemp))!=NULLHANDLE)
     334          /* Only interfaces which are fully defined. No forwarder */
     335          if(!pif->fIsForwardDeclaration)
    339336            {
    340               emitHFileHeader(pLocalPI, pif);
    341               emitInterfaceIncludes(pLocalPI, pif);
    342               emitClassVersion(pLocalPI, pif);
    343               emitClassDataStructs(pLocalPI, pif);
    344               emitNewMacro(pLocalPI, pif);
    345               emitObjectCheckFunction(pLocalPI, pif);
    346               emitNewMethods(pLocalPI, pif);
    347               emitParentClassMethods(pLocalPI, pif);
    348               emitHFileFooter(pLocalPI, pif);
    349               closeOutfile(pLocalPI->outFile);
    350             }
    351           g_free(chrTemp);
    352         }
    353     }
    354 }
    355 
    356 
     337              gchar*  chrTemp;
     338
     339              chrTemp=g_strconcat(pif->chrFileStem, ".h", NULL);
     340             
     341              //printInterface(pif);             
     342              if((pLocalPI->outFile=openOutfile(gScanner, chrTemp))!=NULLHANDLE)
     343                {
     344                  emitHFileHeader(pLocalPI, pif);
     345                  emitInterfaceIncludes(pLocalPI, pif);
     346                  emitClassVersion(pLocalPI, pif);
     347                  emitClassDataStructs(pLocalPI, pif);
     348                  emitNewMacro(pLocalPI, pif);
     349                  emitObjectCheckFunction(pLocalPI, pif);
     350                  emitNewMethods(pLocalPI, pif);
     351                  emitParentClassMethods(pLocalPI, pif);
     352                  emitHFileFooter(pLocalPI, pif);
     353                  closeOutfile(pLocalPI->outFile);
     354                }
     355              g_free(chrTemp);
     356            }/* fIsForwardDeclaration */
     357        }
     358    }
     359}
     360
     361
  • trunk/idl-compiler/parser_c/interface_parser.c

    r287 r289  
    4646{
    4747  PSYMBOL pNewSymbol=g_malloc0(sizeof(SYMBOL));
     48
     49  // g_message("In %s for %s", __FUNCTION__, pParseInfo->pCurInterface->chrName);
    4850
    4951  pParseInfo->pCurInterface->pSymbolIFace=pNewSymbol;
     
    7981static void deRegisterInterface(PINTERFACE pif)
    8082{
     83  //  g_message("In %s", __FUNCTION__);
     84
    8185  /* Remove the interface from our list */
    8286  g_ptr_array_remove(pParseInfo->pInterfaceArray, (gpointer) pif);
     
    363367          g_free(pParseInfo->pCurInterface);
    364368        }
    365       pParseInfo->pCurInterface->chrSourceFileName=g_strdup(pParseInfo->chrCurrentSourceFile);
    366       pParseInfo->pCurInterface->fIsForwardDeclaration=TRUE;
    367       /* It's save to register the interface right here even if the struct is almost empty.
    368          If anything goes wrong later we will exit anyway. */
    369       registerInterface(); 
     369      else{
     370        pParseInfo->pCurInterface->chrSourceFileName=g_strdup(pParseInfo->chrCurrentSourceFile);
     371        pParseInfo->pCurInterface->fIsForwardDeclaration=TRUE;
     372        /* It's save to register the interface right here even if the struct is almost empty.
     373           If anything goes wrong later we will exit anyway. */
     374        registerInterface(); 
     375      }
    370376    }
    371377  else
     
    396402        }
    397403      pParseInfo->pCurInterface->chrSourceFileName=g_strdup(pParseInfo->chrCurrentSourceFile);
    398       pParseInfo->pCurInterface->fIsForwardDeclaration=TRUE;
    399404      /* It's save to register the interface right here even if the struct is almost empty.
    400405         If anything goes wrong later we will exit anyway. */
    401406      registerInterface(); 
    402407      if(matchNext(':'))
    403         {
    404          
     408        {         
    405409          parseSubclassedIFace();
    406410        }
Note: See TracChangeset for help on using the changeset viewer.