Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Jan 20, 2024
1 parent 1fe145d commit b33b8e2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ruby/src/IceRuby/Endpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ IceRuby_Endpoint_cmp(VALUE self, VALUE other)
}
Ice::EndpointPtr p1 = Ice::EndpointPtr(*reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(self)));
Ice::EndpointPtr p2 = Ice::EndpointPtr(*reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(other)));
if(p1 < p2)
if(Ice::targetLess(p1, p2))
{
return INT2NUM(-1);
}
else if(p1 == p2)
else if(Ice::targetEqualTo(p1, p1))
{
return INT2NUM(0);
}
Expand Down
21 changes: 19 additions & 2 deletions ruby/src/IceRuby/Types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,8 +1260,12 @@ IceRuby::SequenceInfo::marshal(VALUE p, Ice::OutputStream* os, ValueMap* valueMa
}

void
IceRuby::SequenceInfo::unmarshal(Ice::InputStream* is, const UnmarshalCallbackPtr& cb, VALUE target,
void* closure, bool optional)
IceRuby::SequenceInfo::unmarshal(
Ice::InputStream* is,
const UnmarshalCallbackPtr& cb,
VALUE target,
void* closure,
bool optional)
{
if(optional)
{
Expand Down Expand Up @@ -1977,6 +1981,11 @@ IceRuby::ClassInfo::ClassInfo(VALUE ident, bool loc) :
{
const_cast<bool&>(isBase) = id == Ice::Object::ice_staticId();
}
}

void
IceRuby::ClassInfo::init()
{
const_cast<VALUE&>(typeObj) = createType(shared_from_this());
}

Expand Down Expand Up @@ -2296,6 +2305,11 @@ IceRuby::ProxyInfo::ProxyInfo(VALUE ident) :
{
const_cast<string&>(id) = getString(ident);
const_cast<bool&>(isBase) = id == "::Ice::Object";
}

void
IceRuby::ProxyInfo::init()
{
const_cast<VALUE&>(typeObj) = createType(shared_from_this());
}

Expand Down Expand Up @@ -3012,6 +3026,7 @@ IceRuby_declareProxy(VALUE /*self*/, VALUE id)
if(!info)
{
info = make_shared<ProxyInfo>(id);
info->init();
addProxyInfo(proxyId, info);
}

Expand All @@ -3032,6 +3047,7 @@ IceRuby_declareClass(VALUE /*self*/, VALUE id)
if(!info)
{
info = make_shared<ClassInfo>(id, false);
info->init();
addClassInfo(idstr, info);
}

Expand All @@ -3052,6 +3068,7 @@ IceRuby_declareLocalClass(VALUE /*self*/, VALUE id)
if(!info)
{
info = make_shared<ClassInfo>(id, true);
info->init();
addClassInfo(idstr, info);
}

Expand Down
2 changes: 2 additions & 0 deletions ruby/src/IceRuby/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ class ClassInfo final : public TypeInfo
public:

ClassInfo(VALUE, bool);
void init();

void define(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);

Expand Down Expand Up @@ -421,6 +422,7 @@ class ProxyInfo final: public TypeInfo
public:

ProxyInfo(VALUE);
void init();

void define(VALUE, VALUE, VALUE);

Expand Down

0 comments on commit b33b8e2

Please sign in to comment.