Change 28179 by [EMAIL PROTECTED] on 2006/05/12 14:33:40

        Subject: [PATCH] Proper use of static funcs in toke.c and pp_sys.c
        From: [EMAIL PROTECTED] (Andy Lester)
        Date: Tue, 9 May 2006 12:27:30 -0500
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/embed.fnc#375 edit
... //depot/perl/embed.h#600 edit
... //depot/perl/pp_sys.c#510 edit
... //depot/perl/proto.h#718 edit
... //depot/perl/toke.c#681 edit

Differences ...

==== //depot/perl/embed.fnc#375 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#374~28175~   2006-05-12 05:13:03.000000000 -0700
+++ perl/embed.fnc      2006-05-12 07:33:40.000000000 -0700
@@ -1452,6 +1452,7 @@
 #  endif
 #  if defined(DEBUGGING)
 s      |int    |tokereport     |I32 rv
+s      |void   |printbuf       |NN const char* fmt|NN const char* s
 #  endif
 #endif
 

==== //depot/perl/embed.h#600 (text+w) ====
Index: perl/embed.h
--- perl/embed.h#599~28086~     2006-05-03 14:46:02.000000000 -0700
+++ perl/embed.h        2006-05-12 07:33:40.000000000 -0700
@@ -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

==== //depot/perl/pp_sys.c#510 (text) ====
Index: perl/pp_sys.c
--- perl/pp_sys.c#509~28076~    2006-05-03 01:52:01.000000000 -0700
+++ perl/pp_sys.c       2006-05-12 07:33:40.000000000 -0700
@@ -4647,7 +4647,7 @@
 
     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 @@
 
     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 @@
 
     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 @@
 
     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 @@
         * 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
     }
 

==== //depot/perl/proto.h#718 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#717~28175~     2006-05-12 05:13:03.000000000 -0700
+++ perl/proto.h        2006-05-12 07:33:40.000000000 -0700
@@ -3944,6 +3944,10 @@
 #  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
 

==== //depot/perl/toke.c#681 (text) ====
Index: perl/toke.c
--- perl/toke.c#680~28087~      2006-05-03 15:01:41.000000000 -0700
+++ perl/toke.c 2006-05-12 07:33:40.000000000 -0700
@@ -3816,9 +3816,7 @@
 
            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 @@
     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 @@
 
     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 @@
 
     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)
End of Patch.

Reply via email to