Change 27459 by [EMAIL PROTECTED] on 2006/03/10 11:31:14
Summon constman! S_checkcomma now has all 3 arguments const char.
Affected files ...
... //depot/perl/embed.fnc#329 edit
... //depot/perl/proto.h#676 edit
... //depot/perl/toke.c#659 edit
Differences ...
==== //depot/perl/embed.fnc#329 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#328~27447~ 2006-03-09 12:48:18.000000000 -0800
+++ perl/embed.fnc 2006-03-10 03:31:14.000000000 -0800
@@ -1401,7 +1401,8 @@
|int allow_package|NN STRLEN *slp
sR |char* |skipspace |NN char *s
sR |char* |swallow_bom |NN U8 *s
-s |void |checkcomma |NN char *s|NN const char *name|NN const char
*what
+s |void |checkcomma |NN const char *s|NN const char *name \
+ |NN const char *what
s |bool |feature_is_enabled|NN char* name|STRLEN namelen
s |void |force_ident |NN const char *s|int kind
s |void |incline |NN char *s
==== //depot/perl/proto.h#676 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#675~27447~ 2006-03-09 12:48:18.000000000 -0800
+++ perl/proto.h 2006-03-10 03:31:14.000000000 -0800
@@ -3839,7 +3839,7 @@
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
-STATIC void S_checkcomma(pTHX_ char *s, const char *name, const char *what)
+STATIC void S_checkcomma(pTHX_ const char *s, const char *name, const char
*what)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2)
__attribute__nonnull__(pTHX_3);
==== //depot/perl/toke.c#659 (text) ====
Index: perl/toke.c
--- perl/toke.c#658~27458~ 2006-03-10 02:50:29.000000000 -0800
+++ perl/toke.c 2006-03-10 03:31:14.000000000 -0800
@@ -10167,7 +10167,7 @@
}
STATIC void
-S_checkcomma(pTHX_ register char *s, const char *name, const char *what)
+S_checkcomma(pTHX_ const char *s, const char *name, const char *what)
{
dVAR;
const char *w;
@@ -10201,17 +10201,12 @@
while (s < PL_bufend && isSPACE(*s))
s++;
if (*s == ',') {
- I32 kw;
- CV *cv;
- *s = '\0'; /* XXX If we didn't do this, we could const a lot of
toke.c */
- kw = keyword(w, s - w);
- *s = ',';
- if (kw)
+ GV* gv;
+ if (keyword(w, s - w))
return;
- *s = '\0';
- cv = get_cv(w, FALSE);
- *s = ',';
- if (cv)
+
+ gv = gv_fetchpvn_flags(w, s - w, 0, SVt_PVCV);
+ if (gv && GvCVu(gv))
return;
Perl_croak(aTHX_ "No comma allowed after %s", what);
}
End of Patch.