From: Andy Lester Date: Mon, 24 Apr 2006 13:44:51 +0000 (-0500) Subject: use NOOP macro X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6f207bd3ddac24959aa7f00f2d7a66f116dcc7ed;p=p5sagit%2Fp5-mst-13.2.git use NOOP macro Message-ID: <20060424184451.GA1479@petdance.com> p4raw-id: //depot/perl@27958 --- diff --git a/gv.c b/gv.c index 879a14b..5d1991a 100644 --- a/gv.c +++ b/gv.c @@ -974,7 +974,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, if (len > 1) { #ifndef EBCDIC if (*name > 'V' ) { - /*EMPTY*/; + NOOP; /* Nothing else to do. The compiler will probably turn the switch statement into a branch table. Make sure we avoid even that small overhead for @@ -1484,7 +1484,7 @@ Perl_Gv_AMupdate(pTHX_ HV *stash) lim = DESTROY_amg; /* Skip overloading entries. */ #ifdef PERL_DONT_CREATE_GVSV else if (!sv) { - /*EMPTY*/; /* Equivalent to !SvTRUE and !SvOK */ + NOOP; /* Equivalent to !SvTRUE and !SvOK */ } #endif else if (SvTRUE(sv)) diff --git a/gv.h b/gv.h index 4013912..269843f 100644 --- a/gv.h +++ b/gv.h @@ -165,8 +165,8 @@ Return the SV from the GV. #define GvIN_PAD_off(gv) (GvFLAGS(gv) &= ~GVf_IN_PAD) #define GvUNIQUE(gv) 0 -#define GvUNIQUE_on(gv) -#define GvUNIQUE_off(gv) +#define GvUNIQUE_on(gv) NOOP +#define GvUNIQUE_off(gv) NOOP #ifdef USE_ITHREADS #define GV_UNIQUE_CHECK diff --git a/hv.c b/hv.c index 09b1b3f..d7b7f40 100644 --- a/hv.c +++ b/hv.c @@ -2840,7 +2840,7 @@ Perl_hv_assert(pTHX_ HV *hv) real++; /* sanity check the keys */ if (HeSVKEY(entry)) { - /*EMPTY*/ /* Don't know what to check on SV keys. */ + NOOP; /* Don't know what to check on SV keys. */ } else if (HeKUTF8(entry)) { withflags++; if (HeKWASUTF8(entry)) { diff --git a/op.c b/op.c index 52717a2..a8d805c 100644 --- a/op.c +++ b/op.c @@ -509,7 +509,7 @@ S_cop_free(pTHX_ COP* cop) PerlMemShared_free(cop->cop_warnings); if (! specialCopIO(cop->cop_io)) { #ifdef USE_ITHREADS - /*EMPTY*/ + NOOP; #else SvREFCNT_dec(cop->cop_io); #endif @@ -1649,7 +1649,7 @@ S_apply_attrs(pTHX_ HV *stash, SV *target, OP *attrs, bool for_my) /* Don't force the C if we don't need it. */ SV * const * const svp = hv_fetchs(GvHVn(PL_incgv), ATTRSMODULE_PM, FALSE); if (svp && *svp != &PL_sv_undef) - /*EMPTY*/; /* already in %INC */ + NOOP; /* already in %INC */ else Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpvs(ATTRSMODULE), NULL); @@ -2080,7 +2080,7 @@ Perl_localize(pTHX_ OP *o, I32 lex) #if 0 list(o); #else - /*EMPTY*/; + NOOP; #endif else { if ( PL_bufptr > PL_oldbufptr && PL_bufptr[-1] == ',' @@ -3315,7 +3315,7 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, bool isreg) repl_has_vars = 1; } else if (curop->op_type == OP_PUSHRE) - /*EMPTY*/; /* Okay here, dangerous in newASSIGNOP */ + NOOP; /* Okay here, dangerous in newASSIGNOP */ else break; } @@ -6150,7 +6150,7 @@ Perl_ck_ftst(pTHX_ OP *o) const I32 type = o->op_type; if (o->op_flags & OPf_REF) { - /*EMPTY*/; + NOOP; } else if (o->op_flags & OPf_KIDS && cUNOPo->op_first->op_type != OP_STUB) { SVOP * const kid = (SVOP*)cUNOPo->op_first; @@ -8226,7 +8226,7 @@ const_sv_xsub(pTHX_ CV* cv) dVAR; dXSARGS; if (items != 0) { - /*EMPTY*/; + NOOP; #if 0 Perl_croak(aTHX_ "usage: %s::%s()", HvNAME_get(GvSTASH(CvGV(cv))), GvNAME(CvGV(cv))); diff --git a/pad.c b/pad.c index 95a8d42..cc74cb1 100644 --- a/pad.c +++ b/pad.c @@ -853,7 +853,7 @@ S_pad_findlex(pTHX_ const char *name, const CV* cv, U32 seq, int warn, SvNV_set(new_namesv, (NV)0); if (SvPAD_OUR(new_namesv)) { - /*EMPTY*/; /* do nothing */ + NOOP; /* do nothing */ } else if (CvLATE(cv)) { /* delayed creation - just note the offset within parent pad */ diff --git a/perl.h b/perl.h index 9c4636c..a383591 100644 --- a/perl.h +++ b/perl.h @@ -247,8 +247,8 @@ # define PERL_UNUSED_CONTEXT #endif -#define NOOP (void)0 -#define dNOOP extern int Perl___notused PERL_UNUSED_DECL +#define NOOP /*EMPTY*/(void)0 +#define dNOOP extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL #ifndef pTHX /* Don't bother defining tTHX and sTHX; using them outside diff --git a/perlio.c b/perlio.c index 0b010b8..96bf588 100644 --- a/perlio.c +++ b/perlio.c @@ -2566,7 +2566,7 @@ PerlIOUnix_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, } else { if (f) { - /*EMPTY*/; + NOOP; /* * FIXME: pop layers ??? */ @@ -2946,7 +2946,7 @@ PerlIOStdio_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags) goto set_this; } else { - /*EMPTY*/; + NOOP; /* FIXME: To avoid messy error recovery if dup fails re-use the existing stdio as though flag was not set */ @@ -3235,7 +3235,7 @@ PerlIOStdio_flush(pTHX_ PerlIO *f) return PerlSIO_fflush(stdio); } else { - /*EMPTY*/; + NOOP; #if 0 /* * FIXME: This discards ungetc() and pre-read stuff which is not @@ -4377,7 +4377,7 @@ PerlIOCrlf_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt) ptr -= cnt; } else { - /*EMPTY*/; + NOOP; #if 0 /* * Test code - delete when it works ... diff --git a/pp.c b/pp.c index 6136d21..33ac9f4 100644 --- a/pp.c +++ b/pp.c @@ -1097,7 +1097,7 @@ PP(pp_multiply) bhigh = blow >> (4 * sizeof (UV)); blow &= botmask; if (ahigh && bhigh) { - /*EMPTY*/; + NOOP; /* eg 32 bit is at least 0x10000 * 0x10000 == 0x100000000 which is overflow. Drop to NVs below. */ } else if (!ahigh && !bhigh) { @@ -3588,7 +3588,7 @@ PP(pp_lc) #define GREEK_CAPITAL_LETTER_SIGMA 0x03A3 /* Unicode U+03A3 */ if (uv == GREEK_CAPITAL_LETTER_SIGMA) { - /*EMPTY*/ + NOOP; /* * Now if the sigma is NOT followed by * /$ignorable_sequence$cased_letter/; diff --git a/pp_ctl.c b/pp_ctl.c index acefb21..c3bc781 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1925,7 +1925,7 @@ PP(pp_leaveloop) TAINT_NOT; if (gimme == G_VOID) - /*EMPTY*/; /* do nothing */ + NOOP; else if (gimme == G_SCALAR) { if (mark < SP) *++newsp = sv_mortalcopy(*SP); diff --git a/pp_hot.c b/pp_hot.c index 8cb2364..25f055e 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -2520,7 +2520,7 @@ PP(pp_leavesublv) EXTEND_MORTAL(SP - newsp); for (mark = newsp + 1; mark <= SP; mark++) { if (SvTEMP(*mark)) - /*EMPTY*/; + NOOP; else if (SvFLAGS(*mark) & (SVs_PADTMP | SVf_READONLY)) *mark = sv_mortalcopy(*mark); else { diff --git a/regcomp.c b/regcomp.c index b504760..2c5ff0a 100644 --- a/regcomp.c +++ b/regcomp.c @@ -998,7 +998,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs }); } else { - /*EMPTY*/; /* It's a dupe. So ignore it. */ + NOOP; /* It's a dupe. So ignore it. */ } } /* end second pass */ @@ -1204,7 +1204,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs }); } else { - /*EMPTY*/; /* Its a dupe. So ignore it. */ + NOOP; /* Its a dupe. So ignore it. */ } } /* end second pass */ @@ -2938,7 +2938,7 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm) again: if (PL_regkind[(U8)OP(first)] == EXACT) { if (OP(first) == EXACT) - /*EMPTY*/; /* Empty, get anchored substr later. */ + NOOP; /* Empty, get anchored substr later. */ else if ((OP(first) == EXACTF || OP(first) == EXACTFL)) r->regstclass = first; } @@ -5786,7 +5786,7 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o) len, s, PL_colors[1]); } else if (k == TRIE) { - /*EMPTY*/; + NOOP; /* print the details od the trie in dumpuntil instead, as * prog->data isn't available here */ } else if (k == CURLY) { diff --git a/regexec.c b/regexec.c index 747b61b..e2fc13e 100644 --- a/regexec.c +++ b/regexec.c @@ -574,7 +574,7 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, && (!do_utf8 || ((t = reghopmaybe3_c(s, -(prog->check_offset_max), strpos)) && t > strpos))) - /* EMPTY */; + NOOP; else t = strpos; t = HOP3c(t, prog->anchored_offset, strend); diff --git a/sv.c b/sv.c index 899df93..7d9d8ed 100644 --- a/sv.c +++ b/sv.c @@ -35,13 +35,13 @@ * lib/utf8.t lib/Unicode/Collate/t/index.t * --jhi */ -#define ASSERT_UTF8_CACHE(cache) \ +# define ASSERT_UTF8_CACHE(cache) \ STMT_START { if (cache) { assert((cache)[0] <= (cache)[1]); \ assert((cache)[2] <= (cache)[3]); \ assert((cache)[3] <= (cache)[1]);} \ } STMT_END #else -#define ASSERT_UTF8_CACHE(cache) NOOP +# define ASSERT_UTF8_CACHE(cache) NOOP #endif #ifdef PERL_OLD_COPY_ON_WRITE @@ -2063,7 +2063,7 @@ S_sv_2iuv_common(pTHX_ SV *sv) { if ((NV)(SvIVX(sv)) == SvNVX(sv)) { SvIOK_on(sv); } else { - /*EMPTY*/; /* Integer is imprecise. NOK, IOKp */ + NOOP; /* Integer is imprecise. NOK, IOKp */ } /* UV will not work better than IV */ } else { @@ -2078,7 +2078,7 @@ S_sv_2iuv_common(pTHX_ SV *sv) { if ((NV)(SvUVX(sv)) == SvNVX(sv)) { SvIOK_on(sv); } else { - /*EMPTY*/; /* Integer is imprecise. NOK, IOKp, is UV */ + NOOP; /* Integer is imprecise. NOK, IOKp, is UV */ } } SvIsUV_on(sv); @@ -3294,7 +3294,7 @@ S_glob_assign_ref(pTHX_ SV *dstr, SV *sstr) { it was a const and its value changed. */ if (CvCONST(cv) && CvCONST((CV*)sref) && cv_const_sv(cv) == cv_const_sv((CV*)sref)) { - /*EMPTY*/ + NOOP; /* They are 2 constant subroutines generated from the same constant. This probably means that they are really the "same" proxy subroutine @@ -9986,7 +9986,7 @@ Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param) case SVt_PVGV: if (GvUNIQUE((GV*)sstr)) { - /*EMPTY*/; /* Do sharing here, and fall through */ + NOOP; /* Do sharing here, and fall through */ } case SVt_PVIO: case SVt_PVFM: @@ -10097,7 +10097,7 @@ Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param) if (IoDIRP(dstr)) { IoDIRP(dstr) = dirp_dup(IoDIRP(dstr)); } else { - /*EMPTY*/; + NOOP; /* IoDIRP(dstr) is already a copy of IoDIRP(sstr) */ } } diff --git a/utf8.c b/utf8.c index 29cae31..ecfbd69 100644 --- a/utf8.c +++ b/utf8.c @@ -2027,7 +2027,7 @@ S_swash_get(pTHX_ SV* swash, UV start, UV span) } if (opc == '+' && otherval) - /*EMPTY*/; /* replace with otherval */ + NOOP; /* replace with otherval */ else if (opc == '!' && !otherval) otherval = 1; else if (opc == '-' && otherval)