ext/RMagick/rmstruct.c in rmagick-3.1.0 vs ext/RMagick/rmstruct.c in rmagick-3.2.0

- old
+ new

@@ -231,11 +231,11 @@ VALUE color; name = rb_str_new2(ci->name); compliance_type = ci->compliance; - compliance = ComplianceType_new(compliance_type); + compliance = ComplianceType_find(compliance_type); color = Pixel_from_MagickPixel(&(ci->color)); RB_GC_GUARD(name); RB_GC_GUARD(compliance); RB_GC_GUARD(color); @@ -388,12 +388,12 @@ VALUE style, stretch, weight; VALUE encoding, foundry, format; name = rb_str_new2(ti->name); family = rb_str_new2(ti->family); - style = StyleType_new(ti->style); - stretch = StretchType_new(ti->stretch); + style = StyleType_find(ti->style); + stretch = StretchType_find(ti->stretch); weight = ULONG2NUM(ti->weight); description = ti->description ? rb_str_new2(ti->description) : Qnil; encoding = ti->encoding ? rb_str_new2(ti->encoding) : Qnil; foundry = ti->foundry ? rb_str_new2(ti->foundry) : Qnil; format = ti->format ? rb_str_new2(ti->format) : Qnil; @@ -449,11 +449,11 @@ m = rb_ary_entry(members, 2); if (m != Qnil) { (void) CloneString((char **)&(ti->family), StringValuePtr(m)); } - m = rb_ary_entry(members, 3); ti->style = m == Qnil ? 0 : FIX2INT(m); - m = rb_ary_entry(members, 4); ti->stretch = m == Qnil ? 0 : FIX2INT(m); + m = rb_ary_entry(members, 3); ti->style = m == Qnil ? 0 : FIX2INT(Enum_to_i(m)); + m = rb_ary_entry(members, 4); ti->stretch = m == Qnil ? 0 : FIX2INT(Enum_to_i(m)); m = rb_ary_entry(members, 5); ti->weight = m == Qnil ? 0 : FIX2INT(m); m = rb_ary_entry(members, 6); if (m != Qnil) (void) CloneString((char **)&(ti->encoding), StringValuePtr(m));