From: Alexey Tourbin Date: Sun, 5 Jun 2005 03:08:30 +0000 (+0400) Subject: util.c: S_vdie_common() should be static X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e07360faf0e39eb99a2f8007e291aab60c228731;p=p5sagit%2Fp5-mst-13.2.git util.c: S_vdie_common() should be static Message-ID: <20050604230830.GS5867@solemn.turbinal.org> p4raw-id: //depot/perl@24729 --- diff --git a/util.c b/util.c index 13379d5..a0135e4 100644 --- a/util.c +++ b/util.c @@ -1076,40 +1076,7 @@ Perl_write_to_stderr(pTHX_ const char* message, int msglen) /* Common code used by vcroak, vdie and vwarner */ -void S_vdie_common(pTHX_ const char *message, STRLEN msglen, I32 utf8); - -STATIC char * -S_vdie_croak_common(pTHX_ const char* pat, va_list* args, STRLEN* msglen, - I32* utf8) -{ - dVAR; - char *message; - - if (pat) { - SV *msv = vmess(pat, args); - if (PL_errors && SvCUR(PL_errors)) { - sv_catsv(PL_errors, msv); - message = SvPV(PL_errors, *msglen); - SvCUR_set(PL_errors, 0); - } - else - message = SvPV(msv,*msglen); - *utf8 = SvUTF8(msv); - } - else { - message = Nullch; - } - - DEBUG_S(PerlIO_printf(Perl_debug_log, - "%p: die/croak: message = %s\ndiehook = %p\n", - thr, message, PL_diehook)); - if (PL_diehook) { - S_vdie_common(aTHX_ message, *msglen, *utf8); - } - return message; -} - -void +STATIC void S_vdie_common(pTHX_ const char *message, STRLEN msglen, I32 utf8) { HV *stash; @@ -1150,6 +1117,37 @@ S_vdie_common(pTHX_ const char *message, STRLEN msglen, I32 utf8) } } +STATIC char * +S_vdie_croak_common(pTHX_ const char* pat, va_list* args, STRLEN* msglen, + I32* utf8) +{ + dVAR; + char *message; + + if (pat) { + SV *msv = vmess(pat, args); + if (PL_errors && SvCUR(PL_errors)) { + sv_catsv(PL_errors, msv); + message = SvPV(PL_errors, *msglen); + SvCUR_set(PL_errors, 0); + } + else + message = SvPV(msv,*msglen); + *utf8 = SvUTF8(msv); + } + else { + message = Nullch; + } + + DEBUG_S(PerlIO_printf(Perl_debug_log, + "%p: die/croak: message = %s\ndiehook = %p\n", + thr, message, PL_diehook)); + if (PL_diehook) { + S_vdie_common(aTHX_ message, *msglen, *utf8); + } + return message; +} + OP * Perl_vdie(pTHX_ const char* pat, va_list *args) {