diff options
-rw-r--r-- | TAO/tao/append.cpp | 65 | ||||
-rw-r--r-- | TAO/tao/skip.cpp | 66 |
2 files changed, 60 insertions, 71 deletions
diff --git a/TAO/tao/append.cpp b/TAO/tao/append.cpp index e9f62a5b12d..0994618a02e 100644 --- a/TAO/tao/append.cpp +++ b/TAO/tao/append.cpp @@ -3,15 +3,15 @@ // ============================================================================ // // = LIBRARY -// TAO +// TAO // // = FILENAME -// append.cpp +// append.cpp // // = DESCRIPTION -// Appends a CDR stream to another CDR stream. Due to the stringent alignment -// requirements, it is not possible to simply append or memcpy. Instead we go -// thru the same CDR encoding rules +// Appends a CDR stream to another CDR stream. Due to the stringent alignment +// requirements, it is not possible to simply append or memcpy. Instead we go +// thru the same CDR encoding rules // // = AUTHOR // Copyright 1994-1995 by Sun Microsystems Inc. @@ -86,8 +86,10 @@ TAO_Marshal_Primitive::append (CORBA::TypeCode_ptr tc, return CORBA::TypeCode::TRAVERSE_CONTINUE; if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO_Marshal_Primitive::append detected error\n"))); + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Primitive::append detected error\n") + )); ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), @@ -139,7 +141,7 @@ CORBA::TypeCode::traverse_status TAO_Marshal_TypeCode::append (CORBA::TypeCode_ptr, TAO_InputCDR *src, TAO_OutputCDR *dest, - CORBA::Environment &ACE_TRY_ENV) + CORBA::Environment &ACE_TRY_ENV) { CORBA::Boolean continue_append = 1; CORBA::TypeCode::traverse_status retval = @@ -232,16 +234,16 @@ TAO_Marshal_TypeCode::append (CORBA::TypeCode_ptr, return CORBA::TypeCode::TRAVERSE_CONTINUE; if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO_Marshal_TypeCode::append detected error\n"))); + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_TypeCode::append detected error\n") + )); ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); } -// Encode Principal. - CORBA::TypeCode::traverse_status TAO_Marshal_Principal::append (CORBA::TypeCode_ptr, TAO_InputCDR *src, @@ -278,8 +280,8 @@ TAO_Marshal_ObjRef::append (CORBA::TypeCode_ptr, CORBA::ULong profiles = 0; - // get the count of profiles that follow. This will tell us the length of the - // sequence + // get the count of profiles that follow. This will tell us the + // length of the sequence continue_append = (CORBA::Boolean) (src->read_ulong (profiles) ? dest->write_ulong (profiles) : 0); @@ -307,9 +309,10 @@ TAO_Marshal_ObjRef::append (CORBA::TypeCode_ptr, ACE_NEW_RETURN (body, CORBA::Octet[length], CORBA::TypeCode::TRAVERSE_STOP); - continue_append = (CORBA::Boolean) (src->read_octet_array (body, length) - ? dest->write_octet_array (body, length) - : 0); + continue_append = + (CORBA::Boolean) (src->read_octet_array (body, length) + ? dest->write_octet_array (body, length) + : 0); delete [] body; } @@ -317,14 +320,16 @@ TAO_Marshal_ObjRef::append (CORBA::TypeCode_ptr, return CORBA::TypeCode::TRAVERSE_CONTINUE; if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO_Marshal_ObjRef::append detected error\n"))); + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_ObjRef::append detected error\n") + )); ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); } -// Decode structs. CORBA::TypeCode::traverse_status TAO_Marshal_Struct::append (CORBA::TypeCode_ptr tc, TAO_InputCDR *src, @@ -339,8 +344,8 @@ TAO_Marshal_Struct::append (CORBA::TypeCode_ptr tc, int member_count = tc->member_count (ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP); - for (int i = 0; i < member_count - && retval == CORBA::TypeCode::TRAVERSE_CONTINUE; + for (int i = 0; + i < member_count && retval == CORBA::TypeCode::TRAVERSE_CONTINUE; i++) { // get member type @@ -367,7 +372,6 @@ TAO_Marshal_Struct::append (CORBA::TypeCode_ptr tc, CORBA::TypeCode::TRAVERSE_STOP); } -// Encode unions. CORBA::TypeCode::traverse_status TAO_Marshal_Union::append (CORBA::TypeCode_ptr tc, TAO_InputCDR *src, @@ -599,7 +603,6 @@ TAO_Marshal_Union::append (CORBA::TypeCode_ptr tc, ACE_TRY_ENV); } -// decode string CORBA::TypeCode::traverse_status TAO_Marshal_String::append (CORBA::TypeCode_ptr, TAO_InputCDR *src, @@ -629,8 +632,6 @@ TAO_Marshal_String::append (CORBA::TypeCode_ptr, CORBA::TypeCode::TRAVERSE_STOP); } -// Decode sequence. - CORBA::TypeCode::traverse_status TAO_Marshal_Sequence::append (CORBA::TypeCode_ptr tc, TAO_InputCDR *src, @@ -669,29 +670,26 @@ TAO_Marshal_Sequence::append (CORBA::TypeCode_ptr tc, dest, ACE_TRY_ENV); } - // CORBA::release (tc2); if (retval == CORBA::TypeCode::TRAVERSE_CONTINUE) return CORBA::TypeCode::TRAVERSE_CONTINUE; } // error exit if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("marshaling TAO_Marshal_Sequence::append detected error\n"))); + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("marshaling TAO_Marshal_Sequence::append detected error\n") + )); ACE_THROW_RETURN (CORBA::MARSHAL (), CORBA::TypeCode::TRAVERSE_STOP); } -// Decode array. - CORBA::TypeCode::traverse_status TAO_Marshal_Array::append (CORBA::TypeCode_ptr tc, TAO_InputCDR *src, TAO_OutputCDR *dest, CORBA::Environment &ACE_TRY_ENV) { - // unused: CORBA::Boolean continue_append = 1; - // Return status. CORBA::TypeCode::traverse_status retval = CORBA::TypeCode::TRAVERSE_CONTINUE; @@ -730,7 +728,6 @@ TAO_Marshal_Array::append (CORBA::TypeCode_ptr tc, CORBA::TypeCode::TRAVERSE_STOP); } -// Decode alias. CORBA::TypeCode::traverse_status TAO_Marshal_Alias::append (CORBA::TypeCode_ptr tc, TAO_InputCDR *src, @@ -754,7 +751,6 @@ TAO_Marshal_Alias::append (CORBA::TypeCode_ptr tc, ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP); - // tc2->_decr_refcnt (); if (retval == CORBA::TypeCode::TRAVERSE_CONTINUE && continue_append == 1) return CORBA::TypeCode::TRAVERSE_CONTINUE; @@ -817,7 +813,6 @@ TAO_Marshal_Except::append (CORBA::TypeCode_ptr tc, CORBA::TypeCode::TRAVERSE_STOP); } -// decode wstring CORBA::TypeCode::traverse_status TAO_Marshal_WString::append (CORBA::TypeCode_ptr, TAO_InputCDR *src, diff --git a/TAO/tao/skip.cpp b/TAO/tao/skip.cpp index 0325bbdff57..cc5ce9094d4 100644 --- a/TAO/tao/skip.cpp +++ b/TAO/tao/skip.cpp @@ -3,16 +3,16 @@ // ============================================================================ // // = LIBRARY -// TAO +// TAO // // = FILENAME -// skip.cpp +// skip.cpp // // = DESCRIPTION -// Code for skipping different data types +// Code for skipping different data types // -// Data types encoded as CDR streams need to be skipped when they are part of -// an Any. +// Data types encoded as CDR streams need to be skipped when they are part of +// an Any. // // = AUTHOR // Aniruddha Gokhale @@ -81,8 +81,10 @@ TAO_Marshal_Primitive::skip (CORBA::TypeCode_ptr tc, else { if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO_Marshal_Primitive::skip detected error\n"))); + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Primitive::skip detected error\n") + )); ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); @@ -91,8 +93,8 @@ TAO_Marshal_Primitive::skip (CORBA::TypeCode_ptr tc, CORBA::TypeCode::traverse_status TAO_Marshal_Any::skip (CORBA::TypeCode_ptr, - TAO_InputCDR *stream, - CORBA::Environment &ACE_TRY_ENV) + TAO_InputCDR *stream, + CORBA::Environment &ACE_TRY_ENV) { // Typecode of the element that makes the Any. CORBA::TypeCode_var elem_tc; @@ -109,15 +111,10 @@ TAO_Marshal_Any::skip (CORBA::TypeCode_ptr, CORBA::TypeCode::traverse_status TAO_Marshal_TypeCode::skip (CORBA::TypeCode_ptr, TAO_InputCDR *stream, - CORBA::Environment &ACE_TRY_ENV) + CORBA::Environment &ACE_TRY_ENV) { CORBA::Boolean continue_skipping = 1; -#if 0 - // Typecode to be decoded. - CORBA::TypeCode_ptr *tcp; -#endif /* 0 */ - // Typecode kind. CORBA::ULong kind; @@ -194,20 +191,20 @@ TAO_Marshal_TypeCode::skip (CORBA::TypeCode_ptr, else { if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO_Marshal_TypeCode::skip detected error\n"))); + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_TypeCode::skip detected error\n") + )); ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); } } -// Encode Principal. - CORBA::TypeCode::traverse_status TAO_Marshal_Principal::skip (CORBA::TypeCode_ptr, - TAO_InputCDR *stream, - CORBA::Environment &ACE_TRY_ENV) + TAO_InputCDR *stream, + CORBA::Environment &ACE_TRY_ENV) { CORBA::Boolean continue_skipping = 1; @@ -225,8 +222,10 @@ TAO_Marshal_Principal::skip (CORBA::TypeCode_ptr, else { if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO_Marshal_Principal::skip detected error\n"))); + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Principal::skip detected error\n") + )); ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); @@ -241,7 +240,8 @@ TAO_Marshal_ObjRef::skip (CORBA::TypeCode_ptr, CORBA::Boolean continue_skipping = 1; // return status - CORBA::TypeCode::traverse_status retval = CORBA::TypeCode::TRAVERSE_CONTINUE; + CORBA::TypeCode::traverse_status retval = + CORBA::TypeCode::TRAVERSE_CONTINUE; // First, skip the type hint. This will be the type_id encoded in an // object reference. @@ -285,19 +285,20 @@ TAO_Marshal_ObjRef::skip (CORBA::TypeCode_ptr, else { if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO_Marshal_ObjRef::skip detected error\n"))); + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_ObjRef::skip detected error\n") + )); ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); } } -// Decode structs. CORBA::TypeCode::traverse_status TAO_Marshal_Struct::skip (CORBA::TypeCode_ptr tc, - TAO_InputCDR *stream, - CORBA::Environment &ACE_TRY_ENV) + TAO_InputCDR *stream, + CORBA::Environment &ACE_TRY_ENV) { CORBA::TypeCode::traverse_status retval = CORBA::TypeCode::TRAVERSE_CONTINUE; @@ -331,7 +332,6 @@ TAO_Marshal_Struct::skip (CORBA::TypeCode_ptr tc, CORBA::TypeCode::TRAVERSE_STOP); } -// Encode unions. CORBA::TypeCode::traverse_status TAO_Marshal_Union::skip (CORBA::TypeCode_ptr tc, TAO_InputCDR *src, @@ -552,7 +552,6 @@ TAO_Marshal_Union::skip (CORBA::TypeCode_ptr tc, ACE_TRY_ENV); } -// decode string CORBA::TypeCode::traverse_status TAO_Marshal_String::skip (CORBA::TypeCode_ptr, TAO_InputCDR *stream, @@ -582,8 +581,6 @@ TAO_Marshal_String::skip (CORBA::TypeCode_ptr, } } -// Decode sequence. - CORBA::TypeCode::traverse_status TAO_Marshal_Sequence::skip (CORBA::TypeCode_ptr tc, TAO_InputCDR *stream, @@ -635,8 +632,6 @@ TAO_Marshal_Sequence::skip (CORBA::TypeCode_ptr tc, CORBA::TypeCode::TRAVERSE_STOP); } -// Decode array. - CORBA::TypeCode::traverse_status TAO_Marshal_Array::skip (CORBA::TypeCode_ptr tc, TAO_InputCDR *stream, @@ -676,7 +671,6 @@ TAO_Marshal_Array::skip (CORBA::TypeCode_ptr tc, CORBA::TypeCode::TRAVERSE_STOP); } -// Decode alias. CORBA::TypeCode::traverse_status TAO_Marshal_Alias::skip (CORBA::TypeCode_ptr tc, TAO_InputCDR *stream, |