Avoid lvalue casts, from Enache.
Jarkko Hietaniemi [Wed, 3 Sep 2003 12:08:23 +0000 (12:08 +0000)]
p4raw-id: //depot/perl@21018

ext/ByteLoader/bytecode.h
op.h

index d264482..667de7d 100644 (file)
@@ -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 (file)
--- 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