summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/VbUtil.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2004-10-27 04:42:20 +0000
committerMichi Henning <michi@zeroc.com>2004-10-27 04:42:20 +0000
commit0ef42dc2c6d04aa10b69f5719a9440b1705277d5 (patch)
tree95a91be789e3af24b5a73b7d3b05faaf86a564ad /cpp/src/Slice/VbUtil.cpp
parent- Fixed a bug in slice2cs: the generated code was incorrect for (diff)
downloadice-0ef42dc2c6d04aa10b69f5719a9440b1705277d5.tar.bz2
ice-0ef42dc2c6d04aa10b69f5719a9440b1705277d5.tar.xz
ice-0ef42dc2c6d04aa10b69f5719a9440b1705277d5.zip
Fixed bug in code generator: dictionaries with value types that were
sequences mapped to arrays resulted in incorrect code.
Diffstat (limited to 'cpp/src/Slice/VbUtil.cpp')
-rwxr-xr-xcpp/src/Slice/VbUtil.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/cpp/src/Slice/VbUtil.cpp b/cpp/src/Slice/VbUtil.cpp
index 76497a14d83..7d934b1fd5a 100755
--- a/cpp/src/Slice/VbUtil.cpp
+++ b/cpp/src/Slice/VbUtil.cpp
@@ -187,23 +187,6 @@ Slice::VbGenerator::typeToString(const TypePtr& type)
return "???";
}
-static string
-toArrayAlloc(const string& decl, const string& sz)
-{
- int count = 0;
- string::size_type pos = decl.size();
- while(pos > 1 && decl.substr(pos - 2, 2) == "()")
- {
- ++count;
- pos -= 2;
- }
- assert(count > 0);
-
- ostringstream o;
- o << decl.substr(0, pos) << '(' << sz << ')' << decl.substr(pos + 2);
- return o.str();
-}
-
bool
Slice::VbGenerator::isValueType(const TypePtr& type)
{
@@ -812,6 +795,23 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
return;
}
+string
+Slice::VbGenerator::toArrayAlloc(const string& decl, const string& sz)
+{
+ int count = 0;
+ string::size_type pos = decl.size();
+ while(pos > 1 && decl.substr(pos - 2, 2) == "()")
+ {
+ ++count;
+ pos -= 2;
+ }
+ assert(count > 0);
+
+ ostringstream o;
+ o << decl.substr(0, pos) << '(' << sz << ')' << decl.substr(pos + 2);
+ return o.str();
+}
+
void
Slice::VbGenerator::validateMetaData(const UnitPtr& unit)
{