From: Nicholas Clark Date: Mon, 24 Apr 2006 09:40:58 +0000 (+0000) Subject: Following change 27942 it's clear that the return type of X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=19f6321d25d193c964d4da055e9f739f63de1dc6;p=p5sagit%2Fp5-mst-13.2.git Following change 27942 it's clear that the return type of glob_2inpuv_number() should change. Rename it and glob_2inpuv() to reflect what they do. p4raw-id: //depot/perl@27947 --- diff --git a/embed.fnc b/embed.fnc index cca7933..5d3b858 100644 --- a/embed.fnc +++ b/embed.fnc @@ -756,8 +756,8 @@ Apd |bool |sv_2bool |NN SV* sv Apd |CV* |sv_2cv |NULLOK SV* sv|NN HV** st|NN GV** gvp|I32 lref Apd |IO* |sv_2io |NN SV* sv #ifdef PERL_IN_SV_C -s |char* |glob_2inpuv_number|NN GV* const gv -s |char* |glob_2inpuv |NN GV* const gv|NN STRLEN * const len +s |bool |glob_2number |NN GV* const gv +s |char* |glob_2pv |NN GV* const gv|NN STRLEN * const len #endif Amb |IV |sv_2iv |NN SV* sv Apd |IV |sv_2iv_flags |NN SV* sv|I32 flags diff --git a/embed.h b/embed.h index afaae7f..9e8c6ed 100644 --- a/embed.h +++ b/embed.h @@ -793,8 +793,8 @@ #define sv_2io Perl_sv_2io #ifdef PERL_IN_SV_C #ifdef PERL_CORE -#define glob_2inpuv_number S_glob_2inpuv_number -#define glob_2inpuv S_glob_2inpuv +#define glob_2number S_glob_2number +#define glob_2pv S_glob_2pv #endif #endif #define sv_2iv_flags Perl_sv_2iv_flags @@ -2954,8 +2954,8 @@ #define sv_2io(a) Perl_sv_2io(aTHX_ a) #ifdef PERL_IN_SV_C #ifdef PERL_CORE -#define glob_2inpuv_number(a) S_glob_2inpuv_number(aTHX_ a) -#define glob_2inpuv(a,b) S_glob_2inpuv(aTHX_ a,b) +#define glob_2number(a) S_glob_2number(aTHX_ a) +#define glob_2pv(a,b) S_glob_2pv(aTHX_ a,b) #endif #endif #define sv_2iv_flags(a,b) Perl_sv_2iv_flags(aTHX_ a,b) diff --git a/proto.h b/proto.h index 6c7679b..8a5b92a 100644 --- a/proto.h +++ b/proto.h @@ -2065,10 +2065,10 @@ PERL_CALLCONV IO* Perl_sv_2io(pTHX_ SV* sv) __attribute__nonnull__(pTHX_1); #ifdef PERL_IN_SV_C -STATIC char* S_glob_2inpuv_number(pTHX_ GV* const gv) +STATIC bool S_glob_2number(pTHX_ GV* const gv) __attribute__nonnull__(pTHX_1); -STATIC char* S_glob_2inpuv(pTHX_ GV* const gv, STRLEN * const len) +STATIC char* S_glob_2pv(pTHX_ GV* const gv, STRLEN * const len) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); diff --git a/sv.c b/sv.c index 598b593..b278656 100644 --- a/sv.c +++ b/sv.c @@ -1717,8 +1717,8 @@ Perl_looks_like_number(pTHX_ SV *sv) return grok_number(sbegin, len, NULL); } -STATIC char * -S_glob_2inpuv_number(pTHX_ GV * const gv) +STATIC bool +S_glob_2number(pTHX_ GV * const gv) { const U32 wasfake = SvFLAGS(gv) & SVf_FAKE; SV *const buffer = sv_newmortal(); @@ -1735,11 +1735,11 @@ S_glob_2inpuv_number(pTHX_ GV * const gv) not_a_number(buffer); /* We just want something true to return, so that S_sv_2iuv_common can tail call us and return true. */ - return (char *) 1; + return TRUE; } STATIC char * -S_glob_2inpuv(pTHX_ GV * const gv, STRLEN * const len) +S_glob_2pv(pTHX_ GV * const gv, STRLEN * const len) { const U32 wasfake = SvFLAGS(gv) & SVf_FAKE; SV *const buffer = sv_newmortal(); @@ -2123,7 +2123,7 @@ S_sv_2iuv_common(pTHX_ SV *sv) { } else { if (isGV_with_GP(sv)) - return (bool)PTR2IV(glob_2inpuv_number((GV *)sv)); + return PTR2IV(glob_2number((GV *)sv)); if (!(SvFLAGS(sv) & SVs_PADTMP)) { if (!PL_localizing && ckWARN(WARN_UNINITIALIZED)) @@ -2473,7 +2473,7 @@ Perl_sv_2nv(pTHX_ register SV *sv) } else { if (isGV_with_GP(sv)) { - glob_2inpuv_number((GV *)sv); + glob_2number((GV *)sv); return 0.0; } @@ -2810,7 +2810,7 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags) } else { if (isGV_with_GP(sv)) - return glob_2inpuv((GV *)sv, lp); + return glob_2pv((GV *)sv, lp); if (!PL_localizing && !(SvFLAGS(sv) & SVs_PADTMP) && ckWARN(WARN_UNINITIALIZED)) report_uninit(sv);