summaryrefslogtreecommitdiffstats
path: root/source/kde/kdebindings/kdebindings-len-ptr-rfloat.diff
blob: 0f2edc12508d4c9d8084a2084dc462668e3c30af (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
--- kdebindings-4.3.0/ruby/krossruby/rubyfunction.h.org	2008-07-29 05:47:40.000000000 -0600
+++ kdebindings-4.3.0/ruby/krossruby/rubyfunction.h	2009-08-09 03:04:00.105143195 -0600
@@ -88,11 +88,11 @@
                 //#endif
                 VALUE info = rb_gv_get("$!");
                 VALUE bt = rb_funcall(info, rb_intern("backtrace"), 0);
-                VALUE message = RARRAY(bt)->ptr[0];
+                VALUE message = RARRAY_PTR(bt)[0];
                 fprintf(stderr,"%s: %s (%s)\n", STR2CSTR(message), STR2CSTR(rb_obj_as_string(info)), rb_class2name(CLASS_OF(info)));
-                for(int i = 1; i < RARRAY(bt)->len; ++i)
-                    if( TYPE(RARRAY(bt)->ptr[i]) == T_STRING )
-                        fprintf(stderr,"\tfrom %s\n", STR2CSTR(RARRAY(bt)->ptr[i]));
+                for(int i = 1; i < RARRAY_LEN(bt); ++i)
+                    if( TYPE(RARRAY_PTR(bt)[i]) == T_STRING )
+                        fprintf(stderr,"\tfrom %s\n", STR2CSTR(RARRAY_PTR(bt)[i]));
                 //ruby_nerrs++;
                 return Qnil;
             }
--- kdebindings-4.3.0/ruby/krossruby/rubyobject.cpp.org	2008-06-18 06:41:05.000000000 -0600
+++ kdebindings-4.3.0/ruby/krossruby/rubyobject.cpp	2009-08-08 21:55:21.209147733 -0600
@@ -34,7 +34,7 @@
 
     VALUE info = rb_gv_get("$!");
     VALUE bt = rb_funcall(info, rb_intern("backtrace"), 0);
-    VALUE message = RARRAY(bt)->ptr[0];
+    VALUE message = RARRAY_PTR(bt)[0];
 
     QString errormessage = QString("%1: %2 (%3)")
                             .arg( STR2CSTR(message) )
@@ -43,9 +43,9 @@
     fprintf(stderr, "%s\n", errormessage.toLatin1().data());
 
     QString tracemessage;
-    for(int i = 1; i < RARRAY(bt)->len; ++i) {
-        if( TYPE(RARRAY(bt)->ptr[i]) == T_STRING ) {
-            QString s = QString("%1\n").arg( STR2CSTR(RARRAY(bt)->ptr[i]) );
+    for(int i = 1; i < RARRAY_LEN(bt); ++i) {
+        if( TYPE(RARRAY_PTR(bt)[i]) == T_STRING ) {
+            QString s = QString("%1\n").arg( STR2CSTR(RARRAY_PTR(bt)[i]) );
             Q_ASSERT( ! s.isNull() );
             tracemessage += s;
             fprintf(stderr, "\t%s", s.toLatin1().data());
@@ -74,7 +74,7 @@
     ID functionId = rb_ary_entry(args, 1);
     VALUE arguments = rb_ary_entry(args, 2);
     Q_ASSERT( TYPE(arguments) == T_ARRAY );
-    return rb_funcall2(self, functionId, RARRAY(arguments)->len, RARRAY(arguments)->ptr);
+    return rb_funcall2(self, functionId, RARRAY_LEN(arguments), RARRAY_PTR(arguments));
 }
 
 class RubyObject::Private
@@ -112,8 +112,8 @@
     VALUE methods;
     const char* method;
     methods = rb_class_instance_methods(1, args, CLASS_OF(object));
-    for (int i = 0; i < RARRAY(methods)->len; i++) {
-        method = StringValuePtr(RARRAY(methods)->ptr[i]);
+    for (int i = 0; i < RARRAY_LEN(methods); i++) {
+        method = StringValuePtr(RARRAY_PTR(methods)[i]);
         krossdebug( QString("RubyObject::RubyObject() method=%1").arg( method ));
         d->calls << method;
     }
--- kdebindings-4.3.0/ruby/krossruby/rubyscript.cpp.org	2009-01-16 08:04:29.000000000 -0700
+++ kdebindings-4.3.0/ruby/krossruby/rubyscript.cpp	2009-08-08 21:51:36.729148567 -0600
@@ -47,7 +47,7 @@
 
     VALUE info = rb_gv_get("$!");
     VALUE bt = rb_funcall(info, rb_intern("backtrace"), 0);
-    VALUE message = RARRAY(bt)->ptr[0];
+    VALUE message = RARRAY_PTR(bt)[0];
 
     QString errormessage = QString("%1: %2 (%3)")
                             .arg( STR2CSTR(message) )
@@ -56,9 +56,9 @@
     fprintf(stderr, "%s\n", errormessage.toLatin1().data());
 
     QString tracemessage;
-    for(int i = 1; i < RARRAY(bt)->len; ++i) {
-        if( TYPE(RARRAY(bt)->ptr[i]) == T_STRING ) {
-            QString s = QString("%1\n").arg( STR2CSTR(RARRAY(bt)->ptr[i]) );
+    for(int i = 1; i < RARRAY_LEN(bt); ++i) {
+        if( TYPE(RARRAY_PTR(bt)[i]) == T_STRING ) {
+            QString s = QString("%1\n").arg( STR2CSTR(RARRAY_PTR(bt)[i]) );
             Q_ASSERT( ! s.isNull() );
             tracemessage += s;
             fprintf(stderr, "\t%s", s.toLatin1().data());
@@ -361,7 +361,7 @@
     ID functionId = rb_ary_entry(args, 1);
     VALUE arguments = rb_ary_entry(args, 2);
     Q_ASSERT( TYPE(arguments) == T_ARRAY );
-    return rb_funcall2(self, functionId, RARRAY(arguments)->len, RARRAY(arguments)->ptr);
+    return rb_funcall2(self, functionId, RARRAY_LEN(arguments), RARRAY_PTR(arguments));
 }
 
 QVariant RubyScript::callFunction(const QString& name, const QVariantList& args)
--- kdebindings-4.3.0/ruby/krossruby/rubyvariant.cpp.org	2008-11-19 03:17:32.000000000 -0700
+++ kdebindings-4.3.0/ruby/krossruby/rubyvariant.cpp	2009-08-08 21:42:27.593112416 -0600
@@ -487,7 +487,7 @@
                 #endif
                 QList<void*> list;
                 if( TYPE(value) == T_ARRAY ) {
-                    for(int i = 0; i < RARRAY(value)->len; i++)
+                    for(int i = 0; i < RARRAY_LEN(value); i++)
                         if( void *ptr = VoidList::extractVoidStar(rb_ary_entry(value, i)) )
                             list << ptr;
                 }
--- kdebindings-4.3.0/ruby/krossruby/rubyvariant.h.org	2008-07-29 05:47:40.000000000 -0600
+++ kdebindings-4.3.0/ruby/krossruby/rubyvariant.h	2009-08-09 02:51:01.845117051 -0600
@@ -124,7 +124,7 @@
                 case T_BIGNUM:
                     return rb_big2int(value);
                 case T_FLOAT:
-                    return (int)(RFLOAT(value)->value);
+                    return (int)(RFLOAT_VALUE(value));
                 default:
                     break;
             }
@@ -147,7 +147,7 @@
                 case T_BIGNUM:
                     return rb_big2uint(value);
                 case T_FLOAT:
-                    return (uint)(RFLOAT(value)->value);
+                    return (uint)(RFLOAT_VALUE(value));
                 default:
                     break;
             }
@@ -226,7 +226,7 @@
                 //return STR2CSTR( rb_inspect(value) );
                 return QByteArray("");
             }
-            long length = LONG2NUM( RSTRING(value)->len );
+            long length = LONG2NUM( RSTRING_LEN(value) );
             if( length < 0 )
                 return QByteArray("");
             char* ca = rb_str2cstr(value, &length);
@@ -261,7 +261,7 @@
             return l;
         }
         inline static QSize toVariant(VALUE value) {
-            if( TYPE(value) != T_ARRAY || RARRAY(value)->len != 2 ) {
+            if( TYPE(value) != T_ARRAY || RARRAY_LEN(value) != 2 ) {
                 rb_raise(rb_eTypeError, "QSize must be an array with 2 elements");
                 return QSize();
             }
@@ -280,7 +280,7 @@
             return l;
         }
         inline static QSizeF toVariant(VALUE value) {
-            if( TYPE(value) != T_ARRAY || RARRAY(value)->len != 2 ) {
+            if( TYPE(value) != T_ARRAY || RARRAY_LEN(value) != 2 ) {
                 rb_raise(rb_eTypeError, "QSizeF must be an array with 2 elements");
                 return QSizeF();
             }
@@ -300,7 +300,7 @@
             return l;
         }
         inline static QPoint toVariant(VALUE value) {
-            if( TYPE(value) != T_ARRAY || RARRAY(value)->len != 2 ) {
+            if( TYPE(value) != T_ARRAY || RARRAY_LEN(value) != 2 ) {
                 rb_raise(rb_eTypeError, "QPoint must be an array with 2 elements");
                 return QPoint();
             }
@@ -319,7 +319,7 @@
             return l;
         }
         inline static QPointF toVariant(VALUE value) {
-            if( TYPE(value) != T_ARRAY || RARRAY(value)->len != 2 ) {
+            if( TYPE(value) != T_ARRAY || RARRAY_LEN(value) != 2 ) {
                 rb_raise(rb_eTypeError, "QPointF must be an array with 2 elements");
                 return QPointF();
             }
@@ -340,7 +340,7 @@
             return l;
         }
         inline static QRect toVariant(VALUE value) {
-            if( TYPE(value) != T_ARRAY || RARRAY(value)->len != 4 ) {
+            if( TYPE(value) != T_ARRAY || RARRAY_LEN(value) != 4 ) {
                 rb_raise(rb_eTypeError, "QRect must be an array with 4 elements");
                 return QRect();
             }
@@ -362,7 +362,7 @@
             return l;
         }
         inline static QRectF toVariant(VALUE value) {
-            if( TYPE(value) != T_ARRAY || RARRAY(value)->len != 4 ) {
+            if( TYPE(value) != T_ARRAY || RARRAY_LEN(value) != 4 ) {
                 rb_raise(rb_eTypeError, "QRectF must be an array with 4 elements");
                 return QRectF();
             }
@@ -447,7 +447,7 @@
                 return QStringList();
             }
             QStringList l;
-            for(int i = 0; i < RARRAY(value)->len; i++)
+            for(int i = 0; i < RARRAY_LEN(value); i++)
                 l.append( RubyType<QString>::toVariant( rb_ary_entry(value, i) ) );
             return l;
         }
@@ -469,7 +469,7 @@
                 return QVariantList();
             }
             QVariantList l;
-            for(int i = 0; i < RARRAY(value)->len; i++)
+            for(int i = 0; i < RARRAY_LEN(value); i++)
                 l.append( RubyType<QVariant>::toVariant( rb_ary_entry(value, i) ) );
             return l;
         }