Changeset 4845
- Timestamp:
- Nov 1, 2012, 9:18:08 PM (7 years ago)
- Location:
- libcaca/trunk/ruby
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/ruby/caca-canvas.c
r4369 r4845 275 275 VALUE v, x, y; 276 276 277 n = RARRAY (points)->len;277 n = RARRAY_LEN(points); 278 278 279 279 ax = (int*)malloc(n*sizeof(int)); … … 291 291 { 292 292 v = rb_ary_entry(points, i); 293 if((TYPE(v) == T_ARRAY) && (RARRAY (v)->len== 2))293 if((TYPE(v) == T_ARRAY) && (RARRAY_LEN(v) == 2)) 294 294 { 295 295 x = rb_ary_entry(v,0); … … 337 337 VALUE v, x, y; 338 338 339 n = RARRAY (points)->len;339 n = RARRAY_LEN(points); 340 340 341 341 ax = (int*)malloc(n*sizeof(int)); … … 353 353 { 354 354 v = rb_ary_entry(points, i); 355 if((TYPE(v) == T_ARRAY) && (RARRAY (v)->len== 2))355 if((TYPE(v) == T_ARRAY) && (RARRAY_LEN(v) == 2)) 356 356 { 357 357 x = rb_ary_entry(v,0); … … 460 460 VALUE v; 461 461 462 l = RARRAY (coords)->len;462 l = RARRAY_LEN(coords); 463 463 if(l != 6 && l != 3) 464 464 { … … 472 472 else 473 473 { 474 if((TYPE(v) != T_ARRAY) || (RARRAY (v)->len!= 2))474 if((TYPE(v) != T_ARRAY) || (RARRAY_LEN(v) != 2)) 475 475 rb_raise(rb_eArgError, "invalid coords list"); 476 476 ccoords[2*i] = NUM2INT(rb_ary_entry(v, 0)); … … 479 479 } 480 480 481 l = RARRAY (uv)->len;481 l = RARRAY_LEN(uv); 482 482 if(l != 6 && l != 3) 483 483 { … … 491 491 else 492 492 { 493 if((TYPE(v) != T_ARRAY) || (RARRAY (v)->len!= 2))493 if((TYPE(v) != T_ARRAY) || (RARRAY_LEN(v) != 2)) 494 494 rb_raise(rb_eArgError, "invalid uv list"); 495 495 ccoords[2*i] = NUM2DBL(rb_ary_entry(v, 0)); … … 601 601 { 602 602 long int bytes; 603 bytes = caca_import_canvas_from_memory (_SELF, StringValuePtr(data), RSTRING (StringValue(data))->len, StringValuePtr(format));603 bytes = caca_import_canvas_from_memory (_SELF, StringValuePtr(data), RSTRING_LEN(StringValue(data)), StringValuePtr(format)); 604 604 if(bytes <= 0) 605 605 rb_raise(rb_eRuntimeError, strerror(errno)); … … 611 611 { 612 612 long int bytes; 613 bytes = caca_import_area_from_memory (_SELF, NUM2INT(x), NUM2INT(y), StringValuePtr(data), RSTRING (StringValue(data))->len, StringValuePtr(format));613 bytes = caca_import_area_from_memory (_SELF, NUM2INT(x), NUM2INT(y), StringValuePtr(data), RSTRING_LEN(StringValue(data)), StringValuePtr(format)); 614 614 if(bytes <= 0) 615 615 rb_raise(rb_eRuntimeError, strerror(errno)); -
libcaca/trunk/ruby/caca-dither.c
r4369 r4845 49 49 int error = 0; 50 50 51 if(RARRAY (palette)->len!= 256)51 if(RARRAY_LEN(palette) != 256) 52 52 { 53 53 rb_raise(rb_eArgError, "Palette must contain 256 elements"); … … 85 85 { 86 86 v = rb_ary_entry(palette, i); 87 if((TYPE(v) == T_ARRAY) && (RARRAY (v)->len== 4))87 if((TYPE(v) == T_ARRAY) && (RARRAY_LEN(v) == 4)) 88 88 { 89 89 r = rb_ary_entry(v,0);
Note: See TracChangeset
for help on using the changeset viewer.