From: Fuji, Goro Date: Sun, 26 Sep 2010 13:51:30 +0000 (+0900) Subject: Tidy X-Git-Tag: 0.75~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bc97157e163ca3ec82a442141232f2cb2d55b106;p=gitmo%2FMouse.git Tidy --- diff --git a/xs-src/Mouse.xs b/xs-src/Mouse.xs index 374ab0c..47ef5c9 100644 --- a/xs-src/Mouse.xs +++ b/xs-src/Mouse.xs @@ -236,13 +236,12 @@ mouse_buildargs(pTHX_ SV* metaclass, SV* const klass, I32 ax, I32 items) { else{ I32 i; - args = newHV_mortal(); - if( (items % 2) != 0 ){ if(!metaclass){ metaclass = get_metaclass(klass); } mouse_throw_error(metaclass, NULL, "Odd number of parameters to new()"); } + args = newHV_mortal(); for(i = 0; i < items; i += 2){ (void)hv_store_ent(args, ST(i), newSVsv(ST(i+1)), 0U); } @@ -371,7 +370,6 @@ mouse_class_initialize_object(pTHX_ SV* const meta, SV* const object, HV* const if(MOUSE_xc_flags(xc) & MOUSEf_XC_IS_ANON){ (void)set_slot(object, newSVpvs_flags("__METACLASS__", SVs_TEMP), meta); } - } static SV* @@ -379,7 +377,8 @@ mouse_initialize_metaclass(pTHX_ SV* const klass) { SV* meta = get_metaclass(klass); if(!SvOK(meta)){ - meta = mcall1s(newSVpvs_flags("Mouse::Meta::Class", SVs_TEMP), "initialize", klass); + meta = mcall1s(newSVpvs_flags("Mouse::Meta::Class", SVs_TEMP), + "initialize", klass); } return meta; diff --git a/xs-src/MouseAttribute.xs b/xs-src/MouseAttribute.xs index 6958375..4086d2b 100644 --- a/xs-src/MouseAttribute.xs +++ b/xs-src/MouseAttribute.xs @@ -15,7 +15,7 @@ mouse_build_xa(pTHX_ SV* const attr) { ENTER; SAVETMPS; - xa = newAV(); + xa = newAV(); mg = sv_magicext(SvRV(attr), (SV*)xa, PERL_MAGIC_ext, &mouse_xa_vtbl, NULL, 0); SvREFCNT_dec(xa); /* refcnt++ in sv_magicext */ @@ -319,7 +319,7 @@ CODE: "without a default, builder, or an init_arg", name); } - /* taken from Mouse::Meta::Attribute->new and ->_process_args */ + /* taken from Mouse::Meta::Attribute->new and ->_process_args */ svp = hv_fetchs(args, "is", FALSE); if(svp){ @@ -340,7 +340,7 @@ CODE: sv_setsv(*svp, name); } else if(strEQ(is, "bare")){ - /* do nothing, but don't complain (later) about missing methods */ + /* do nothing, but might complain later about missing methods */ } else{ mouse_throw_error(klass, NULL,