]> git.vpit.fr Git - perl/modules/Sub-Op.git/commitdiff
Rename the "len" member of the sub_op_config_t struct to "namelen"
authorVincent Pit <vince@profvince.com>
Thu, 7 Jan 2010 21:16:17 +0000 (22:16 +0100)
committerVincent Pit <vince@profvince.com>
Thu, 7 Jan 2010 21:16:17 +0000 (22:16 +0100)
We will need "protolen" later.

Op.xs
lib/Sub/Op.pm
sub_op.h
t/Sub-Op-LexicalSub/LexicalSub.xs

diff --git a/Op.xs b/Op.xs
index cdcc89af7a2d45946ff78f87bf3f87190316c42e..634ddc873f87e8297bf1dc030b9b1a32ba3730ed 100644 (file)
--- 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);
  }
 }
 
index c075bbb8612aae2b8fe7502139a8ad8419116341..6b421c4be5a17f3f6b3a9a2f91e63386c48f53b5 100644 (file)
@@ -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<STRLEN len>
+C<STRLEN namelen>
 
 C<name>'s length, in bytes.
 
index 20733c1888dbfb2f463fdcdb99deb4f8ab0078be..77c899fcc4ac71c2a1fec859d86cf93a0ef6233d 100644 (file)
--- 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;
index e67d5baa33d02e4711484180ed6b13fbb4e0905a..285bc42b061997ad20f9c7adaa957aef737f0d18 100644 (file)
@@ -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;