From: Nicholas Clark Date: Fri, 10 Mar 2006 11:31:14 +0000 (+0000) Subject: Summon constman! S_checkcomma now has all 3 arguments const char. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c94115d8a8e2e3c3d1a5486519667eba8297650c;p=p5sagit%2Fp5-mst-13.2.git Summon constman! S_checkcomma now has all 3 arguments const char. p4raw-id: //depot/perl@27459 --- diff --git a/embed.fnc b/embed.fnc index cd67051..8a13284 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1401,7 +1401,8 @@ s |char* |scan_word |NN char *s|NN char *dest|STRLEN destlen \ |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 diff --git a/proto.h b/proto.h index 5208f6f..16e549b 100644 --- a/proto.h +++ b/proto.h @@ -3839,7 +3839,7 @@ STATIC char* S_swallow_bom(pTHX_ U8 *s) __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); diff --git a/toke.c b/toke.c index 11fcb65..3d01366 100644 --- a/toke.c +++ b/toke.c @@ -10167,7 +10167,7 @@ unknown: } 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 @@ S_checkcomma(pTHX_ register char *s, const char *name, const char *what) 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); }