X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=xs-src%2FMouseTypeConstraints.xs;h=a7ff3905bdc72d73d2834589d1dd8e3084306179;hp=605c9237378da215bfdb6d953ea66a794b864306;hb=1f1ccccdb5564d10867ffb11df17a5155999a62a;hpb=fc83f4cf2ef7708120a216bddc285b93082d7958 diff --git a/xs-src/MouseTypeConstraints.xs b/xs-src/MouseTypeConstraints.xs index 605c923..a7ff390 100644 --- a/xs-src/MouseTypeConstraints.xs +++ b/xs-src/MouseTypeConstraints.xs @@ -120,13 +120,9 @@ mouse_tc_Num(pTHX_ SV* const data PERL_UNUSED_DECL, SV* const sv) { int mouse_tc_Int(pTHX_ SV* const data PERL_UNUSED_DECL, SV* const sv) { assert(sv); - if(SvIOKp(sv)){ + if(SvIOKp(sv) || SvNOKp(sv)){ return TRUE; } - else if(SvNOKp(sv)){ - NV const nv = SvNVX(sv); - return nv > 0 ? (nv == (NV)(UV)nv) : (nv == (NV)(IV)nv); - } else if(SvPOKp(sv)){ int const num_type = grok_number(SvPVX(sv), SvCUR(sv), NULL); if(num_type){ @@ -530,10 +526,7 @@ mouse_generate_can_predicate_for(pTHX_ SV* const methods, const char* const pred I32 len; I32 i; - SvGETMAGIC(methods); - if(!IsArrayRef(methods)){ - croak("You must pass an ARRAY ref method names"); - } + must_ref(methods, "an ARRAY ref for method names", SVt_PVAV); av = (AV*)SvRV(methods); len = av_len(av) + 1;