return Result ;
}
-#define PyDynInvokeTrace 1
+#define PyDynInvokeTrace 0
bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
const char *method ,
ServicesAnyData * InParametersList , int nInParams ,
else {
ArgValue = Result ;
}
- if ( !PyInt_Check( ArgValue ) ) {
+ if ( !ArgValue || !PyInt_Check( ArgValue ) ) {
cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (boolean)" << endl ;
RetVal = false ;
}
}
data <<= (CORBA::Any::from_boolean ) b ;
#if PyDynInvokeTrace
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << b << " (boolean)"
- << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
- << ArgValue->ob_refcnt << endl ;
+ if ( ArgValue )
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << b << " (boolean)"
+ << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
+ << ArgValue->ob_refcnt << endl ;
#endif
break ;
}
//JR 04.04.2005 Debug if ( !PyInt_Check( ArgValue ) ) {
//Difficult to understand that behavior ... Python char type is a string of length 1 !
// or type is int ...
- if ( !PyString_Check( ArgValue ) && !PyInt_Check( ArgValue ) ) {
+ if ( !ArgValue || !PyString_Check( ArgValue ) && !PyInt_Check( ArgValue ) ) {
cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (char)" << endl ;
RetVal = false ;
}
}
data <<= (CORBA::Any::from_char ) c ;
#if PyDynInvokeTrace
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << c << " (char)"
- << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
- << ArgValue->ob_refcnt << endl ;
+ if ( ArgValue )
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << c << " (char)"
+ << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
+ << ArgValue->ob_refcnt << endl ;
#endif
break ;
}
else {
ArgValue = Result ;
}
- if ( !PyInt_Check( ArgValue ) ) {
+ if ( !ArgValue || !PyInt_Check( ArgValue ) ) {
cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (short)" << endl ;
RetVal = false ;
}
}
data <<= s ;
#if PyDynInvokeTrace
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << s << " (short)"
- << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
- << ArgValue->ob_refcnt << endl ;
+ if ( ArgValue )
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << s << " (short)"
+ << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
+ << ArgValue->ob_refcnt << endl ;
#endif
break ;
}
else {
ArgValue = Result ;
}
- if ( PyLong_Check( ArgValue ) ) {
+ if ( ArgValue && PyLong_Check( ArgValue ) ) {
l = PyLong_AsLong( ArgValue ) ;
}
- else if ( PyInt_Check( ArgValue ) ) {
+ else if ( ArgValue && PyInt_Check( ArgValue ) ) {
l = PyInt_AsLong( ArgValue ) ;
}
else {
}
data <<= l ;
#if PyDynInvokeTrace
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << l << " (long)"
- << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
- << ArgValue->ob_refcnt << endl ;
+ if ( ArgValue )
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << l << " (long)"
+ << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
+ << ArgValue->ob_refcnt << endl ;
#endif
break ;
}
else {
ArgValue = Result ;
}
- if ( !PyFloat_Check( ArgValue ) ) {
- // mkr : bug PAL12454
- if ( PyLong_Check( ArgValue ) ) {
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (long)" << endl ;
- long l = PyLong_AsLong( ArgValue );
- f = (float) l;
- }
- else if ( PyInt_Check( ArgValue ) ) {
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (int)" << endl ;
- long l = PyInt_AsLong( ArgValue );
- f = (float) l;
+ if ( ArgValue ) {
+ if ( !PyFloat_Check( ArgValue ) ) {
+ // mkr : bug PAL12454
+ if ( PyLong_Check( ArgValue ) ) {
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (long)" << endl ;
+ long l = PyLong_AsLong( ArgValue );
+ f = (float) l;
+ }
+ else if ( PyInt_Check( ArgValue ) ) {
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (int)" << endl ;
+ long l = PyInt_AsLong( ArgValue );
+ f = (float) l;
+ }
+ else {
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (float)" << endl ;
+ RetVal = false ;
+ }
}
else {
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (float)" << endl ;
- RetVal = false ;
+ f = PyFloat_AsDouble( ArgValue ) ;
}
}
- else {
- f = PyFloat_AsDouble( ArgValue ) ;
+ else {
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (float)" << endl ;
+ RetVal = false ;
}
#ifdef REDHAT // mkr : debug for PAL12255
data <<= f ;
data.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
#endif
#if PyDynInvokeTrace
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << f << " (float)"
- << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
- << ArgValue->ob_refcnt << endl ;
+ if ( ArgValue )
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << f << " (float)"
+ << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
+ << ArgValue->ob_refcnt << endl ;
#endif
break ;
}
else {
ArgValue = Result ;
}
- if ( !PyFloat_Check( ArgValue ) ) {
- // mkr : bug PAL12454
- if ( PyLong_Check( ArgValue ) ) {
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (long)" << endl ;
- long l = PyLong_AsLong( ArgValue );
- d = (double) l;
- }
- else if ( PyInt_Check( ArgValue ) ) {
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (int)" << endl ;
- long l = PyInt_AsLong( ArgValue );
- d = (double) l;
+ if ( ArgValue ) {
+ if ( !PyFloat_Check( ArgValue ) ) {
+ // mkr : bug PAL12454
+ if ( PyLong_Check( ArgValue ) ) {
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (long)" << endl ;
+ long l = PyLong_AsLong( ArgValue );
+ d = (double) l;
+ }
+ else if ( PyInt_Check( ArgValue ) ) {
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (int)" << endl ;
+ long l = PyInt_AsLong( ArgValue );
+ d = (double) l;
+ }
+ else {
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (float)" << endl ;
+ RetVal = false ;
+ }
}
else {
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (float)" << endl ;
- RetVal = false ;
+ d = PyFloat_AsDouble( ArgValue ) ;
}
}
- else {
- d = PyFloat_AsDouble( ArgValue ) ;
+ else {
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (float)" << endl ;
+ RetVal = false ;
}
#ifdef REDHAT // mkr : debug for PAL12255
data <<= d ;
data.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
#endif
#if PyDynInvokeTrace
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << d << " (double)"
- << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
- << ArgValue->ob_refcnt << endl ;
+ if ( ArgValue )
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << d << " (double)"
+ << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
+ << ArgValue->ob_refcnt << endl ;
#endif
break ;
}
ObjIor = Result ;
}
#if PyDynInvokeTrace
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << "(object reference) "
- << " Result->ob_refcnt" << Result->ob_refcnt << " ObjIor->ob_refcnt"
- << ObjIor->ob_refcnt << endl ;
+ if ( ObjIor )
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << "(object reference) "
+ << " Result->ob_refcnt" << Result->ob_refcnt << " ObjIor->ob_refcnt"
+ << ObjIor->ob_refcnt << endl ;
#endif
//Py_INCREF( ObjIor ) ;
// PyObject_Print( ObjIor , stdout , 0 ) ;
//ResultIor = PyEvalCallObject( "PyObjIor" , MyPyObjIor , MyPyObjIorList ) ;
ResultIor = PyObject_CallFunction( MyPyObjIor , "O",ObjIor ) ;
#if PyDynInvokeTrace
- cdebug << "ObjIor->ob_refcnt " << ObjIor->ob_refcnt-1 << endl ;
+ if ( ObjIor )
+ cdebug << "ObjIor->ob_refcnt " << ObjIor->ob_refcnt-1 << endl ;
#endif
//Py_DECREF( ObjIor ) ;
#if PyDynInvokeTrace