summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-05-18 18:32:08 +0000
committerBenoit Foucher <benoit@zeroc.com>2007-05-18 18:32:08 +0000
commit828b7f3c85d8d7ce94e56078be9d94c5b9f46fba (patch)
treeebbf1774c4dbebe51270bc9d0c5071d498974185 /cpp
parentRenabled slicing test (diff)
downloadice-828b7f3c85d8d7ce94e56078be9d94c5b9f46fba.tar.bz2
ice-828b7f3c85d8d7ce94e56078be9d94c5b9f46fba.tar.xz
ice-828b7f3c85d8d7ce94e56078be9d94c5b9f46fba.zip
Fixed bug 2215
Diffstat (limited to 'cpp')
-rwxr-xr-xcpp/src/slice2cs/Gen.cpp28
-rwxr-xr-xcpp/src/slice2vb/Gen.cpp28
2 files changed, 8 insertions, 48 deletions
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index 3a02f3b0107..83571591218 100755
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -186,16 +186,6 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream)
ids.merge(other);
ids.unique();
- //
- // We sort again to keep the order in the same order as the one
- // expected by System.Collections.Comparer.DefaultInvariant.
- //
-#if defined(__SUNPRO_CC)
- ids.sort(cICompare);
-#else
- ids.sort(Slice::CICompare());
-#endif
-
StringList::const_iterator firstIter = ids.begin();
StringList::const_iterator scopedIter = find(ids.begin(), ids.end(), scoped);
assert(scopedIter != ids.end());
@@ -221,12 +211,12 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream)
_out << sp << nl << "public override bool ice_isA(string s)";
_out << sb;
- _out << nl << "return _System.Array.BinarySearch(ids__, s, _System.Collections.Comparer.DefaultInvariant) >= 0;";
+ _out << nl << "return _System.Array.BinarySearch(ids__, s, IceUtil.StringUtil.OrdinalStringComparer) >= 0;";
_out << eb;
_out << sp << nl << "public override bool ice_isA(string s, Ice.Current current__)";
_out << sb;
- _out << nl << "return _System.Array.BinarySearch(ids__, s, _System.Collections.Comparer.DefaultInvariant) >= 0;";
+ _out << nl << "return _System.Array.BinarySearch(ids__, s, IceUtil.StringUtil.OrdinalStringComparer) >= 0;";
_out << eb;
_out << sp << nl << "public override string[] ice_ids()";
@@ -532,17 +522,7 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream)
allOpNames.push_back("ice_ids");
allOpNames.push_back("ice_isA");
allOpNames.push_back("ice_ping");
-
- //
- // We sort into case-insensitive order here because, at run time,
- // the sort order must match the sort order used by System.Array.Sort().
- // (C# has no notion of the default ASCII ordering.)
- //
-#if defined(__SUNPRO_CC)
- allOpNames.sort(Slice::cICompare);
-#else
- allOpNames.sort(Slice::CICompare());
-#endif
+ allOpNames.sort();
allOpNames.unique();
StringList::const_iterator q;
@@ -564,7 +544,7 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream)
<< "dispatch__(IceInternal.Incoming inS__, Ice.Current current__)";
_out << sb;
_out << nl << "int pos = _System.Array.BinarySearch(all__, current__.operation, "
- << "_System.Collections.Comparer.DefaultInvariant);";
+ << "IceUtil.StringUtil.OrdinalStringComparer);";
_out << nl << "if(pos < 0)";
_out << sb;
_out << nl << "throw new Ice.OperationNotExistException(current__.id, current__.facet, current__.operation);";
diff --git a/cpp/src/slice2vb/Gen.cpp b/cpp/src/slice2vb/Gen.cpp
index 581f312b610..8199e87d3c0 100755
--- a/cpp/src/slice2vb/Gen.cpp
+++ b/cpp/src/slice2vb/Gen.cpp
@@ -212,16 +212,6 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p)
ids.merge(other);
ids.unique();
- //
- // We sort again to keep the order in the same order as the one
- // expected by System.Collections.Comparer.DefaultInvariant.
- //
-#if defined(__SUNPRO_CC)
- ids.sort(cICompare);
-#else
- ids.sort(Slice::CICompare());
-#endif
-
StringList::const_iterator firstIter = ids.begin();
StringList::const_iterator scopedIter = find(ids.begin(), ids.end(), scoped);
assert(scopedIter != ids.end());
@@ -254,14 +244,14 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p)
_out << sp << nl << "Public Overloads Overrides Function ice_isA(ByVal s As String) As Boolean";
_out.inc();
- _out << nl << "Return _System.Array.BinarySearch(ids__, s, _System.Collections.Comparer.DefaultInvariant) >= 0";
+ _out << nl << "Return _System.Array.BinarySearch(ids__, s, IceUtil.StringUtil.OrdinalStringComparer) >= 0";
_out.dec();
_out << nl << "End Function";
_out << sp << nl << "Public Overloads Overrides Function ice_isA(ByVal s As String, Byval current__ As Ice.Current)"
" As Boolean";
_out.inc();
- _out << nl << "Return _System.Array.BinarySearch(ids__, s, _System.Collections.Comparer.DefaultInvariant) >= 0";
+ _out << nl << "Return _System.Array.BinarySearch(ids__, s, IceUtil.StringUtil.OrdinalStringComparer) >= 0";
_out.dec();
_out << nl << "End Function";
@@ -577,17 +567,7 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p)
allOpNames.push_back("ice_ids");
allOpNames.push_back("ice_isA");
allOpNames.push_back("ice_ping");
-
- //
- // We sort into case-insensitive order here because, at run time,
- // the sort order must match the sort order used by System.Array.Sort().
- // (C# has no notion of the default ASCII ordering.)
- //
-#if defined(__SUNPRO_CC)
- allOpNames.sort(Slice::cICompare);
-#else
- allOpNames.sort(Slice::CICompare());
-#endif
+ allOpNames.sort();
allOpNames.unique();
StringList::const_iterator q;
@@ -619,7 +599,7 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p)
_out.dec();
_out << nl << "Dim pos As Integer";
_out << nl << "pos = _System.Array.BinarySearch(all__, current__.operation, "
- << "_System.Collections.Comparer.DefaultInvariant)";
+ << "IceUtil.StringUtil.OrdinalStringComparer)";
_out << nl << "If pos < 0 Then";
_out.inc();
_out << nl << "Throw New Ice.ObjectNotExistException(current__.id, current__.facet, current__.operation)";