From: gfx Date: Sun, 1 Nov 2009 03:04:09 +0000 (+0900) Subject: s/\t/ /g; X-Git-Tag: 0.40_04~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6582d0e35a9937aa8869d868f10172935f48e1ce;p=gitmo%2FMouse.git s/\t/ /g; --- diff --git a/xs-src/MouseUtil.xs b/xs-src/MouseUtil.xs index 4aa3c1c..6af7e03 100644 --- a/xs-src/MouseUtil.xs +++ b/xs-src/MouseUtil.xs @@ -5,67 +5,67 @@ #ifdef no_mro_get_linear_isa AV* mouse_mro_get_linear_isa(pTHX_ HV* const stash){ - GV* const cachegv = *(GV**)hv_fetchs(stash, ISA_CACHE, TRUE); - AV* isa; - SV* gen; - CV* get_linear_isa; - - if(!isGV(cachegv)) - gv_init(cachegv, stash, ISA_CACHE, sizeof(ISA_CACHE)-1, TRUE); - - isa = GvAVn(cachegv); - gen = GvSVn(cachegv); - - - if(SvIOK(gen) && SvIVX(gen) == (IV)mro_get_pkg_gen(stash)){ - return isa; /* returns the cache if available */ - } - else{ - SvREADONLY_off(isa); - av_clear(isa); - } - - get_linear_isa = get_cv("Mouse::Util::get_linear_isa", TRUE); - - { - SV* avref; - dSP; - - ENTER; - SAVETMPS; - - PUSHMARK(SP); - mXPUSHp(HvNAME_get(stash), HvNAMELEN_get(stash)); - PUTBACK; - - call_sv((SV*)get_linear_isa, G_SCALAR); - - SPAGAIN; - avref = POPs; - PUTBACK; - - if(SvROK(avref) && SvTYPE(SvRV(avref)) == SVt_PVAV){ - AV* const av = (AV*)SvRV(avref); - I32 const len = AvFILLp(av) + 1; - I32 i; - - for(i = 0; i < len; i++){ - HV* const stash = gv_stashsv(AvARRAY(av)[i], FALSE); - if(stash) - av_push(isa, newSVpv(HvNAME(stash), 0)); - } - SvREADONLY_on(isa); - } - else{ - Perl_croak(aTHX_ "Mouse:Util::get_linear_isa() didn't return an ARRAY reference"); - } - - FREETMPS; - LEAVE; - } - - sv_setiv(gen, (IV)mro_get_pkg_gen(stash)); - return GvAV(cachegv); + GV* const cachegv = *(GV**)hv_fetchs(stash, ISA_CACHE, TRUE); + AV* isa; + SV* gen; + CV* get_linear_isa; + + if(!isGV(cachegv)) + gv_init(cachegv, stash, ISA_CACHE, sizeof(ISA_CACHE)-1, TRUE); + + isa = GvAVn(cachegv); + gen = GvSVn(cachegv); + + + if(SvIOK(gen) && SvIVX(gen) == (IV)mro_get_pkg_gen(stash)){ + return isa; /* returns the cache if available */ + } + else{ + SvREADONLY_off(isa); + av_clear(isa); + } + + get_linear_isa = get_cv("Mouse::Util::get_linear_isa", TRUE); + + { + SV* avref; + dSP; + + ENTER; + SAVETMPS; + + PUSHMARK(SP); + mXPUSHp(HvNAME_get(stash), HvNAMELEN_get(stash)); + PUTBACK; + + call_sv((SV*)get_linear_isa, G_SCALAR); + + SPAGAIN; + avref = POPs; + PUTBACK; + + if(SvROK(avref) && SvTYPE(SvRV(avref)) == SVt_PVAV){ + AV* const av = (AV*)SvRV(avref); + I32 const len = AvFILLp(av) + 1; + I32 i; + + for(i = 0; i < len; i++){ + HV* const stash = gv_stashsv(AvARRAY(av)[i], FALSE); + if(stash) + av_push(isa, newSVpv(HvNAME(stash), 0)); + } + SvREADONLY_on(isa); + } + else{ + Perl_croak(aTHX_ "Mouse:Util::get_linear_isa() didn't return an ARRAY reference"); + } + + FREETMPS; + LEAVE; + } + + sv_setiv(gen, (IV)mro_get_pkg_gen(stash)); + return GvAV(cachegv); } #endif /* !no_mor_get_linear_isa */