diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2005-06-09 11:50:56 +0300 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-06-09 07:44:36 +0000 |
commit | 8141890a98cb18fe79a9b720aaed544527266f99 (patch) | |
tree | 05c902bdc760cad3dfc8a67b514d9c285d41a7a6 /sv.c | |
parent | d526390560c1ae208a087ad4d648b08895f79f8f (diff) | |
download | perl-8141890a98cb18fe79a9b720aaed544527266f99.tar.gz |
instead of unions use double cast for data pointer <-> function pointer
Message-ID: <42A7D8C0.1080104@gmail.com>
p4raw-id: //depot/perl@24770
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -11309,9 +11309,6 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param) void (*dptr) (void*); void (*dxptr) (pTHX_ void*); OP *o; - /* Unions for circumventing strict ANSI C89 casting rules. */ - union { void *vptr; void (*dptr)(void*); } u1, u2; - union { void *vptr; void (*dxptr)(pTHX_ void*); } u3, u4; Newz(54, nss, max, ANY); @@ -11483,17 +11480,17 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param) ptr = POPPTR(ss,ix); TOPPTR(nss,ix) = any_dup(ptr, proto_perl); /* XXX quite arbitrary */ dptr = POPDPTR(ss,ix); - u1.dptr = dptr; - u2.vptr = any_dup(u1.vptr, proto_perl); - TOPDPTR(nss,ix) = u2.dptr; + TOPDPTR(nss,ix) = DPTR2FPTR(void (*)(void*), + any_dup(FPTR2DPTR(void *, dptr), + proto_perl)); break; case SAVEt_DESTRUCTOR_X: ptr = POPPTR(ss,ix); TOPPTR(nss,ix) = any_dup(ptr, proto_perl); /* XXX quite arbitrary */ dxptr = POPDXPTR(ss,ix); - u3.dxptr = dxptr; - u4.vptr = any_dup(u3.vptr, proto_perl);; - TOPDXPTR(nss,ix) = u4.dxptr; + TOPDXPTR(nss,ix) = DPTR2FPTR(void (*)(pTHX_ void*), + any_dup(FPTR2DPTR(void *, dxptr), + proto_perl)); break; case SAVEt_REGCONTEXT: case SAVEt_ALLOC: |