summaryrefslogtreecommitdiff
path: root/ext/attrs
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-05-28 19:19:06 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-05-30 07:45:09 +0000
commit5d7488b2fd9fa6515201f39bec25777d9fccd7db (patch)
treea657f5ce875a7991aff4b680574bdb785fc5f34a /ext/attrs
parent0b4b7f425bbb7f4f6f4a885d16efb0978cf3643f (diff)
downloadperl-5d7488b2fd9fa6515201f39bec25777d9fccd7db.tar.gz
[PATCH] Minor warning squashings
Date: Sun, 29 May 2005 00:19:06 -0500 Message-Id: <740ea3aca85400c6d03e945323badad4@petdance.com> Subject: [PATCH] Consting in Opcode.xs From: Andy Lester <andy@petdance.com> Date: Sun, 29 May 2005 11:23:50 -0500 Message-ID: <20050529162350.GA13965@petdance.com> Subject: [PATCH] consting attrs.xs From: Andy Lester <andy@petdance.com> Date: Sun, 29 May 2005 14:15:46 -0500 Message-ID: <20050529191546.GA15581@petdance.com> Subject: [PATCH] consting B.xs From: Andy Lester <andy@petdance.com> Date: Sun, 29 May 2005 15:09:24 -0500 Message-ID: <20050529200924.GA15873@petdance.com> p4raw-id: //depot/perl@24622
Diffstat (limited to 'ext/attrs')
-rw-r--r--ext/attrs/attrs.xs10
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/attrs/attrs.xs b/ext/attrs/attrs.xs
index 73f100decc..e3ba012d69 100644
--- a/ext/attrs/attrs.xs
+++ b/ext/attrs/attrs.xs
@@ -4,7 +4,7 @@
#include "XSUB.h"
static cv_flags_t
-get_flag(char *attr)
+get_flag(const char *attr)
{
if (strnEQ(attr, "method", 6))
return CVf_METHOD;
@@ -32,9 +32,8 @@ import(...)
"pragma \"attrs\" is deprecated, "
"use \"sub NAME : ATTRS\" instead");
for (i = 1; i < items; i++) {
- STRLEN n_a;
- char *attr = SvPV(ST(i), n_a);
- cv_flags_t flag = get_flag(attr);
+ const char * const attr = SvPV_nolen(ST(i));
+ const cv_flags_t flag = get_flag(attr);
if (!flag)
croak("invalid attribute name %s", attr);
if (ix)
@@ -53,8 +52,7 @@ SV * sub
sub = Nullsv;
}
else {
- STRLEN n_a;
- char *name = SvPV(sub, n_a);
+ const char * const name = SvPV_nolen(sub);
sub = (SV*)perl_get_cv(name, FALSE);
}
if (!sub)