From 5b909ed3fc6059d789e919e597d1cf1389b7bde8 Mon Sep 17 00:00:00 2001 From: mkr Date: Fri, 25 Aug 2006 12:38:44 +0000 Subject: [PATCH] Fix for bug PAL13256 on Debian Calibre3 platform from Jean Rahuel ( EDF255 GEOM-CAS6.1 Infinite loop ). --- src/GraphBase/DataFlowBase_DataPort.cxx | 21 ++++++++----- src/GraphBase/DataFlowBase_XmlHandler.cxx | 9 ++++-- .../DataFlowExecutor_InNodeThreads.cxx | 30 ++++++++++++------- .../DataFlowExecutor_PyDynInvoke.cxx | 6 ++-- 4 files changed, 43 insertions(+), 23 deletions(-) diff --git a/src/GraphBase/DataFlowBase_DataPort.cxx b/src/GraphBase/DataFlowBase_DataPort.cxx index c60b7b2..7cd29b8 100644 --- a/src/GraphBase/DataFlowBase_DataPort.cxx +++ b/src/GraphBase/DataFlowBase_DataPort.cxx @@ -92,10 +92,11 @@ void GraphBase::DataPort::InitialValues(CORBA::Any aValue ) { else if ( !strcmp( Type , "float" ) ) { cdebug << "float" << endl ; #ifdef REDHAT // mkr : debug for PAL12255 - InitialValue <<= (double ) 0. ; + InitialValue <<= (float ) 0. ; #else - double d = 0.; - InitialValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR double d = 0.; +//JR InitialValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); + InitialValue <<= (CORBA::Float) 0. ; #endif } @@ -104,8 +105,9 @@ void GraphBase::DataPort::InitialValues(CORBA::Any aValue ) { #ifdef REDHAT // mkr : debug for PAL12255 InitialValue <<= (double ) 0. ; #else - double d = 0.; - InitialValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR double d = 0.; +//JR InitialValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); + InitialValue <<= (CORBA::Double) 0. ; #endif } else { // Default @@ -180,7 +182,8 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) { #ifdef REDHAT // mkr : debug for PAL12255 *theValue <<= d ; #else - theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); + *theValue <<= (CORBA::Double) d ; #endif *theValue >>= d ; #if ValueTrace @@ -250,7 +253,8 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) { #ifdef REDHAT // mkr : debug for PAL12255 *theValue <<= d ; #else - theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); + *theValue <<= (CORBA::Double) d ; #endif *theValue >>= d ; @@ -403,7 +407,8 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) { #ifdef REDHAT // mkr : debug for PAL12255 *theValue <<= d ; #else - theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); + *theValue <<= (CORBA::Double) d ; #endif *theValue >>= d; #if ValueTrace diff --git a/src/GraphBase/DataFlowBase_XmlHandler.cxx b/src/GraphBase/DataFlowBase_XmlHandler.cxx index 6f32e98..f745289 100644 --- a/src/GraphBase/DataFlowBase_XmlHandler.cxx +++ b/src/GraphBase/DataFlowBase_XmlHandler.cxx @@ -730,7 +730,8 @@ bool GraphBase::XmlHandler::endElement( const QString&, #ifdef REDHAT // mkr : debug for PAL12255 aLink.aLinkValue <<= (double ) 0. ; #else - aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); + aLink.aLinkValue <<= (CORBA::Double) 0. ; #endif aLink.aLinkValue >>= d; #if TRACE @@ -791,8 +792,10 @@ bool GraphBase::XmlHandler::endElement( const QString&, aLink.aLinkValue <<= d; aLinkValue <<= d; #else - aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); - aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); + aLink.aLinkValue <<= (CORBA::Double) d; + aLinkValue <<= (CORBA::Double) d; #endif aLinkDoubleValue = new CORBA::Any( aLinkValue ); #if TRACE diff --git a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx index 8aa1e9a..cec877a 100644 --- a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx +++ b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx @@ -3286,7 +3286,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , #ifdef REDHAT // mkr : debug for PAL12255 D.Value <<= f ; #else - D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); +//JR D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); + D.Value <<= (CORBA::Float) f ; #endif #if InParametersSetTrace cdebug << "string '" << t << "' --> " << setw(25) << setprecision(18) << d << " --> float " << " = " @@ -3300,7 +3301,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , #ifdef REDHAT // mkr : debug for PAL12255 D.Value <<= d ; #else - D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); + D.Value <<= (CORBA::Double) d ; #endif #if InParametersSetTrace cdebug << "string '" << t << " --> double " << setw(25) << setprecision(18) << d ; @@ -3371,7 +3373,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , #ifdef REDHAT // mkr : debug for PAL12255 D.Value <<= f ; #else - D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); +//JR D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); + D.Value <<= (CORBA::Float) f ; #endif // theOutPort->Value( D.Value ) ; } @@ -3381,7 +3384,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , #ifdef REDHAT // mkr : debug for PAL12255 D.Value <<= d ; #else - D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); + D.Value <<= (CORBA::Double) d ; #endif // theOutPort->Value( D.Value ) ; } @@ -3439,7 +3443,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , #ifdef REDHAT // mkr : debug for PAL12255 D.Value <<= f ; #else - D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); +//JR D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); + D.Value <<= (CORBA::Float) f ; #endif // theOutPort->Value( D.Value ) ; } @@ -3503,7 +3508,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , #ifdef REDHAT // mkr : debug for PAL12255 D.Value <<= f ; #else - D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); +//JR D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); + D.Value <<= (CORBA::Float) f ; #endif // theOutPort->Value( D.Value ) ; } @@ -3512,7 +3518,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , #ifdef REDHAT // mkr : debug for PAL12255 D.Value <<= d ; #else - D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); + D.Value <<= (CORBA::Double) d ; #endif // theOutPort->Value( D.Value ) ; } @@ -3604,7 +3611,8 @@ void GraphExecutor::InNode::InOutParametersSet( int nOutParams , #ifdef REDHAT // mkr : debug for PAL12255 D.Value <<= f ; #else - D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); +//JR D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); + D.Value <<= (CORBA::Float) f ; #endif } else if ( !strcmp( Type , "double" ) ) { @@ -3612,7 +3620,8 @@ void GraphExecutor::InNode::InOutParametersSet( int nOutParams , #ifdef REDHAT // mkr : debug for PAL12255 D.Value <<= d ; #else - D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); + D.Value <<= (CORBA::Double) d ; #endif } else { @@ -3762,7 +3771,8 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err , #ifdef REDHAT // mkr : debug for PAL12255 D.Value <<= d ; #else - D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); + D.Value <<= (CORBA::Double) d ; #endif #if OutParametersSetTrace cdebug << ThreadNo() << " " << f << "(float)" << endl ; diff --git a/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx b/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx index 8781b6e..8f13356 100644 --- a/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx +++ b/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx @@ -658,7 +658,8 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , #ifdef REDHAT // mkr : debug for PAL12255 data <<= f ; #else - data.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); +//JR data.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); + data <<= (CORBA::Float) f ; #endif #if PyDynInvokeTrace if ( ArgValue ) @@ -706,7 +707,8 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , #ifdef REDHAT // mkr : debug for PAL12255 data <<= d ; #else - data.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +//JR data.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); + data <<= (CORBA::Double) d ; #endif #if PyDynInvokeTrace if ( ArgValue ) -- 2.39.2