*** omniORB2_980410/src/lib/omniORB2/any.cc Wed Apr 8 17:07:33 1998 --- new/src/lib/omniORB2/any.cc Mon Aug 10 19:08:29 1998 *************** *** 28,33 **** --- 28,42 ---- /* $Log: any.cc,v $ + // Revision 1.5 1998/08/10 18:08:26 sll + // Fixed Any ctor and Any::replace() for untyped values. Now accept null + // pointer for the value parameter for all typecode types. + // + * Revision 1.4 1998/08/05 18:03:36 sll + * Fixed bug in Any::operator>>=(NetBufferedStream|MemBufferedStream). + * Previously, basic data types other than any, objref and typecode would be + * marshalled incorrectly. + * * Revision 1.3 1998/04/08 16:07:32 sll * Minor change to help some compiler to find the right TypeCode ctor. * *************** *** 106,118 **** if (release) delete[] _val; } ! else if (!tc->NP_expandEqual(CORBA::_tc_null,1) && ! !tc->NP_expandEqual(CORBA::_tc_void,1)) ! { ! CORBA::release(pd_tc); ! pd_tc = 0; ! throw CORBA::BAD_PARAM(0,CORBA::COMPLETED_NO); ! } } --- 115,124 ---- if (release) delete[] _val; } ! else { ! // value == 0, If the typecode is not _tc_null or _tc_void, this ! // any is partially initialised with only the typecode and no value. ! } } *************** *** 191,196 **** --- 197,204 ---- CORBA::tk_string) fillerLen = (pd_tc->pd_param).alreadyWritten() % 4; + MemBufferedStream tmpInBuf(pd_mbuf,1); + #if !defined(NO_FLOAT) if ((pd_tc->pd_tck == CORBA::tk_double || pd_tc->pd_tck == CORBA::tk_any || pd_tc->pd_tck == CORBA::tk_struct || pd_tc->pd_tck == CORBA::tk_union || *************** *** 198,204 **** s.WrMessageAlreadyWritten()%8 > 0 && s.WrMessageAlreadyWritten()%8 <= 4) { MemBufferedStream outBuf; - MemBufferedStream tmpInBuf(pd_mbuf,1); PR_fill(fillerLen,outBuf); tmpInBuf.skip(fillerLen); --- 206,211 ---- *************** *** 213,221 **** else #endif { ! s.put_char_array((_CORBA_Char*) (omni::ptr_arith_t) pd_mbuf.data() + (omni::ptr_arith_t) fillerLen, ! pd_mbuf.alreadyWritten() - fillerLen); } } --- 220,228 ---- else #endif { ! s.put_char_array((_CORBA_Char*) (omni::ptr_arith_t) tmpInBuf.data() + (omni::ptr_arith_t) fillerLen, ! tmpInBuf.alreadyWritten() - fillerLen); } } *************** *** 239,244 **** --- 246,252 ---- if (pd_tc->pd_tck > CORBA::tk_Principal && pd_tc->pd_tck != CORBA::tk_string) fillerLen = (pd_tc->pd_param).alreadyWritten() % 4; + MemBufferedStream tmpInBuf(pd_mbuf,1); #if !defined(NO_FLOAT) if ((pd_tc->pd_tck == CORBA::tk_double || pd_tc->pd_tck == CORBA::tk_any || *************** *** 246,252 **** pd_tc->pd_tck > CORBA::tk_string) && m.alreadyWritten()%8 > 0 && m.alreadyWritten()%8 <= 4) { - MemBufferedStream tmpInBuf(pd_mbuf,1); tmpInBuf.skip(fillerLen); tcParseEngine tcEngine(pd_tc,&tmpInBuf); --- 254,259 ---- *************** *** 255,263 **** else #endif { ! m.put_char_array((_CORBA_Char*) (omni::ptr_arith_t) pd_mbuf.data() + (omni::ptr_arith_t) fillerLen, ! pd_mbuf.alreadyWritten() - fillerLen); } } --- 262,270 ---- else #endif { ! m.put_char_array((_CORBA_Char*) (omni::ptr_arith_t) tmpInBuf.data() + (omni::ptr_arith_t) fillerLen, ! tmpInBuf.alreadyWritten() - fillerLen); } } *************** *** 561,574 **** tcEngine.parse(dbuf); if (release) delete[] _val; } ! else if (!tc->NP_expandEqual(CORBA::_tc_null,1) && ! !tc->NP_expandEqual(CORBA::_tc_void,1)) ! { ! CORBA::release(pd_tc); ! pd_tc = 0; ! throw CORBA::BAD_PARAM(0,CORBA::COMPLETED_NO); ! } ! pd_mbuf = dbuf; } --- 568,577 ---- tcEngine.parse(dbuf); if (release) delete[] _val; } ! else { ! // value == 0, If the typecode is not _tc_null or _tc_void, this ! // any is partially initialised with only the typecode and no value. ! } pd_mbuf = dbuf; }