From: Nicholas Clark Date: Fri, 21 May 2010 19:32:28 +0000 (+0100) Subject: PL_in_load_module only has values 0 and 1, so can be a bool instead of int. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4fa7c2bfe0a54ceffcc7c56cdc072eaeaf54cad9;p=p5sagit%2Fp5-mst-13.2.git PL_in_load_module only has values 0 and 1, so can be a bool instead of int. --- diff --git a/intrpvar.h b/intrpvar.h index 4af88f6..bfa613c 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -257,7 +257,7 @@ PERLVAR(Iexit_flags, U8) /* was exit() unexpected, etc. */ PERLVAR(Isrand_called, bool) /* Part of internal state, but makes the 16th 1 byte variable in a row. */ PERLVAR(Itainting, bool) /* doing taint checks */ -/* Space for a U8 */ +PERLVARI(Iin_load_module, bool, FALSE) /* to prevent recursions in PerlIO_find_layer */ PERLVAR(Iinplace, char *) PERLVAR(Ie_script, SV *) @@ -632,7 +632,7 @@ PERLVARI(Iunitcheckav_save, AV*, NULL) /* save UNITCHECK{}s when compiling */ PERLVARI(Iclocktick, long, 0) /* this many times() ticks in a second */ -PERLVARI(Iin_load_module, int, 0) /* to prevent recursions in PerlIO_find_layer */ +/* Space for an int */ PERLVAR(Iunicode, U32) /* Unicode features: $ENV{PERL_UNICODE} or -C */ diff --git a/perlio.c b/perlio.c index d015b58..57a61d9 100644 --- a/perlio.c +++ b/perlio.c @@ -807,17 +807,16 @@ PerlIO_find_layer(pTHX_ const char *name, STRLEN len, int load) SV * const layer = newSVpvn(name, len); CV * const cv = get_cvs("PerlIO::Layer::NoWarnings", 0); ENTER; - SAVEINT(PL_in_load_module); + SAVEBOOL(PL_in_load_module); if (cv) { SAVEGENERICSV(PL_warnhook); PL_warnhook = MUTABLE_SV((SvREFCNT_inc_simple_NN(cv))); } - PL_in_load_module++; + PL_in_load_module = TRUE; /* * The two SVs are magically freed by load_module */ Perl_load_module(aTHX_ 0, pkgsv, NULL, layer, NULL); - PL_in_load_module--; LEAVE; return PerlIO_find_layer(aTHX_ name, len, 0); }