develooper Front page | perl.perl5.porters | Postings from June 2013

Re: Storable refactoring, was Re: [perl #118139] Storable in DESTROYblocks

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
June 13, 2013 10:42
Subject:
Re: Storable refactoring, was Re: [perl #118139] Storable in DESTROYblocks
Message ID:
20130613104235.GG3729@plum.flirble.org
On Thu, Jun 13, 2013 at 03:13:18AM -0700, Salvador Fandino wrote:

> And the patch...

Thanks. Yes, this fixes the problem locally.

I've pushed this to smoke-me/salva/Storable

I'd already pushed a commit to fix a gcc-ism spotted by the HP compiler:

commit 0e6b41b5683f2b07a6400d094ec39bdac28cdd8c
Author: Nicholas Clark <nick@ccl4.org>
Date:   Thu Jun 13 10:43:07 2013 +0200

    In Storable.xs, don't attempt return the return value of a void function.
    
    Sadly gcc is fine with the idea of return func_which_returns_void(); being
    the same as return;. Vigilant C compilers are not.

diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index 5f57190..5a8ceea 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -1169,7 +1169,7 @@ static void store_ref(pTHX_ store_cxt_t *store_cxt, SV *sv)
 	} else
 		WRITE_MARK(is_weak ? SX_WEAKREF : SX_REF);
 
-	return store(aTHX_ store_cxt, sv);
+	store(aTHX_ store_cxt, sv);
 }
 
 /*
@@ -1772,7 +1772,7 @@ static void store_code(pTHX_ store_cxt_t *store_cxt, CV *cv)
     /*
 	 * retrieve_code does not work with perl 5.005 or less
 	 */
-	return store_other(aTHX_ retrieve_cxt, (SV*)cv);
+	store_other(aTHX_ retrieve_cxt, (SV*)cv);
 #else
 	dSP;
 	I32 len;
@@ -1786,7 +1786,8 @@ static void store_code(pTHX_ store_cxt_t *store_cxt, CV *cv)
 		(store_cxt->deparse < 0 && !(store_cxt->deparse =
 			SvTRUE(perl_get_sv("Storable::Deparse", GV_ADD)) ? 1 : 0))
 	) {
-		return store_other(aTHX_ store_cxt, (SV*)cv);
+		store_other(aTHX_ store_cxt, (SV*)cv);
+		return;
 	}
 
 	/*
@@ -2460,7 +2461,7 @@ static void store_blessed(
 	 * Now emit the <object> part.
 	 */
 
-	return SV_STORE(type)(aTHX_ store_cxt, sv);
+	SV_STORE(type)(aTHX_ store_cxt, sv);
 }
 
 /*


Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About