Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed bug #23391 reported by Lyle Johnson

Minor testcase fix
  • Loading branch information...
commit 987781c85da6e9b7622f933f39eecbf7bf96148f 1 parent f25e647
snoutmate authored
6 ext/common/conv.h
@@ -131,9 +131,9 @@ int maxlen; \
131 131 struct RArray* ary; \
132 132 ary = RARRAY(rb_Array(arg)); \
133 133 if (maxlen < 1) \
134   - maxlen = ary->len; \
  134 + maxlen = RARRAY_LEN(ary); \
135 135 else \
136   - maxlen = maxlen < ary->len ? maxlen : ary->len; \
  136 + maxlen = maxlen < RARRAY_LEN(ary) ? maxlen : RARRAY_LEN(ary); \
137 137 for (i=0; i < maxlen; i++) \
138 138 cary[i] = (GL##_type_)_convert_(rb_ary_entry((VALUE)ary,i)); \
139 139 return i; \
@@ -166,7 +166,7 @@ int cols,rows; \
166 166 rary = rb_Array(rary); \
167 167 rary = rb_funcall(rary,rb_intern("flatten"),0); \
168 168 \
169   - if (RARRAY(rary)->len != cols*rows) \
  169 + if (RARRAY_LEN(rary) != cols*rows) \
170 170 rb_raise(rb_eArgError, "passed array/matrix must have %i*%i elements",cols,rows); \
171 171 \
172 172 for (i=0; i < cols*rows; i++) \
4 ext/common/funcdef.h
@@ -245,7 +245,7 @@ static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
245 245 LOAD_GL_FUNC(gl##_name_,_ver_) \
246 246 if (TYPE(arg1)==T_ARRAY) { \
247 247 GLuint *objects; \
248   - n = RARRAY(arg1)->len; \
  248 + n = RARRAY_LEN(arg1); \
249 249 objects = ALLOC_N(GLuint,n); \
250 250 ary2cuint(arg1,objects,n); \
251 251 fptr_gl##_name_(n,objects); \
@@ -265,7 +265,7 @@ static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
265 265 GLsizei n; \
266 266 if (TYPE(arg1)==T_ARRAY) { \
267 267 GLuint *objects; \
268   - n = RARRAY(arg1)->len; \
  268 + n = RARRAY_LEN(arg1); \
269 269 objects = ALLOC_N(GLuint,n); \
270 270 ary2cuint(arg1,objects,n); \
271 271 gl##_name_(n,objects); \
54 ext/gl/gl-1.0-1.1.c
@@ -902,7 +902,7 @@ VALUE obj; \
902 902 rb_raise(rb_eArgError, "Pixel unpack buffer bound, but offset argument missing"); \
903 903 map = (GLenum)NUM2INT(args[0]); \
904 904 Check_Type(args[1],T_ARRAY); \
905   - size = RARRAY(args[1])->len; \
  905 + size = RARRAY_LEN(args[1]); \
906 906 values = ALLOC_N(_vartype_,size); \
907 907 _convert_(args[1],values,size); \
908 908 glPixelMap##_type_##v(map,size,values); \
@@ -1985,7 +1985,7 @@ VALUE obj,arg1;
1985 1985 VALUE ary;
1986 1986 int i;
1987 1987 ary = rb_Array(arg1);
1988   - size = RARRAY(ary)->len;
  1988 + size = RARRAY_LEN(ary);
1989 1989 textures = ALLOC_N(GLuint,size);
1990 1990 residences = ALLOC_N(GLboolean,size);
1991 1991 ary2cuint(ary,textures,size);
@@ -2016,7 +2016,7 @@ VALUE obj,arg1,arg2;
2016 2016 GLsizei size;
2017 2017 Check_Type(arg1,T_ARRAY);
2018 2018 Check_Type(arg2,T_ARRAY);
2019   - if ((size = RARRAY(arg1)->len) != RARRAY(arg2)->len)
  2019 + if ((size = RARRAY_LEN(arg1)) != RARRAY_LEN(arg2))
2020 2020 rb_raise(rb_eArgError, "passed arrays must have the same length");
2021 2021 textures = ALLOC_N(GLuint,size);
2022 2022 priorities = ALLOC_N(GLclampf,size);
@@ -2058,15 +2058,15 @@ VALUE obj; \
2058 2058 case 1: \
2059 2059 if (TYPE(args[0]) == T_ARRAY) { \
2060 2060 ary = RARRAY(args[0]); \
2061   - switch (ary->len) { \
  2061 + switch (RARRAY_LEN(ary)) { \
2062 2062 case 3: \
2063   - gl_Color3##_type_(obj,ary->ptr[0],ary->ptr[1],ary->ptr[2]); \
  2063 + gl_Color3##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2064 2064 break; \
2065 2065 case 4: \
2066   - gl_Color4##_type_(obj,ary->ptr[0],ary->ptr[1],ary->ptr[2],ary->ptr[3]); \
  2066 + gl_Color4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
2067 2067 break; \
2068 2068 default: \
2069   - rb_raise(rb_eArgError, "array length:%li", ary->len); \
  2069 + rb_raise(rb_eArgError, "array length:%li", RARRAY_LEN(ary)); \
2070 2070 } \
2071 2071 } \
2072 2072 else \
@@ -2108,12 +2108,12 @@ VALUE obj; \
2108 2108 case 1: \
2109 2109 if (TYPE(args[0]) == T_ARRAY) { \
2110 2110 ary = RARRAY(args[0]); \
2111   - switch (ary->len) { \
  2111 + switch (RARRAY_LEN(ary)) { \
2112 2112 case 3: \
2113   - gl_Normal3##_type_(obj,ary->ptr[0], ary->ptr[1],ary->ptr[2]); \
  2113 + gl_Normal3##_type_(obj,RARRAY_PTR(ary)[0], RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2114 2114 break; \
2115 2115 default: \
2116   - rb_raise(rb_eArgError, "array length:%li", ary->len); \
  2116 + rb_raise(rb_eArgError, "array length:%li", RARRAY_LEN(ary)); \
2117 2117 } \
2118 2118 } \
2119 2119 else \
@@ -2149,15 +2149,15 @@ VALUE obj; \
2149 2149 case 1: \
2150 2150 if (TYPE(args[0]) == T_ARRAY) { \
2151 2151 ary = RARRAY(args[0]); \
2152   - switch (ary->len) { \
  2152 + switch (RARRAY_LEN(ary)) { \
2153 2153 case 2: \
2154   - gl_RasterPos2##_type_(obj,ary->ptr[0],ary->ptr[1]); \
  2154 + gl_RasterPos2##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \
2155 2155 break; \
2156 2156 case 3: \
2157   - gl_RasterPos3##_type_(obj,ary->ptr[0],ary->ptr[1],ary->ptr[2]); \
  2157 + gl_RasterPos3##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2158 2158 break; \
2159 2159 case 4: \
2160   - gl_RasterPos4##_type_(obj,ary->ptr[0],ary->ptr[1],ary->ptr[2],ary->ptr[3]); \
  2160 + gl_RasterPos4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
2161 2161 break; \
2162 2162 default: \
2163 2163 rb_raise(rb_eArgError, "array length:%d", num); \
@@ -2202,12 +2202,12 @@ VALUE obj; \
2202 2202 if (TYPE(args[0]) == T_ARRAY && TYPE(args[1]) == T_ARRAY) { \
2203 2203 ary = RARRAY(args[0]); \
2204 2204 ary2 = RARRAY(args[1]); \
2205   - switch (ary->len) { \
  2205 + switch (RARRAY_LEN(ary)) { \
2206 2206 case 2: \
2207   - gl_Rect##_type_(obj,ary->ptr[0],ary->ptr[1],ary2->ptr[0],ary2->ptr[1]); \
  2207 + gl_Rect##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary2)[0],RARRAY_PTR(ary2)[1]); \
2208 2208 break; \
2209 2209 default: \
2210   - rb_raise(rb_eArgError, "array length:%li", ary->len); \
  2210 + rb_raise(rb_eArgError, "array length:%li", RARRAY_LEN(ary)); \
2211 2211 } \
2212 2212 } \
2213 2213 else \
@@ -2242,18 +2242,18 @@ VALUE obj; \
2242 2242 case 1: \
2243 2243 if (TYPE(args[0]) == T_ARRAY) { \
2244 2244 ary = RARRAY(args[0]); \
2245   - switch (ary->len) { \
  2245 + switch (RARRAY_LEN(ary)) { \
2246 2246 case 1: \
2247   - gl_TexCoord1##_type_(obj,ary->ptr[0]); \
  2247 + gl_TexCoord1##_type_(obj,RARRAY_PTR(ary)[0]); \
2248 2248 break; \
2249 2249 case 2: \
2250   - gl_TexCoord2##_type_(obj,ary->ptr[0],ary->ptr[1]); \
  2250 + gl_TexCoord2##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \
2251 2251 break; \
2252 2252 case 3: \
2253   - gl_TexCoord3##_type_(obj,ary->ptr[0],ary->ptr[1],ary->ptr[2]); \
  2253 + gl_TexCoord3##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2254 2254 break; \
2255 2255 case 4: \
2256   - gl_TexCoord4##_type_(obj,ary->ptr[0],ary->ptr[1],ary->ptr[2],ary->ptr[3]); \
  2256 + gl_TexCoord4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
2257 2257 break; \
2258 2258 default: \
2259 2259 rb_raise(rb_eArgError, "array length:%d", num); \
@@ -2297,18 +2297,18 @@ VALUE obj; \
2297 2297 case 1: \
2298 2298 if (TYPE(args[0]) == T_ARRAY) { \
2299 2299 ary = RARRAY(args[0]); \
2300   - switch (ary->len) { \
  2300 + switch (RARRAY_LEN(ary)) { \
2301 2301 case 2: \
2302   - gl_Vertex2##_type_(obj,ary->ptr[0],ary->ptr[1]); \
  2302 + gl_Vertex2##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \
2303 2303 break; \
2304 2304 case 3: \
2305   - gl_Vertex3##_type_(obj,ary->ptr[0],ary->ptr[1],ary->ptr[2]); \
  2305 + gl_Vertex3##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2306 2306 break; \
2307 2307 case 4: \
2308   - gl_Vertex4##_type_(obj,ary->ptr[0],ary->ptr[1],ary->ptr[2],ary->ptr[3]); \
  2308 + gl_Vertex4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
2309 2309 break; \
2310 2310 default: \
2311   - rb_raise(rb_eRuntimeError, "glVertex vertex num error!:%li", ary->len); \
  2311 + rb_raise(rb_eRuntimeError, "glVertex vertex num error!:%li", RARRAY_LEN(ary)); \
2312 2312 } \
2313 2313 } \
2314 2314 else \
10 ext/gl/gl-1.3.c
@@ -51,18 +51,18 @@ VALUE obj; \
51 51 case 2: \
52 52 if (TYPE(args[1]) == T_ARRAY) { \
53 53 ary = RARRAY(args[1]); \
54   - switch (ary->len) { \
  54 + switch (RARRAY_LEN(ary)) { \
55 55 case 1: \
56   - gl_MultiTexCoord1##_type_(obj,args[0],ary->ptr[0]); \
  56 + gl_MultiTexCoord1##_type_(obj,args[0],RARRAY_PTR(ary)[0]); \
57 57 break; \
58 58 case 2: \
59   - gl_MultiTexCoord2##_type_(obj,args[0],ary->ptr[0],ary->ptr[1]); \
  59 + gl_MultiTexCoord2##_type_(obj,args[0],RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \
60 60 break; \
61 61 case 3: \
62   - gl_MultiTexCoord3##_type_(obj,args[0],ary->ptr[0],ary->ptr[1],ary->ptr[2]); \
  62 + gl_MultiTexCoord3##_type_(obj,args[0],RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
63 63 break; \
64 64 case 4: \
65   - gl_MultiTexCoord4##_type_(obj,args[0],ary->ptr[0],ary->ptr[1],ary->ptr[2],ary->ptr[3]); \
  65 + gl_MultiTexCoord4##_type_(obj,args[0],RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
66 66 break; \
67 67 default: \
68 68 rb_raise(rb_eArgError, "array length:%d", num); \
12 ext/gl/gl-1.4.c
@@ -102,8 +102,8 @@ VALUE obj,arg1,arg2,arg3;
102 102 GLsizei *ary2;
103 103 int len1,len2;
104 104 LOAD_GL_FUNC(glMultiDrawArrays,"1.4")
105   - len1 = RARRAY(arg2)->len;
106   - len2 = RARRAY(arg3)->len;
  105 + len1 = RARRAY_LEN(arg2);
  106 + len2 = RARRAY_LEN(arg3);
107 107 if (len1!=len2)
108 108 rb_raise(rb_eArgError, "Passed arrays must have same length");
109 109 mode = (GLenum)NUM2INT(arg1);
@@ -143,12 +143,12 @@ VALUE obj;
143 143 type = (GLenum)NUM2INT(args[1]);
144 144 Check_Type(args[2],T_ARRAY);
145 145 ary = RARRAY(args[2]);
146   - size = ary->len;
  146 + size = RARRAY_LEN(ary);
147 147 counts = ALLOC_N(GLsizei,size);
148 148 indices = ALLOC_N(GLvoid*,size);
149 149 for (i=0;i<size;i++) {
150 150 VALUE data;
151   - data = pack_array_or_pass_string(type,ary->ptr[i]);
  151 + data = pack_array_or_pass_string(type,RARRAY_PTR(ary)[i]);
152 152 indices[i] = RSTRING_PTR(data);
153 153 counts[i] = RSTRING_LEN(data);
154 154 }
@@ -163,10 +163,10 @@ VALUE obj;
163 163 type = (GLenum)NUM2INT(args[1]);
164 164 Check_Type(args[2],T_ARRAY);
165 165 Check_Type(args[3],T_ARRAY);
166   - if (RARRAY(args[2])->len != RARRAY(args[3])->len)
  166 + if (RARRAY_LEN(args[2]) != RARRAY_LEN(args[3]))
167 167 rb_raise(rb_eArgError, "Count and indices offset array must have same length");
168 168
169   - size = RARRAY(args[2])->len;
  169 + size = RARRAY_LEN(args[2]);
170 170
171 171 counts = ALLOC_N(GLsizei,size);
172 172 indices = ALLOC_N(GLvoid*,size);
2  ext/gl/gl-2.0.c
@@ -64,7 +64,7 @@ VALUE obj,arg1;
64 64 GLenum *buffers;
65 65 LOAD_GL_FUNC(glDrawBuffers,"2.0")
66 66 Check_Type(arg1,T_ARRAY);
67   - size = RARRAY(arg1)->len;
  67 + size = RARRAY_LEN(arg1);
68 68 buffers = ALLOC_N(GLenum,size);
69 69 ary2cuint(arg1,buffers,size);
70 70 fptr_glDrawBuffers(size,buffers);
2  ext/gl/gl-ext-arb.c
@@ -81,7 +81,7 @@ static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
81 81 _type_ cary[_size_]; \
82 82 LOAD_GL_FUNC(gl##_name_,_ext_) \
83 83 Check_Type(arg1,T_ARRAY); \
84   - if (RARRAY(arg1)->len != _size_) \
  84 + if (RARRAY_LEN(arg1) != _size_) \
85 85 rb_raise(rb_eArgError, "Incorrect array length - must have '%i' elements.",_size_); \
86 86 _conv_(arg1,cary,_size_); \
87 87 fptr_gl##_name_(cary); \
2  ext/gl/gl-ext-ati.c
@@ -25,7 +25,7 @@ static VALUE gl_DrawBuffersATI(VALUE obj,VALUE arg1)
25 25 GLenum *buffers;
26 26 LOAD_GL_FUNC(glDrawBuffersATI,"GL_ATI_draw_buffers")
27 27 Check_Type(arg1,T_ARRAY);
28   - size = RARRAY(arg1)->len;
  28 + size = RARRAY_LEN(arg1);
29 29 buffers = ALLOC_N(GLenum,size);
30 30 ary2cuint(arg1,buffers,size);
31 31 fptr_glDrawBuffersATI(size,buffers);
18 ext/gl/gl-ext-ext.c
@@ -41,7 +41,7 @@ VALUE obj,arg1,arg2;
41 41 LOAD_GL_FUNC(glPrioritizeTexturesEXT,"GL_EXT_texture_object")
42 42 Check_Type(arg1,T_ARRAY);
43 43 Check_Type(arg2,T_ARRAY);
44   - if ((size = RARRAY(arg1)->len) != RARRAY(arg2)->len)
  44 + if ((size = RARRAY_LEN(arg1)) != RARRAY_LEN(arg2))
45 45 rb_raise(rb_eArgError, "passed arrays must have the same length");
46 46 textures = ALLOC_N(GLuint,size);
47 47 priorities = ALLOC_N(GLclampf,size);
@@ -68,7 +68,7 @@ VALUE obj,arg1;
68 68 int i;
69 69 LOAD_GL_FUNC(glAreTexturesResidentEXT,"GL_EXT_texture_object")
70 70 ary = rb_Array(arg1);
71   - size = RARRAY(ary)->len;
  71 + size = RARRAY_LEN(ary);
72 72 textures = ALLOC_N(GLuint,size);
73 73 residences = ALLOC_N(GLboolean,size);
74 74 ary2cuint(ary,textures,size);
@@ -217,8 +217,8 @@ VALUE obj,arg1,arg2,arg3;
217 217 GLsizei *ary2;
218 218 int len1,len2;
219 219 LOAD_GL_FUNC(glMultiDrawArraysEXT,"GL_EXT_multi_draw_arrays")
220   - len1 = RARRAY(arg2)->len;
221   - len2 = RARRAY(arg3)->len;
  220 + len1 = RARRAY_LEN(arg2);
  221 + len2 = RARRAY_LEN(arg3);
222 222 if (len1!=len2)
223 223 rb_raise(rb_eArgError, "Passed arrays must have same length");
224 224 mode = (GLenum)NUM2INT(arg1);
@@ -258,12 +258,12 @@ VALUE obj;
258 258 type = (GLenum)NUM2INT(args[1]);
259 259 Check_Type(args[2],T_ARRAY);
260 260 ary = RARRAY(args[2]);
261   - size = ary->len;
  261 + size = RARRAY_LEN(ary);
262 262 counts = ALLOC_N(GLsizei,size);
263 263 indices = ALLOC_N(GLvoid*,size);
264 264 for (i=0;i<size;i++) {
265 265 VALUE data;
266   - data = pack_array_or_pass_string(type,ary->ptr[i]);
  266 + data = pack_array_or_pass_string(type,RARRAY_PTR(ary)[i]);
267 267
268 268 indices[i] = RSTRING_PTR(data);
269 269 counts[i] = RSTRING_LEN(data);
@@ -279,10 +279,10 @@ VALUE obj;
279 279 type = (GLenum)NUM2INT(args[1]);
280 280 Check_Type(args[2],T_ARRAY);
281 281 Check_Type(args[3],T_ARRAY);
282   - if (RARRAY(args[2])->len != RARRAY(args[3])->len)
  282 + if (RARRAY_LEN(args[2]) != RARRAY_LEN(args[3]))
283 283 rb_raise(rb_eArgError, "Count and indices offset array must have same length");
284 284
285   - size = RARRAY(args[2])->len;
  285 + size = RARRAY_LEN(args[2]);
286 286
287 287 counts = ALLOC_N(GLsizei,size);
288 288 indices = ALLOC_N(GLvoid*,size);
@@ -433,7 +433,7 @@ VALUE obj,arg1,arg2,arg3; \
433 433 _type_ *cary; \
434 434 int len; \
435 435 LOAD_GL_FUNC(gl##_name_,_extension_) \
436   - len = RARRAY(rb_Array(arg3))->len; \
  436 + len = RARRAY_LEN(rb_Array(arg3)); \
437 437 if (len<=0 || (len % 4) != 0) \
438 438 rb_raise(rb_eArgError, "Parameter array size must be multiplication of 4"); \
439 439 cary = ALLOC_N(_type_,len); \
8 ext/gl/gl-ext-nv.c
@@ -191,7 +191,7 @@ VALUE obj,arg1,arg2,arg3; \
191 191 _type_ *cary; \
192 192 int len; \
193 193 LOAD_GL_FUNC(gl##_name_,_extension_) \
194   - len = RARRAY(rb_Array(arg3))->len; \
  194 + len = RARRAY_LEN(rb_Array(arg3)); \
195 195 if (len<=0 || (len % 4) != 0) \
196 196 rb_raise(rb_eArgError, "Parameter array size must be multiplication of 4"); \
197 197 cary = ALLOC_N(_type_,len); \
@@ -260,7 +260,7 @@ VALUE obj,arg1,arg2; \
260 260 _type_ *cary; \
261 261 int len; \
262 262 LOAD_GL_FUNC(gl##_name_,_extension_) \
263   - len = RARRAY(rb_Array(arg2))->len; \
  263 + len = RARRAY_LEN(rb_Array(arg2)); \
264 264 if (len<=0 || (len % _size_) != 0) \
265 265 rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
266 266 cary = ALLOC_N(_type_,len); \
@@ -352,7 +352,7 @@ static VALUE gl_RequestResidentProgramsNV(VALUE obj,VALUE arg1)
352 352 if (TYPE(arg1)==T_ARRAY) {
353 353 GLsizei n;
354 354 GLuint *programs;
355   - n = RARRAY(arg1)->len;
  355 + n = RARRAY_LEN(arg1);
356 356 programs = ALLOC_N(GLuint,n);
357 357 ary2cuint(arg1,programs,n);
358 358 fptr_glRequestResidentProgramsNV( n, programs);
@@ -378,7 +378,7 @@ static VALUE gl_AreProgramsResidentNV(VALUE obj,VALUE arg1)
378 378 int i;
379 379 LOAD_GL_FUNC(glAreProgramsResidentNV,"GL_NV_vertex_program")
380 380 ary = rb_Array(arg1);
381   - size = RARRAY(ary)->len;
  381 + size = RARRAY_LEN(ary);
382 382 programs = ALLOC_N(GLuint,size);
383 383 residences = ALLOC_N(GLboolean,size);
384 384 ary2cuint(ary,programs,size);
8 ext/glu/glu.c
@@ -310,7 +310,7 @@ VALUE obj;
310 310
311 311 switch (rb_scan_args(argc, argv, "52", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5], &args[6])) {
312 312 case 5:
313   - uknot_count = RARRAY(args[1])->len;
  313 + uknot_count = RARRAY_LEN(args[1]);
314 314 uorder = (GLenum)NUM2INT(args[3]);
315 315 type = (GLenum)NUM2INT(args[4]);
316 316 u_stride = get_curve_dim(type);
@@ -401,11 +401,11 @@ VALUE obj;
401 401
402 402 switch (rb_scan_args(argc, argv, "74", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5], &args[6], &args[7], &args[8], &args[9], &args[10])) {
403 403 case 7:
404   - sknot_count = RARRAY(args[1])->len;
  404 + sknot_count = RARRAY_LEN(args[1]);
405 405 sknot = ALLOC_N(GLfloat, sknot_count);
406 406 ary2cflt(args[1], sknot, sknot_count);
407 407
408   - tknot_count = RARRAY(args[2])->len;
  408 + tknot_count = RARRAY_LEN(args[2]);
409 409 tknot = ALLOC_N(GLfloat, tknot_count);
410 410 ary2cflt(args[2], tknot, tknot_count);
411 411
@@ -497,7 +497,7 @@ VALUE obj;
497 497
498 498 switch (rb_scan_args(argc, argv, "32", &args[0], &args[1], &args[2], &args[3], &args[4])) {
499 499 case 3:
500   - count = RARRAY(args[1])->len;
  500 + count = RARRAY_LEN(args[1]);
501 501 type = NUM2INT(args[2]);
502 502 stride = (type == GLU_MAP1_TRIM_2 ? 2 : 3);
503 503
4 ext/glut/glut.c
@@ -90,10 +90,10 @@ static VALUE glut_Init( int argc, VALUE * argv, VALUE obj)
90 90 /* converts commandline parameters from ruby to C, passes them
91 91 to glutInit and returns the parameters stripped of glut-specific
92 92 commands ("-display","-geometry" etc.) */
93   - largc = RARRAY(orig_arg)->len;
  93 + largc = RARRAY_LEN(orig_arg);
94 94 largv = ALLOCA_N(char*, largc);
95 95 for (i = 0; i < largc; i++)
96   - largv[0] = STR2CSTR(RARRAY(orig_arg)->ptr[i]);
  96 + largv[0] = STR2CSTR(RARRAY_PTR(orig_arg)[i]);
97 97
98 98 glutInit(&largc, largv);
99 99
10 test/tc_func_12.rb
@@ -127,9 +127,9 @@ def test_histogram
127 127
128 128 glEnable(GL_HISTOGRAM)
129 129
130   - glHistogram(GL_HISTOGRAM,1,GL_RGB8,GL_FALSE)
  130 + glHistogram(GL_HISTOGRAM,1,GL_RGB,GL_FALSE)
131 131 assert_equal(glGetHistogramParameterfv(GL_HISTOGRAM,GL_HISTOGRAM_WIDTH),1)
132   - assert_equal(glGetHistogramParameteriv(GL_HISTOGRAM,GL_HISTOGRAM_FORMAT),GL_RGB8)
  132 + assert_equal(glGetHistogramParameteriv(GL_HISTOGRAM,GL_HISTOGRAM_FORMAT),GL_RGB)
133 133 assert_equal(glGetHistogramParameteriv(GL_HISTOGRAM,GL_HISTOGRAM_SINK),GL_FALSE)
134 134
135 135 glDrawPixels(2,1,GL_RGB,GL_FLOAT,[1,1,1,1,1,1].pack("f*"))
@@ -147,9 +147,9 @@ def test_minmax
147 147
148 148 glEnable(GL_MINMAX)
149 149
150   - glMinmax(GL_MINMAX,GL_RGB8,GL_FALSE)
151   - assert_equal(glGetMinmaxParameteriv(GL_MINMAX,GL_MINMAX_FORMAT),GL_RGB8)
152   - assert_equal(glGetMinmaxParameterfv(GL_MINMAX,GL_MINMAX_FORMAT),GL_RGB8)
  150 + glMinmax(GL_MINMAX,GL_RGB,GL_FALSE)
  151 + assert_equal(glGetMinmaxParameteriv(GL_MINMAX,GL_MINMAX_FORMAT),GL_RGB)
  152 + assert_equal(glGetMinmaxParameterfv(GL_MINMAX,GL_MINMAX_FORMAT),GL_RGB)
153 153 assert_equal(glGetMinmaxParameteriv(GL_MINMAX,GL_MINMAX_SINK),GL_FALSE)
154 154
155 155 glDrawPixels(2,1,GL_RGB,GL_FLOAT,[0,0,0,1,1,1].pack("f*"))

0 comments on commit 987781c

Please sign in to comment.
Something went wrong with that request. Please try again.