Skip to content

Commit

Permalink
Patch for LONG_MAX & co.
Browse files Browse the repository at this point in the history
This patch changes neither behavior nor performance.  However, it does
reduce code size and improve maintainability by combining some common
code in gv_fullname() and gv_efullname().
  • Loading branch information
Perl 5 Porters authored and Andy Dougherty committed Sep 1, 1996
1 parent dedeecd commit b328e6b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pp_hot.c
Expand Up @@ -252,7 +252,7 @@ PP(pp_preinc)
{
dSP;
if (SvIOK(TOPs)) {
if (SvIVX(TOPs) == PERL_LONG_MAX) {
if (SvIVX(TOPs) == IV_MAX) {
sv_setnv(TOPs, (double)(SvIVX(TOPs)) + 1.0 );
}
else {
Expand Down Expand Up @@ -344,7 +344,7 @@ PP(pp_print)
if (!(io = GvIO(gv))) {
if (dowarn) {
SV* sv = sv_newmortal();
gv_fullname(sv,gv);
gv_fullname(sv, gv, Nullch);
warn("Filehandle %s never opened", SvPV(sv,na));
}

Expand All @@ -354,7 +354,7 @@ PP(pp_print)
else if (!(fp = IoOFP(io))) {
if (dowarn) {
SV* sv = sv_newmortal();
gv_fullname(sv,gv);
gv_fullname(sv, gv, Nullch);
if (IoIFP(io))
warn("Filehandle %s opened only for input", SvPV(sv,na));
else
Expand Down Expand Up @@ -1735,7 +1735,7 @@ PP(pp_entersub)
goto retry;
}
tmpstr = sv_newmortal();
gv_efullname(tmpstr, gv);
gv_efullname(tmpstr, gv, Nullch);
ngv = gv_fetchmethod(GvESTASH(gv), "AUTOLOAD");
if (ngv && ngv != gv && (cv = GvCV(ngv))) { /* One more chance... */
gv = ngv;
Expand All @@ -1761,7 +1761,7 @@ PP(pp_entersub)
sv_setsv(sv, newRV((SV*)cv));
}
else {
gv_efullname(sv,gv);
gv_efullname(sv, gv, Nullch);
}
cv = GvCV(DBsub);
if (CvXSUB(cv)) curcopdb = curcop;
Expand Down

0 comments on commit b328e6b

Please sign in to comment.