From: Vincent Pit Date: Thu, 7 Jan 2010 21:16:17 +0000 (+0100) Subject: Rename the "len" member of the sub_op_config_t struct to "namelen" X-Git-Tag: v0.02~4 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=a0c0873977f66d8024a988b8dbd8e1c092927189;p=perl%2Fmodules%2FSub-Op.git Rename the "len" member of the sub_op_config_t struct to "namelen" We will need "protolen" later. --- diff --git a/Op.xs b/Op.xs index cdcc89a..634ddc8 100644 --- a/Op.xs +++ b/Op.xs @@ -118,11 +118,11 @@ void sub_op_register(pTHX_ const sub_op_config_t *c) { if (!PL_custom_op_names) PL_custom_op_names = newHV(); - (void) hv_store_ent(PL_custom_op_names, key, newSVpv(c->name, c->len), 0); + (void) hv_store_ent(PL_custom_op_names, key, newSVpv(c->name, c->namelen), 0); if (!PL_custom_op_descs) PL_custom_op_descs = newHV(); - (void) hv_store_ent(PL_custom_op_descs, key, newSVpv(c->name, c->len), 0); + (void) hv_store_ent(PL_custom_op_descs, key, newSVpv(c->name, c->namelen), 0); if (c->check) { SV *check = newSViv(PTR2IV(c->check)); @@ -132,7 +132,7 @@ void sub_op_register(pTHX_ const sub_op_config_t *c) { { dMY_CXT; - (void) hv_store(MY_CXT.map, c->name, c->len, key, 0); + (void) hv_store(MY_CXT.map, c->name, c->namelen, key, 0); } } diff --git a/lib/Sub/Op.pm b/lib/Sub/Op.pm index c075bbb..6b421c4 100644 --- a/lib/Sub/Op.pm +++ b/lib/Sub/Op.pm @@ -50,11 +50,11 @@ In your XS file : BOOT: { sub_op_config_t c; - c.name = "reftype"; - c.len = sizeof("reftype")-1; - c.pp = scalar_util_reftype; - c.check = 0; - c.ud = NULL; + c.name = "reftype"; + c.namelen = sizeof("reftype")-1; + c.pp = scalar_util_reftype; + c.check = 0; + c.ud = NULL; sub_op_register(aTHX_ &c); } @@ -215,7 +215,7 @@ Allowed to be static. =item * -C +C C's length, in bytes. diff --git a/sub_op.h b/sub_op.h index 20733c1..77c899f 100644 --- a/sub_op.h +++ b/sub_op.h @@ -8,7 +8,7 @@ typedef OP *(*sub_op_check_t)(pTHX_ OP *, void *); typedef struct { const char *name; - STRLEN len; + STRLEN namelen; Perl_ppaddr_t pp; sub_op_check_t check; void *ud; diff --git a/t/Sub-Op-LexicalSub/LexicalSub.xs b/t/Sub-Op-LexicalSub/LexicalSub.xs index e67d5ba..285bc42 100644 --- a/t/Sub-Op-LexicalSub/LexicalSub.xs +++ b/t/Sub-Op-LexicalSub/LexicalSub.xs @@ -75,7 +75,7 @@ PPCODE: if (SvROK(cb)) { cb = SvRV(cb); if (SvTYPE(cb) >= SVt_PVCV) { - c.name = SvPV_const(name, c.len); + c.name = SvPV_const(name, c.namelen); c.check = sols_check; c.ud = SvREFCNT_inc(cb); c.pp = sols_pp;