diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-02-20 14:27:41 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-02-20 14:27:41 +0100 |
commit | af1544e7b81e8708c5fdee05a59328558a3030fe (patch) | |
tree | 0933eb39159b8cf714aab7fe5901d0515674d7c6 /cpp/src/Slice/RubyUtil.cpp | |
parent | Simplification to Atomic usage (diff) | |
download | ice-af1544e7b81e8708c5fdee05a59328558a3030fe.tar.bz2 ice-af1544e7b81e8708c5fdee05a59328558a3030fe.tar.xz ice-af1544e7b81e8708c5fdee05a59328558a3030fe.zip |
Fix for ICE-6268, initialize enum, string and structs in Java/C#/Objective-C/JavaScript
Diffstat (limited to 'cpp/src/Slice/RubyUtil.cpp')
-rw-r--r-- | cpp/src/Slice/RubyUtil.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp index c895d3fbf55..bc90db3f1b3 100644 --- a/cpp/src/Slice/RubyUtil.cpp +++ b/cpp/src/Slice/RubyUtil.cpp @@ -64,7 +64,7 @@ private: // // Get an initializer value for a given type. // - string getInitializer(const TypePtr&); + string getInitializer(const DataMemberPtr&); // // Add a value to a hash code. @@ -113,8 +113,8 @@ lookupKwd(const string& name) // conflict with a Slice identifier, so names such as "inspect" and // "send" are included but "to_s" is not. // - static const string keywordList[] = - { + static const string keywordList[] = + { "BEGIN", "END", "alias", "and", "begin", "break", "case", "class", "clone", "def", "display", "do", "dup", "else", "elsif", "end", "ensure", "extend", "false", "for", "freeze", "hash", "if", "in", "initialize_copy", "inspect", "instance_eval", "instance_variable_get", "instance_variable_set", "instance_variables", "method", @@ -1363,8 +1363,9 @@ Slice::Ruby::CodeVisitor::writeType(const TypePtr& p) } string -Slice::Ruby::CodeVisitor::getInitializer(const TypePtr& p) +Slice::Ruby::CodeVisitor::getInitializer(const DataMemberPtr& m) { + TypePtr p = m->type(); BuiltinPtr builtin = BuiltinPtr::dynamicCast(p); if(builtin) { @@ -1582,7 +1583,7 @@ Slice::Ruby::CodeVisitor::writeConstructorParams(const MemberInfoList& members) } else { - _out << getInitializer(member->type()); + _out << getInitializer(member); } } } |