Ignore:
Timestamp:
Mar 15, 2007, 9:42:22 PM (19 years ago)
Author:
cinc
Message:

Parameter checking for object pointer working.

Location:
trunk/ORBit2-2.14.0/src/idl-compiler
Files:
2 edited

Legend:

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

    r254 r255  
    13211321    doWriteParametersOnly(of, tree);
    13221322    fprintf(of, "ev) \\\n");
    1323     fprintf(of, "        (parmCheckFunc_%s(nomSelf, ", id);
    1324     /* Parameters for call */
    1325     doWriteParametersOnly(of, tree);
    1326 
    1327     fprintf(of, "ev) ? \\\n");
    1328     fprintf(of, "        (NOM_Resolve(nomSelf, %s, %s) \\\n", id2, id3);
    1329     fprintf(of, "        (nomSelf,");
    1330     /* add the parms */
    1331     doWriteParametersOnly(of, tree);
    1332     fprintf(of, "ev)) : %s_retval)\n", id);
    1333 
     1323    if(!strstr(id, "_nomIsObject"))
     1324      {
     1325        /* No check for _nomIsObject or otherwise we have a recursion */
     1326        fprintf(of, "        (parmCheckFunc_%s(nomSelf, ", id);
     1327        /* Parameters for call */
     1328        doWriteParametersOnly(of, tree);       
     1329        fprintf(of, "ev) ? \\\n");
     1330        fprintf(of, "        (NOM_Resolve(nomSelf, %s, %s) \\\n", id2, id3);
     1331        fprintf(of, "        (nomSelf,");
     1332        /* add the parms */
     1333        doWriteParametersOnly(of, tree);
     1334        fprintf(of, "ev)) : %s_retval)\n", id);
     1335      }
     1336    else
     1337      {
     1338        fprintf(of, "        (NOM_Resolve(nomSelf, %s, %s) \\\n", id2, id3);
     1339        fprintf(of, "        (nomSelf,");
     1340        /* add the parms */
     1341        doWriteParametersOnly(of, tree);
     1342        fprintf(of, "ev))\n");
     1343      }
    13341344    /* else NOM_NO_PARAM_CHECK */
    13351345    fprintf(of, "#else /* Extended parameter check */\n");
     
    13401350    doWriteParametersOnly(of, tree);
    13411351    fprintf(of, "ev) \\\n");
    1342     fprintf(of, "        (objectCheckFunc_%s(nomSelf, ", id2);
    1343     fprintf(of, " \"%s\") ? \\\n", id);
    1344     fprintf(of, "        (NOM_Resolve(nomSelf, %s, %s) \\\n", id2, id3);
    1345     fprintf(of, "        (nomSelf,");
    1346     /* add the parms */
    1347     doWriteParametersOnly(of, tree);
    1348     fprintf(of, "ev)) : (");
    1349     orbit_cbe_write_param_typespec(of, tree);
    1350     fprintf(of, ") NULL)\n");
     1352    if(!strstr(id, "_nomIsObject"))
     1353      {
     1354        /* No check for _nomIsObject or otherwise we have a recursion */
     1355        if(!strcmp(id2, "NOMObject"))
     1356          fprintf(of, "        (nomCheckNOMObjectPtr((NOMObject*)nomSelf, %sClassData.classObject,", id2);
     1357        else
     1358          fprintf(of, "        (nomCheckObjectPtr((NOMObject*)nomSelf, %sClassData.classObject,", id2);
     1359        fprintf(of, " \"%s\", ev) ? \\\n", id); /* method name */
     1360        fprintf(of, "        (NOM_Resolve(nomSelf, %s, %s) \\\n", id2, id3);
     1361        fprintf(of, "        (nomSelf,");
     1362        /* add the parms */
     1363        doWriteParametersOnly(of, tree);
     1364        fprintf(of, "ev)) : (");
     1365        orbit_cbe_write_param_typespec(of, tree);
     1366        fprintf(of, ") NULL)\n");
     1367      }
     1368    else
     1369      {
     1370        fprintf(of, "        (NOM_Resolve(nomSelf, %s, %s) \\\n", id2, id3);
     1371        fprintf(of, "        (nomSelf,");
     1372        /* add the parms */
     1373        doWriteParametersOnly(of, tree);
     1374        fprintf(of, "ev))\n");
     1375      }
    13511376    fprintf(of, "#endif\n");
    13521377
     
    14801505      /******* Print generic object check function  *******/
    14811506
    1482       fprintf(ci->fh, "NOMEXTERN gboolean NOMLINK objectCheckFunc_%s(%s *nomSelf, gchar* chrMethodName);\n\n", id, id);
    1483 
     1507      if(!strcmp(id, "NOMObject"))
     1508        fprintf(ci->fh, "NOMEXTERN gboolean NOMLINK nomCheckNOMObjectPtr(NOMObject *nomSelf, NOMClass* nomClass, gchar* chrMethodName, CORBA_Environment *ev);\n\n");
     1509      else
     1510        fprintf(ci->fh, "NOMEXTERN gboolean NOMLINK nomCheckObjectPtr(NOMObject *nomSelf, NOMClass* nomClass, gchar* chrMethodName, CORBA_Environment *ev);\n\n");
    14841511     
    14851512      /******* Print introduced methods *******/
  • trunk/ORBit2-2.14.0/src/idl-compiler/orbit-idl-c-skelimpl.c

    r254 r255  
    460460         check the object pointer. */
    461461      fprintf(ski->of, "\n/* Function to check if an object is valid before calling a method on it */\n");
    462       fprintf(ski->of, "#ifndef NOM_NO_PARAM_CHECK\n");
     462      fprintf(ski->of, "#ifdef NOM_NO_PARAM_CHECK /* Disabled by now because not working */\n");
    463463      fprintf(ski->of, "NOMEXTERN ");               
    464464      fprintf(ski->of, "gboolean NOMLINK objectCheckFunc_%s(%s *nomSelf, gchar* chrMethodName)\n",
     
    466466      fprintf(ski->of, "{\n");
    467467     
    468       fprintf(ski->of, "if(!nomIsObj(nomSelf) || !_nomIsA(nomSelf , %sClassData.classObject, NULLHANDLE))\n", id2);
     468      fprintf(ski->of, "if(!nomIsObj(nomSelf) || !_nomIsANoClsCheck(nomSelf , %sClassData.classObject, NULLHANDLE))\n", id2);
    469469      fprintf(ski->of, "  {\n");
    470470      fprintf(ski->of, "  nomPrintObjectPointerError(nomSelf, \"%s\", chrMethodName);\n", id2);
     
    11341134                fprintf(ski->of, "{\n");
    11351135
    1136                 fprintf(ski->of, "if(!nomIsObj(nomSelf) || !_nomIsA(nomSelf , %sClassData.classObject, NULLHANDLE))\n", id2);
     1136                fprintf(ski->of, "if(!nomIsObj(nomSelf) || !_nomIsANoClsCheck(nomSelf , %sClassData.classObject, NULLHANDLE))\n", id2);
    11371137                fprintf(ski->of, "  {\n");
    11381138                fprintf(ski->of, "  nomPrintObjectPointerError(nomSelf, \"%s\", \"%s\");\n", id2, id);
Note: See TracChangeset for help on using the changeset viewer.