diff options
author | Mark Spruiell <mes@zeroc.com> | 2005-02-04 22:22:10 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2005-02-04 22:22:10 +0000 |
commit | 38bb8b5c01b05c829194cf115492cbfa2266777f (patch) | |
tree | 4fa97b214d0d5ff8f9c4f2ba5a987f7837173bae /cpp/src/slice2cpp | |
parent | fixes (diff) | |
download | ice-38bb8b5c01b05c829194cf115492cbfa2266777f.tar.bz2 ice-38bb8b5c01b05c829194cf115492cbfa2266777f.tar.xz ice-38bb8b5c01b05c829194cf115492cbfa2266777f.zip |
removing call to startSeq/endSeq for sequence of fixed-length type
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index b6e8243cecb..d8ad0f26ab7 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -841,7 +841,14 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) C << sb; C << nl << "::Ice::Int sz;"; C << nl << "__is->readSize(sz);"; - C << nl << "__is->startSeq(sz, " << type->minWireSize() << ");"; // Protect against bogus sequence sizes. + if(type->isVariableLength()) + { + C << nl << "__is->startSeq(sz, " << type->minWireSize() << ");"; // Protect against bogus sequence sizes. + } + else + { + C << nl << "__is->checkFixedSeq(sz, " << type->minWireSize() << ");"; + } C << nl << "v.resize(sz);"; C << nl << "for(int i = 0; i < sz; ++i)"; C << sb; @@ -861,7 +868,7 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) if(!SequencePtr::dynamicCast(type)) { // - // No need to check for directly nested sequences because, at the at start of each + // No need to check for directly nested sequences because, at the start of each // sequence, we check anyway. // C << nl << "__is->checkSeq();"; @@ -869,7 +876,10 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) C << nl << "__is->endElement();"; } C << eb; - C << nl << "__is->endSeq(sz);"; + if(type->isVariableLength()) + { + C << nl << "__is->endSeq(sz);"; + } C << eb; if(_stream) |