Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Jan 22, 2024
1 parent 5060fc7 commit 6d20a06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions ruby/src/IceRuby/Types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ IceRuby::DictionaryInfo::marshal(VALUE p, Ice::OutputStream* os, ValueMap* value
os->writeSize(sz);
if(sz > 0)
{
DictionaryMarshalIterator iter(dynamic_pointer_cast<DictionaryInfo>(shared_from_this()), os, valueMap);
DictionaryMarshalIterator iter(shared_from_this(), os, valueMap);
hashIterate(hash, iter);
}
}
Expand Down Expand Up @@ -1929,7 +1929,7 @@ IceRuby::DictionaryInfo::print(VALUE value, IceUtilInternal::Output& out, PrintO
}

out.sb();
DictionaryPrintIterator iter(dynamic_pointer_cast<DictionaryInfo>(shared_from_this()), out, history);
DictionaryPrintIterator iter(shared_from_this(), out, history);
hashIterate(hash, iter);
out.eb();
}
Expand Down Expand Up @@ -2050,7 +2050,7 @@ IceRuby::ClassInfo::validate(VALUE val)
assert(!NIL_P(type));
ClassInfoPtr info = dynamic_pointer_cast<ClassInfo>(getType(type));
assert(info);
return this->interface || info->isA(dynamic_pointer_cast<ClassInfo>(shared_from_this()));
return this->interface || info->isA(shared_from_this());
}

bool
Expand Down Expand Up @@ -2103,7 +2103,7 @@ IceRuby::ClassInfo::marshal(VALUE p, Ice::OutputStream* os, ValueMap* valueMap,
ValueMap::iterator q = valueMap->find(p);
if(q == valueMap->end())
{
writer = make_shared<ValueWriter>(p, valueMap, dynamic_pointer_cast<ClassInfo>(shared_from_this()));
writer = make_shared<ValueWriter>(p, valueMap, shared_from_this());
valueMap->insert(ValueMap::value_type(p, writer));
}
else
Expand Down Expand Up @@ -2143,7 +2143,7 @@ IceRuby::ClassInfo::unmarshal(Ice::InputStream* is, const UnmarshalCallbackPtr&
// attached to the stream keeps a reference to the callback object to ensure it lives
// long enough.
//
ReadValueCallbackPtr rocb = make_shared<ReadValueCallback>(dynamic_pointer_cast<ClassInfo>(shared_from_this()), cb, target, closure);
ReadValueCallbackPtr rocb = make_shared<ReadValueCallback>(shared_from_this(), cb, target, closure);
StreamUtil* util = reinterpret_cast<StreamUtil*>(is->getClosure());
assert(util);
util->add(rocb);
Expand Down Expand Up @@ -2192,7 +2192,7 @@ IceRuby::ClassInfo::print(VALUE value, IceUtilInternal::Output& out, PrintObject
//
if(id == "::Ice::LocalObject")
{
info = dynamic_pointer_cast<ClassInfo>(shared_from_this());
info = shared_from_this();
}
else
{
Expand Down Expand Up @@ -2354,7 +2354,7 @@ IceRuby::ProxyInfo::validate(VALUE val)
assert(!NIL_P(type));
ProxyInfoPtr info = dynamic_pointer_cast<ProxyInfo>(getType(type));
assert(info);
return info->isA(dynamic_pointer_cast<ProxyInfo>(shared_from_this()));
return info->isA(shared_from_this());
}
return true;
}
Expand Down
10 changes: 5 additions & 5 deletions ruby/src/IceRuby/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class StreamUtil
//
// Base class for type information.
//
class TypeInfo : public UnmarshalCallback, public std::enable_shared_from_this<TypeInfo>
class TypeInfo : public UnmarshalCallback
{
public:

Expand Down Expand Up @@ -284,7 +284,7 @@ class StructInfo final : public TypeInfo
using StructInfoPtr = std::shared_ptr<StructInfo>;

// Sequence information.
class SequenceInfo final : public TypeInfo
class SequenceInfo final : public TypeInfo, public std::enable_shared_from_this<SequenceInfo>
{
public:

Expand Down Expand Up @@ -324,7 +324,7 @@ class SequenceInfo final : public TypeInfo
using SequenceInfoPtr = std::shared_ptr<SequenceInfo>;

// Dictionary information.
class DictionaryInfo final : public TypeInfo
class DictionaryInfo final : public TypeInfo, public std::enable_shared_from_this<DictionaryInfo>
{
public:

Expand Down Expand Up @@ -372,7 +372,7 @@ class DictionaryInfo final : public TypeInfo
using DictionaryInfoPtr = std::shared_ptr<DictionaryInfo> ;
using TypeInfoList = std::vector<TypeInfoPtr>;

class ClassInfo final : public TypeInfo
class ClassInfo final : public TypeInfo, public std::enable_shared_from_this<ClassInfo>
{
public:

Expand Down Expand Up @@ -417,7 +417,7 @@ class ClassInfo final : public TypeInfo
};

// Proxy information.
class ProxyInfo final: public TypeInfo
class ProxyInfo final: public TypeInfo, public std::enable_shared_from_this<ProxyInfo>
{
public:

Expand Down

0 comments on commit 6d20a06

Please sign in to comment.