diff options
author | Michi Henning <michi@zeroc.com> | 2004-10-27 04:42:20 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2004-10-27 04:42:20 +0000 |
commit | 0ef42dc2c6d04aa10b69f5719a9440b1705277d5 (patch) | |
tree | 95a91be789e3af24b5a73b7d3b05faaf86a564ad /cpp/src/Slice/VbUtil.cpp | |
parent | - Fixed a bug in slice2cs: the generated code was incorrect for (diff) | |
download | ice-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-x | cpp/src/Slice/VbUtil.cpp | 34 |
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) { |