summaryrefslogtreecommitdiff
path: root/rb/src/IceRuby/Proxy.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2009-11-20 09:54:57 -0800
committerMark Spruiell <mes@zeroc.com>2009-11-20 09:54:57 -0800
commitef5316f60df42b57cf44cb8968b64e3b5cb5a016 (patch)
tree38f0de2aca9cc3e416735bb72aa51ff993a88f74 /rb/src/IceRuby/Proxy.cpp
parentUpdate demo archive to contain VB demos (diff)
downloadice-ef5316f60df42b57cf44cb8968b64e3b5cb5a016.tar.bz2
ice-ef5316f60df42b57cf44cb8968b64e3b5cb5a016.tar.xz
ice-ef5316f60df42b57cf44cb8968b64e3b5cb5a016.zip
Fixes for Ruby 1.9 compatibility
Diffstat (limited to 'rb/src/IceRuby/Proxy.cpp')
-rw-r--r--rb/src/IceRuby/Proxy.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/rb/src/IceRuby/Proxy.cpp b/rb/src/IceRuby/Proxy.cpp
index 1471bda1273..8dc54c9a95a 100644
--- a/rb/src/IceRuby/Proxy.cpp
+++ b/rb/src/IceRuby/Proxy.cpp
@@ -201,8 +201,7 @@ IceRuby_ObjectPrx_ice_ids(int argc, VALUE* argv, VALUE self)
long i = 0;
for(vector<string>::iterator q = ids.begin(); q != ids.end(); ++q, ++i)
{
- RARRAY(result)->ptr[i] = createString(*q);
- RARRAY(result)->len++; // Increment len for each new element to prevent premature GC.
+ RARRAY_PTR(result)[i] = createString(*q);
}
return result;
@@ -363,11 +362,10 @@ IceRuby_ObjectPrx_ice_getEndpoints(VALUE self)
Ice::EndpointSeq seq = p->ice_getEndpoints();
volatile VALUE result = createArray(seq.size());
- Ice::EndpointSeq::size_type i = 0;
+ long i = 0;
for(Ice::EndpointSeq::iterator q = seq.begin(); q != seq.end(); ++q, ++i)
{
- RARRAY(result)->ptr[i] = createEndpoint(seq[i]);
- RARRAY(result)->len++; // Increment len for each new element to prevent premature GC.
+ RARRAY_PTR(result)[i] = createEndpoint(*q);
}
return result;
}
@@ -396,13 +394,13 @@ IceRuby_ObjectPrx_ice_endpoints(VALUE self, VALUE seq)
{
throw RubyException(rb_eTypeError, "unable to convert value to an array of endpoints");
}
- for(long i = 0; i < RARRAY(arr)->len; ++i)
+ for(long i = 0; i < RARRAY_LEN(arr); ++i)
{
- if(!checkEndpoint(RARRAY(arr)->ptr[i]))
+ if(!checkEndpoint(RARRAY_PTR(arr)[i]))
{
throw RubyException(rb_eTypeError, "array element is not an Ice::Endpoint");
}
- Ice::EndpointPtr* e = reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(RARRAY(arr)->ptr[i]));
+ Ice::EndpointPtr* e = reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(RARRAY_PTR(arr)[i]));
assert(e);
endpoints.push_back(*e);
}