develooper Front page | perl.perl5.porters | Postings from May 2002

Re: [PATCH] Storable (Re: perl@16433)

From:
Benjamin Goldberg
Date:
May 7, 2002 01:57
Subject:
Re: [PATCH] Storable (Re: perl@16433)
Message ID:
3CD7974A.D8590DBF@earthlink.net
Radu Greab wrote:
[snip]
> +#define NEW_STORABLE_CXT_OBJ(cxt) do {                         \
> +       SV *self = newSV(sizeof(stcxt_t) - 1);                  \
> +       SV *my_sv = newRV_noinc(self);                          \
> +       sv_bless(my_sv, gv_stashpv("Storable::Cxt", TRUE));     \
> +       cxt = (stcxt_t *)SvPVX(self);                           \
> +       Zero(cxt, 1, stcxt_t);                                  \
> +       cxt->my_sv = my_sv;                                     \
> +} while(0)

I don't know how important this is, but "do" and "while(0)" should
probably be STMT_START and STMT_END, respectively.

I'm sure that there's a reason the macros STMT_(START|END) exist, though
I personally do not know what that reason is.

-- 
print reverse( ",rekcah", " lreP", " rehtona", " tsuJ" )."\n";



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