Use sv_true() instead of SvTRUE(), which is too large to inline
gfx [Mon, 11 Jan 2010 05:34:43 +0000 (14:34 +0900)]
xs-src/Mouse.xs
xs-src/MouseAttribute.xs
xs-src/MouseTypeConstraints.xs
xs-src/MouseUtil.xs

index 372713d..a7d8dec 100644 (file)
@@ -633,7 +633,7 @@ CODE:
             PUTBACK;
 
             call_sv(AvARRAY(demolishall)[i], G_VOID | G_DISCARD | G_EVAL);
-            if(SvTRUE(ERRSV)){
+            if(sv_true(ERRSV)){
                 SV* const e = newSVsv(ERRSV);
 
                 FREETMPS;
index a11471f..97b282e 100644 (file)
@@ -48,10 +48,10 @@ mouse_get_xa(pTHX_ SV* const attr) {
                 SV* const is_a_type_of = sv_2mortal(newSVpvs_share("is_a_type_of"));
 
                 flags |= MOUSEf_ATTR_SHOULD_AUTO_DEREF;
-                if( SvTRUEx(mcall1(tc, is_a_type_of, newSVpvs_flags("ArrayRef", SVs_TEMP))) ){
+                if( sv_true(mcall1(tc, is_a_type_of, newSVpvs_flags("ArrayRef", SVs_TEMP))) ){
                     flags |= MOUSEf_TC_IS_ARRAYREF;
                 }
-                else if( SvTRUEx(mcall1(tc, is_a_type_of, newSVpvs_flags("HashRef", SVs_TEMP))) ){
+                else if( sv_true(mcall1(tc, is_a_type_of, newSVpvs_flags("HashRef", SVs_TEMP))) ){
                     flags |= MOUSEf_TC_IS_HASHREF;
                 }
                 else{
index 41a1d79..08df0e8 100644 (file)
@@ -44,7 +44,7 @@ mouse_tc_check(pTHX_ SV* const tc_code, SV* const sv) {
         call_sv(tc_code, G_SCALAR);
 
         SPAGAIN;
-        ok = SvTRUEx(POPs);
+        ok = sv_true(POPs);
         PUTBACK;
 
         FREETMPS;
@@ -69,7 +69,7 @@ int
 mouse_tc_Bool(pTHX_ SV* const data PERL_UNUSED_DECL, SV* const sv) {
     assert(sv);
 
-    if(SvTRUE(sv)){
+    if(sv_true(sv)){
         if(SvIOKp(sv)){
             return SvIVX(sv) == 1;
         }
@@ -409,9 +409,7 @@ mouse_is_an_instance_of(pTHX_ HV* const stash, SV* const instance){
             call_sv((SV*)instance_isa, G_SCALAR);
 
             SPAGAIN;
-
-            retval = SvTRUEx(POPs);
-
+            retval = sv_true(POPs);
             PUTBACK;
 
             FREETMPS;
@@ -462,8 +460,7 @@ mouse_can_methods(pTHX_ AV* const methods, SV* const instance){
                 call_method("can", G_SCALAR);
 
                 SPAGAIN;
-                ok = SvTRUE(TOPs);
-                (void)POPs;
+                ok = sv_true(POPs);
                 PUTBACK;
 
                 FREETMPS;
index 93160fc..b8afb80 100644 (file)
@@ -202,8 +202,7 @@ mouse_call1 (pTHX_ SV* const self, SV* const method, SV* const arg1) {
 
 int
 mouse_predicate_call(pTHX_ SV* const self, SV* const method) {
-    SV* const value = mcall0(self, method);
-    return SvTRUE(value);
+    return sv_true( mcall0(self, method) );
 }
 
 SV*