From: Jarkko Hietaniemi Date: Wed, 3 Sep 2003 12:08:23 +0000 (+0000) Subject: Avoid lvalue casts, from Enache. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=113b9ccf36972dcace0731b141e2be76cf4d465d;p=p5sagit%2Fp5-mst-13.2.git Avoid lvalue casts, from Enache. p4raw-id: //depot/perl@21018 --- diff --git a/ext/ByteLoader/bytecode.h b/ext/ByteLoader/bytecode.h index d264482..667de7d 100644 --- a/ext/ByteLoader/bytecode.h +++ b/ext/ByteLoader/bytecode.h @@ -32,7 +32,7 @@ typedef char *pvindex; BGET_U32(arg); \ if (arg) { \ New(666, bstate->bs_pv.xpv_pv, arg, char); \ - bl_read(bstate->bs_fdata, (void*)bstate->bs_pv.xpv_pv, arg, 1);\ + bl_read(bstate->bs_fdata, bstate->bs_pv.xpv_pv, arg, 1); \ bstate->bs_pv.xpv_len = arg; \ bstate->bs_pv.xpv_cur = arg - 1; \ } else { \ diff --git a/op.h b/op.h index ed38438..539393d 100644 --- a/op.h +++ b/op.h @@ -485,14 +485,13 @@ struct loop { #if defined(PL_OP_SLAB_ALLOC) #define NewOp(m,var,c,type) \ - STMT_START { \ - var = (type *) Perl_Slab_Alloc(aTHX_ m,c*sizeof(type));\ - } STMT_END + (var = (type *) Perl_Slab_Alloc(aTHX_ m,c*sizeof(type))) #define NewOpSz(m,var,size) \ - STMT_START { var = (OP *) Perl_Slab_Alloc(aTHX_ m,size); } STMT_END + (var = (OP *) Perl_Slab_Alloc(aTHX_ m,size)) #define FreeOp(p) Perl_Slab_Free(aTHX_ p) #else #define NewOp(m, var, c, type) Newz(m, var, c, type) -#define NewOpSz(m, var, size) Newz(m, (char*)var, size, char) +#define NewOpSz(m, var, size) \ + (var = (OP*)safemalloc(size), memzero(var, size)) #define FreeOp(p) Safefree(p) #endif