diff options
author | Michi Henning <michi@zeroc.com> | 2004-06-15 06:33:57 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2004-06-15 06:33:57 +0000 |
commit | adbc6ee084567a2fe6a696b7f67c80000e517ff8 (patch) | |
tree | ad301b9b578daa2ffa73a79210e2d812e4a9924d /cpp/src/slice2java/Gen.cpp | |
parent | default behavior of IcePatch client now calculates MD5s dynamically for (diff) | |
download | ice-adbc6ee084567a2fe6a696b7f67c80000e517ff8.tar.bz2 ice-adbc6ee084567a2fe6a696b7f67c80000e517ff8.tar.xz ice-adbc6ee084567a2fe6a696b7f67c80000e517ff8.zip |
- Added isOpen() method to OutputUtil.
- Removed calls to strerror(errno) in slice2cpp and slice2cs because the
std::fstream operations do not set errno when something goes wrong, so
any error messages always showed "no error" at the end.
- Added support for --impl option to slice2cs.
- Found two places in slice2java where exceptions where exception handlers
were not ordered into derived-to-base order.
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index 90ed3ccb2be..c167cd4d92e 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -3445,11 +3445,23 @@ Slice::Gen::BaseImplVisitor::writeOperation(Output& out, const string& package, ExceptionList throws = op->throws(); throws.sort(); throws.unique(); + + // + // Arrange exceptions into most-derived to least-derived order. If we don't + // do this, a base exception handler can appear before a derived exception + // handler, causing compiler warnings and resulting in the base exception + // being marshaled instead of the derived exception. + // +#if defined(__SUNPRO_CC) + throws.sort(Slice::derivedToBaseCompare); +#else + throws.sort(Slice::DerivedToBaseCompare()); +#endif writeThrowsClause(package, throws); out << sb; - string result = "r"; + string result = "__r"; ParamDeclList paramList = op->parameters(); ParamDeclList::const_iterator q; for(q = paramList.begin(); q != paramList.end(); ++q) @@ -3504,6 +3516,18 @@ Slice::Gen::BaseImplVisitor::writeOperation(Output& out, const string& package, ExceptionList throws = op->throws(); throws.sort(); throws.unique(); + + // + // Arrange exceptions into most-derived to least-derived order. If we don't + // do this, a base exception handler can appear before a derived exception + // handler, causing compiler warnings and resulting in the base exception + // being marshaled instead of the derived exception. + // +#if defined(__SUNPRO_CC) + throws.sort(Slice::derivedToBaseCompare); +#else + throws.sort(Slice::DerivedToBaseCompare()); +#endif writeThrowsClause(package, throws); out << sb; |