diff options
author | Mark Spruiell <mes@zeroc.com> | 2012-06-13 16:19:58 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2012-06-13 16:19:58 -0700 |
commit | f1f199b777e32d0ff2a566af6eaa363d391aa18e (patch) | |
tree | 4cf8e91f33967c24f2369319585057df222503f7 /cpp/src | |
parent | Fixed support unknown types in unknown optionals (diff) | |
download | ice-f1f199b777e32d0ff2a566af6eaa363d391aa18e.tar.bz2 ice-f1f199b777e32d0ff2a566af6eaa363d391aa18e.tar.xz ice-f1f199b777e32d0ff2a566af6eaa363d391aa18e.zip |
* Minor C++ fixes
* Adding UnknownSlicedObject in Java
Diffstat (limited to 'cpp/src')
-rwxr-xr-x | cpp/src/Ice/BasicStream.cpp | 3 | ||||
-rw-r--r-- | cpp/src/Ice/StreamI.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/StreamI.h | 2 | ||||
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 64 |
4 files changed, 17 insertions, 56 deletions
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index ddd4dfa60ac..f2f3bccbfce 100755 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -2322,7 +2322,8 @@ IceInternal::BasicStream::EncapsDecoder::throwException(const UserExceptionFacto // if(_sliceFlags & FLAG_IS_LAST_SLICE) { - throw NoExceptionFactoryException(__FILE__, __LINE__, "", "unknown exception type `" + mostDerivedId + "'"); + throw NoExceptionFactoryException(__FILE__, __LINE__, "unknown exception type `" + mostDerivedId + "'", + mostDerivedId); } try diff --git a/cpp/src/Ice/StreamI.cpp b/cpp/src/Ice/StreamI.cpp index 1db13f0f33c..91c658abcf2 100644 --- a/cpp/src/Ice/StreamI.cpp +++ b/cpp/src/Ice/StreamI.cpp @@ -678,9 +678,9 @@ OutputStreamI::pos() } void -OutputStreamI::rewrite(size_type p, Int sz) +OutputStreamI::rewrite(Int sz, size_type p) { - _os->rewrite(p, sz); + _os->rewrite(sz, p); } // diff --git a/cpp/src/Ice/StreamI.h b/cpp/src/Ice/StreamI.h index 4041d126efd..80b89408eac 100644 --- a/cpp/src/Ice/StreamI.h +++ b/cpp/src/Ice/StreamI.h @@ -165,7 +165,7 @@ public: virtual void reset(bool); virtual size_type pos(); - virtual void rewrite(size_type, Int); + virtual void rewrite(Int, size_type); private: diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index d12c7abe86c..433df9b3af6 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -1152,7 +1152,7 @@ Slice::JavaVisitor::writeDispatchAndMarshalling(Output& out, const ClassDefPtr& out << eb; out << nl << "else"; out << sb; - out << nl << "IceInternal.Ex.throwUOE(type(), v.ice_id());"; + out << nl << "IceInternal.Ex.throwUOE(type(), v);"; out << eb; if(allClassMembers.size() > 1) { @@ -2943,7 +2943,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) out << eb; out << nl << "else"; out << sb; - out << nl << "IceInternal.Ex.throwUOE(type(), v.ice_id());"; + out << nl << "IceInternal.Ex.throwUOE(type(), v);"; out << eb; if(allClassMembers.size() > 1) { @@ -3376,7 +3376,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) out << eb; out << nl << "else"; out << sb; - out << nl << "IceInternal.Ex.throwUOE(type(), v.ice_id());"; + out << nl << "IceInternal.Ex.throwUOE(type(), v);"; out << eb; if(classMembers.size() > 1) { @@ -3710,34 +3710,16 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) { out << sp << nl << "public void" << nl << "__write(IceInternal.BasicStream __os)"; out << sb; - if(sz <= 0x7f) - { - out << nl << "__os.writeByte((byte)ordinal());"; - } - else if(sz <= 0x7fff) - { - out << nl << "__os.writeShort((short)ordinal());"; - } - else - { - out << nl << "__os.writeInt(ordinal());"; - } + out << nl << "__os.writeEnum(ordinal(), " << sz << ");"; out << eb; out << sp << nl << "public static " << name << nl << "__read(IceInternal.BasicStream __is)"; out << sb; - if(sz <= 0x7f) - { - out << nl << "int __v = __is.readByte(" << sz << ");"; - } - else if(sz <= 0x7fff) - { - out << nl << "int __v = __is.readShort(" << sz << ");"; - } - else - { - out << nl << "int __v = __is.readInt(" << sz << ");"; - } + out << nl << "int __v = __is.readEnum(" << sz << ");"; + out << nl << "if(__v < 0 || __v >= " << sz << ')'; + out << sb; + out << nl << "throw new Ice.MarshalException(\"enumerator out of range\");"; + out << eb; out << nl << "return values()[__v];"; out << eb; @@ -3745,34 +3727,12 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) { out << sp << nl << "public void" << nl << "ice_write(Ice.OutputStream __outS)"; out << sb; - if(sz <= 0x7f) - { - out << nl << "__outS.writeByte((byte)ordinal());"; - } - else if(sz <= 0x7fff) - { - out << nl << "__outS.writeShort((short)ordinal());"; - } - else - { - out << nl << "__outS.writeInt(ordinal());"; - } + out << nl << "__outS.writeEnum(ordinal(), " << sz << ");"; out << eb; out << sp << nl << "public static " << name << nl << "ice_read(Ice.InputStream __inS)"; out << sb; - if(sz <= 0x7f) - { - out << nl << "int __v = __inS.readByte();"; - } - else if(sz <= 0x7fff) - { - out << nl << "int __v = __inS.readShort();"; - } - else - { - out << nl << "int __v = __inS.readInt();"; - } + out << nl << "int __v = __inS.readEnum(" << sz << ");"; out << nl << "if(__v < 0 || __v >= " << sz << ')'; out << sb; out << nl << "throw new Ice.MarshalException(\"enumerator out of range\");"; @@ -3953,7 +3913,7 @@ Slice::Gen::HolderVisitor::writeHolder(const TypePtr& p) out << eb; out << nl << "else"; out << sb; - out << nl << "IceInternal.Ex.throwUOE(type(), v.ice_id());"; + out << nl << "IceInternal.Ex.throwUOE(type(), v);"; out << eb; out << eb; out << sp << nl << "public String" << nl << "type()"; |