From 931e0695c454f4c18f68d30775151862650cc4d8 Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Tue, 9 May 2006 07:27:30 -0500 Subject: [PATCH] Proper use of static funcs in toke.c and pp_sys.c Message-ID: <20060509172730.GA5272@petdance.com> p4raw-id: //depot/perl@28179 --- embed.fnc | 1 + embed.h | 2 ++ pp_sys.c | 10 +++++----- proto.h | 4 ++++ toke.c | 12 +++++------- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/embed.fnc b/embed.fnc index f37a7206cd..1d98dff640 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1452,6 +1452,7 @@ s |void |strip_return |NN SV *sv # endif # if defined(DEBUGGING) s |int |tokereport |I32 rv +s |void |printbuf |NN const char* fmt|NN const char* s # endif #endif diff --git a/embed.h b/embed.h index 5edf4bad08..9383ce6e84 100644 --- a/embed.h +++ b/embed.h @@ -1472,6 +1472,7 @@ # if defined(DEBUGGING) #ifdef PERL_CORE #define tokereport S_tokereport +#define printbuf S_printbuf #endif # endif #endif @@ -3635,6 +3636,7 @@ # if defined(DEBUGGING) #ifdef PERL_CORE #define tokereport(a) S_tokereport(aTHX_ a) +#define printbuf(a,b) S_printbuf(aTHX_ a,b) #endif # endif #endif diff --git a/pp_sys.c b/pp_sys.c index 2df5a770e4..a111f1eaad 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -4647,7 +4647,7 @@ PP(pp_ghostent) if (hent) { PUSHs(sv_2mortal(newSVpv((char*)hent->h_name, 0))); - PUSHs(S_space_join_names_mortal(aTHX_ hent->h_aliases)); + PUSHs(space_join_names_mortal(hent->h_aliases)); PUSHs(sv_2mortal(newSViv((IV)hent->h_addrtype))); len = hent->h_length; PUSHs(sv_2mortal(newSViv((IV)len))); @@ -4730,7 +4730,7 @@ PP(pp_gnetent) if (nent) { PUSHs(sv_2mortal(newSVpv(nent->n_name, 0))); - PUSHs(S_space_join_names_mortal(aTHX_ nent->n_aliases)); + PUSHs(space_join_names_mortal(nent->n_aliases)); PUSHs(sv_2mortal(newSViv((IV)nent->n_addrtype))); PUSHs(sv_2mortal(newSViv((IV)nent->n_net))); } @@ -4791,7 +4791,7 @@ PP(pp_gprotoent) if (pent) { PUSHs(sv_2mortal(newSVpv(pent->p_name, 0))); - PUSHs(S_space_join_names_mortal(aTHX_ pent->p_aliases)); + PUSHs(space_join_names_mortal(pent->p_aliases)); PUSHs(sv_2mortal(newSViv((IV)pent->p_proto))); } @@ -4861,7 +4861,7 @@ PP(pp_gservent) if (sent) { PUSHs(sv_2mortal(newSVpv(sent->s_name, 0))); - PUSHs(S_space_join_names_mortal(aTHX_ sent->s_aliases)); + PUSHs(space_join_names_mortal(sent->s_aliases)); #ifdef HAS_NTOHS PUSHs(sv_2mortal(newSViv((IV)PerlSock_ntohs(sent->s_port)))); #else @@ -5278,7 +5278,7 @@ PP(pp_ggrent) * but the gr_mem is poisonous anyway. * So yes, you cannot get the list of group * members if building multithreaded in UNICOS/mk. */ - PUSHs(S_space_join_names_mortal(aTHX_ grent->gr_mem)); + PUSHs(space_join_names_mortal(grent->gr_mem)); #endif } diff --git a/proto.h b/proto.h index c59d5a7359..5ab1d5e7f7 100644 --- a/proto.h +++ b/proto.h @@ -3944,6 +3944,10 @@ STATIC void S_strip_return(pTHX_ SV *sv) # endif # if defined(DEBUGGING) STATIC int S_tokereport(pTHX_ I32 rv); +STATIC void S_printbuf(pTHX_ const char* fmt, const char* s) + __attribute__nonnull__(pTHX_1) + __attribute__nonnull__(pTHX_2); + # endif #endif diff --git a/toke.c b/toke.c index 23f801e352..173474cd0e 100644 --- a/toke.c +++ b/toke.c @@ -3816,9 +3816,7 @@ Perl_yylex(pTHX) if (strnEQ(s,"=>",2)) { s = force_word(PL_bufptr,WORD,FALSE,FALSE,FALSE); - DEBUG_T( { S_printbuf(aTHX_ - "### Saw unary minus before =>, forcing word %s\n", s); - } ); + DEBUG_T( { printbuf("### Saw unary minus before =>, forcing word %s\n", s); } ); OPERATOR('-'); /* unary minus */ } PL_last_uni = PL_oldbufptr; @@ -4788,14 +4786,14 @@ Perl_yylex(pTHX) case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': s = scan_num(s, &yylval); - DEBUG_T( { S_printbuf(aTHX_ "### Saw number in %s\n", s); } ); + DEBUG_T( { printbuf("### Saw number in %s\n", s); } ); if (PL_expect == XOPERATOR) no_op("Number",s); TERM(THING); case '\'': s = scan_str(s,!!PL_madskills,FALSE); - DEBUG_T( { S_printbuf(aTHX_ "### Saw string before %s\n", s); } ); + DEBUG_T( { printbuf("### Saw string before %s\n", s); } ); if (PL_expect == XOPERATOR) { if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) { PL_expect = XTERM; @@ -4812,7 +4810,7 @@ Perl_yylex(pTHX) case '"': s = scan_str(s,!!PL_madskills,FALSE); - DEBUG_T( { S_printbuf(aTHX_ "### Saw string before %s\n", s); } ); + DEBUG_T( { printbuf("### Saw string before %s\n", s); } ); if (PL_expect == XOPERATOR) { if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) { PL_expect = XTERM; @@ -4837,7 +4835,7 @@ Perl_yylex(pTHX) case '`': s = scan_str(s,!!PL_madskills,FALSE); - DEBUG_T( { S_printbuf(aTHX_ "### Saw backtick string before %s\n", s); } ); + DEBUG_T( { printbuf("### Saw backtick string before %s\n", s); } ); if (PL_expect == XOPERATOR) no_op("Backticks",s); if (!s) -- 2.34.1