diff -rc src/lib/omniORB2/dynamic/tcParser.cc newsrc/lib/omniORB2/dynamic/tcParser.cc *** src/lib/omniORB2/dynamic/tcParser.cc Thu Mar 11 16:31:35 1999 --- newsrc/lib/omniORB2/dynamic/tcParser.cc Mon Apr 19 14:27:14 1999 *************** *** 139,155 **** eat[0].simple.alignment); } else if( eat.has_only_simple() ) { ! // Calculate the size of the elements, and copy the first ... ! CORBA::ULong elemsize = 0; for( unsigned j = 0; j < eat.entries(); j++ ) { ! elemsize = omni::align_to(elemsize, eat[j].simple.alignment); ! elemsize += eat[j].simple.size; obuf.copy_from(ibuf, eat[j].simple.size, eat[j].simple.alignment); } // ... then copy the rest as a block. ! obuf.copy_from(ibuf, (length - 1) * elemsize, ! eat[0].simple.alignment); } else { // We can't do better than copying element by element. --- 139,160 ---- eat[0].simple.alignment); } else if( eat.has_only_simple() ) { ! // Copy the first element ... ! CORBA::ULong start = 0; for( unsigned j = 0; j < eat.entries(); j++ ) { ! start = omni::align_to(start, eat[j].simple.alignment); ! start += eat[j].simple.size; obuf.copy_from(ibuf, eat[j].simple.size, eat[j].simple.alignment); } + // Calculate the size of subsequent elements ... + CORBA::ULong end = start; + for( unsigned k = 0; k < eat.entries(); k++ ) { + end = omni::align_to(end, eat[k].simple.alignment); + end += eat[k].simple.size; + } // ... then copy the rest as a block. ! obuf.copy_from(ibuf, (length - 1) * (end - start)); } else { // We can't do better than copying element by element. *************** *** 370,375 **** --- 375,381 ---- { CORBA::Any d; d <<= buf; break; } case CORBA::tk_Principal: + case CORBA::tk_string: { CORBA::ULong len; len <<= buf; *************** *** 383,396 **** case CORBA::tk_TypeCode: { CORBA::TypeCode_member d; d <<= buf; break; } - case CORBA::tk_string: - { - CORBA::ULong len; - len <<= buf; - buf.skip(len); - break; - } - case CORBA::tk_union: { // Fetch the discriminator value. --- 389,394 ---- *************** *** 421,437 **** buf.skip(eat[0].simple.size + (length - 1) * size_aligned); } else if( eat.has_only_simple() ) { ! // Calculate the size of the elements, and skip the first ... ! CORBA::ULong elemsize = 0; for( unsigned j = 0; j < eat.entries(); j++ ) { ! elemsize = omni::align_to(elemsize, eat[j].simple.alignment); ! elemsize += eat[j].simple.size; buf.get_char_array(&dummy, 0, eat[j].simple.alignment); buf.skip(eat[j].simple.size); } // ... then skip the rest as a block. ! buf.get_char_array(&dummy, 0, eat[0].simple.alignment); ! buf.skip((length - 1) * elemsize); } else { // We can't do better than skipping element by element. --- 419,440 ---- buf.skip(eat[0].simple.size + (length - 1) * size_aligned); } else if( eat.has_only_simple() ) { ! // Skip the first element ... ! CORBA::ULong start = 0; for( unsigned j = 0; j < eat.entries(); j++ ) { ! start = omni::align_to(start, eat[j].simple.alignment); ! start += eat[j].simple.size; buf.get_char_array(&dummy, 0, eat[j].simple.alignment); buf.skip(eat[j].simple.size); } + // Calculate the size of subsequent elements ... + CORBA::ULong end = start; + for( unsigned k = 0; k < eat.entries(); k++ ) { + end = omni::align_to(end, eat[k].simple.alignment); + end += eat[k].simple.size; + } // ... then skip the rest as a block. ! buf.skip((length - 1) * (end - start)); } else { // We can't do better than skipping element by element. diff -rc src/lib/omniORB2/dynamic/typecode.cc newsrc/lib/omniORB2/dynamic/typecode.cc *** src/lib/omniORB2/dynamic/typecode.cc Thu Mar 11 16:31:33 1999 --- newsrc/lib/omniORB2/dynamic/typecode.cc Mon Apr 19 14:25:59 1999 *************** *** 1675,1690 **** (pd_length - 1) * size_aligned); } else if( eat.has_only_simple() ) { // We need to copy the first element separately, and then the ! // rest as a simple block. pd_alignmentTable.setNumEntries(eat.entries() + 1); ! CORBA::ULong elemsize = 0; for( unsigned i = 0; i < eat.entries(); i++ ) { pd_alignmentTable.add(eat, i); ! elemsize = omni::align_to(elemsize, eat[i].simple.alignment); ! elemsize += eat[i].simple.size; } ! pd_alignmentTable.addSimple(eat[0].simple.alignment, ! (pd_length - 1) * elemsize); } else { pd_alignmentTable.setNumEntries(1); pd_alignmentTable.addNasty(this); --- 1675,1697 ---- (pd_length - 1) * size_aligned); } else if( eat.has_only_simple() ) { // We need to copy the first element separately, and then the ! // rest as a simple block. This is possible because a struct of ! // simple blocks will always finish with the same alignment ! // (modulo the max alignment requirement of the elements). pd_alignmentTable.setNumEntries(eat.entries() + 1); ! CORBA::ULong start = 0; for( unsigned i = 0; i < eat.entries(); i++ ) { pd_alignmentTable.add(eat, i); ! start = omni::align_to(start, eat[i].simple.alignment); ! start += eat[i].simple.size; } ! CORBA::ULong end = start; ! for( unsigned j = 0; j < eat.entries(); j++ ) { ! end = omni::align_to(end, eat[j].simple.alignment); ! end += eat[j].simple.size; ! } ! pd_alignmentTable.addSimple(omni::ALIGN_1, ! (pd_length - 1) * (end - start)); } else { pd_alignmentTable.setNumEntries(1); pd_alignmentTable.addNasty(this);