diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-01-20 17:23:14 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-01-20 17:23:14 +0000 |
commit | 3b6eb69b03afe7feeb11252d06d9daecc9c262f1 (patch) | |
tree | 0da0845aa5cdb0350e72e79aefa3bc4dca1cfcd8 | |
parent | b52f9e809cf344162c325bc2de12e0211f1e5a96 (diff) | |
parent | 3384d91b59037da95d8c4ea56131ee567d0c261c (diff) | |
download | perl-3b6eb69b03afe7feeb11252d06d9daecc9c262f1.tar.gz |
Integrate mainline.
p4raw-id: //depot/perlio@8483
-rw-r--r-- | Changes | 229 | ||||
-rw-r--r-- | configure.com | 4 | ||||
-rw-r--r-- | patchlevel.h | 2 | ||||
-rw-r--r-- | sv.c | 213 | ||||
-rw-r--r-- | t/lib/1_compile.t | 251 | ||||
-rwxr-xr-x | t/op/sprintf.t | 33 | ||||
-rwxr-xr-x | t/op/ver.t | 8 | ||||
-rwxr-xr-x | t/pragma/locale.t | 26 |
8 files changed, 428 insertions, 338 deletions
@@ -32,6 +32,235 @@ Version v5.7.1 Development release working toward v5.8 -------------- ____________________________________________________________________________ +[ 8481] By: jhi on 2001/01/19 14:41:24 + Log: Subject: Re: new feature: s?printf parameter reordering + From: Hugo <hv@crypt.compulink.co.uk> + Date: Thu, 11 Jan 2001 17:09:03 +0000 + Message-Id: <200101111709.RAA23756@crypt.compulink.co.uk> + + - support reordering for all parameters: %, *v, *, .* + - lay down that the reordering specification must immediately + follow that parameter: %3$, *v3$, *3$, .*3$ + - fix vectorisation of a zero-length string + - factor out the code choosing the argument to format + + Possibly unwanted side-effects: + - the special format specifiers ' +-0' must now precede any + vectorisation specifier. Tests in op/sprintf and op/ver + have been changed to reflect this. + - sprintf.t test #214 changed its expectations because in many + cases, the next parameter has already been consumed when an + invalid type letter is detected. + + Probably wanted side-effects: + - attempts to format a non-existent parameter will warn as if C<undef> + - attempt to write to non-existent parameter with '%n' will complain + of "attempt to modify read-only value" instead of being silent + Branch: perl + ! sv.c t/op/sprintf.t t/op/ver.t +____________________________________________________________________________ +[ 8480] By: jhi on 2001/01/19 14:08:37 + Log: Subject: PATCH pragma/locale.t + From: andreas.koenig@anima.de (Andreas J. Koenig) + Date: 18 Jan 2001 09:45:37 +0100 + Message-ID: <m3lms98czy.fsf@ak-71.mind.de> + Branch: perl + ! t/pragma/locale.t +____________________________________________________________________________ +[ 8479] By: jhi on 2001/01/19 13:19:58 + Log: Add tracing for debugging extensions builds in VMS, from Charles Lane. + Branch: perl + ! configure.com +____________________________________________________________________________ +[ 8478] By: jhi on 2001/01/19 02:12:35 + Log: Automate 1_compile.t. + Branch: perl + ! t/lib/1_compile.t +____________________________________________________________________________ +[ 8477] By: jhi on 2001/01/19 01:49:56 + Log: Integrate perlio. + Branch: perl + !> sv.c win32/config.bc win32/config.gc win32/config.vc + !> win32/config_H.bc win32/config_H.gc win32/config_H.vc +____________________________________________________________________________ +[ 8476] By: nick on 2001/01/18 21:51:52 + Log: Integrate mainline + Branch: perlio + +> t/lib/1_compile.t t/lib/compmod.pl + !> MANIFEST configure.com lib/unicode/distinct.pm +____________________________________________________________________________ +[ 8475] By: nick on 2001/01/18 21:48:02 + Log: Win32 "safe signals" co-existance fix. + Fix SIG_SIZE value. + Clear PL_sig_pending when cloning (fork). + Branch: perlio + ! sv.c win32/config.bc win32/config.gc win32/config.vc + ! win32/config_H.bc win32/config_H.gc win32/config_H.vc +____________________________________________________________________________ +[ 8474] By: jhi on 2001/01/18 14:40:57 + Log: It's Pod::Text::Overstrike, not Pod::Overstrike. + Branch: perl + ! t/lib/1_compile.t +____________________________________________________________________________ +[ 8473] By: gsar on 2001/01/18 11:42:31 + Log: unsubmitted trial1 change + Branch: maint-5.6/perl + ! Changes +____________________________________________________________________________ +[ 8472] By: jhi on 2001/01/18 04:30:24 + Log: The first bug found by 1_compile.t. + Branch: perl + ! lib/unicode/distinct.pm +____________________________________________________________________________ +[ 8471] By: jhi on 2001/01/18 04:29:42 + Log: Add Schwern's 1_compile test. The compile_module script renamed + to be a bit shorter for the 8.3 people. + Branch: perl + + t/lib/1_compile.t t/lib/compmod.pl + ! MANIFEST +____________________________________________________________________________ +[ 8470] By: jhi on 2001/01/18 04:16:00 + Log: Subject: [PATCH: perl@8453] Re: subversion undef on VMS (was Re: [ID 20001218.033] Not OK: perl v5.6.1 +v5.6.1-TRIAL1 on VMS_AXP V7.2-1) + From: Peter Prymmer <pvhp@forte.com> + Date: Wed, 17 Jan 2001 13:07:11 -0800 (PST) + Message-ID: <Pine.OSF.4.10.10101171255380.289071-100000@aspara.forte.com> + Replace #8463. + Branch: maint-5.6/perl + ! configure.com +____________________________________________________________________________ +[ 8469] By: jhi on 2001/01/18 04:13:02 + Log: Subject: [PATCH: perl@8453] Re: subversion undef on VMS (was Re: [ID 20001218.033] Not OK: perl v5.6.1 +v5.6.1-TRIAL1 on VMS_AXP V7.2-1) + From: Peter Prymmer <pvhp@forte.com> + Date: Wed, 17 Jan 2001 13:07:11 -0800 (PST) + Message-ID: <Pine.OSF.4.10.10101171255380.289071-100000@aspara.forte.com> + Replace #8462. + Branch: perl + ! configure.com +____________________________________________________________________________ +[ 8468] By: jhi on 2001/01/18 03:42:08 + Log: Integrate perlio. + Branch: perl + !> gv.c mg.c perlio.c util.c +____________________________________________________________________________ +[ 8467] By: nick on 2001/01/17 22:41:10 + Log: "Safe" signals - trial implementation. + gv.c tweaked to zero PL_sig_pend array + perlio.c tweaked to PERL_ASYNC_CHECK() on EINTR + util.c tweaked to not set SA_RESTART to give perlio.c a chance. + Odd thing is that it "works" with PERLIO=stdio as well (linux). + Branch: perlio + ! gv.c mg.c perlio.c util.c +____________________________________________________________________________ +[ 8466] By: nick on 2001/01/17 20:40:20 + Log: Integrate mainline. + Branch: perlio + !> Configure Porting/Glossary Porting/config.sh Porting/config_H + !> config_h.SH configure.com epoc/config.sh gv.c pod/perltoc.pod + !> pp.c pp_sys.c sv.c t/op/int.t uconfig.h uconfig.sh + !> vos/config.alpha.def vos/config.alpha.h vos/config.ga.def + !> vos/config.ga.h win32/config.bc win32/config.gc + !> win32/config.vc +____________________________________________________________________________ +[ 8465] By: jhi on 2001/01/17 18:37:13 + Log: Subject: [PATCH] Re: [PATCH: perl@8429] lib/tie-substrhash.t FAILED at test 11 + From: Nicholas Clark <nick@ccl4.org> + Date: Wed, 17 Jan 2001 17:31:33 +0000 + Message-ID: <20010117173133.I2633@plum.flirble.org> + Branch: perl + ! t/op/int.t +____________________________________________________________________________ +[ 8464] By: jhi on 2001/01/17 14:43:17 + Log: Subject: [PATCH: perl@8429] lib/tie-substrhash.t FAILED at test 11 + From: "Roca, Ignasi" <ignasi.roca@fujitsu.siemens.es> + Date: Wed, 17 Jan 2001 15:16:43 +0100 + Message-ID: <5930DC161690D2119667009027157547038C8A85@madt009a.siemens.es> + + pp_int() was dropping an NV to the floor, + int(279964589018079/59) either returned not an integer + 4745162525730.15, or one got "Attempt to free unreferenced scalar." + Branch: perl + ! pp.c +____________________________________________________________________________ +[ 8463] By: jhi on 2001/01/17 06:12:42 + Log: (Replaced by #8470) + + Subject: subversion undef on VMS (was Re: [ID 20001218.033] Not OK: perl v5.6.1 +v5.6.1-TRIAL1 on VMS_AXP V7.2-1) + From: "Craig A. Berry" <craigberry@mac.com> + Date: Tue, 16 Jan 2001 23:38:46 -0600 + Message-Id: <p04330103b68ad8cfcbfd@[172.16.52.1]> + Branch: maint-5.6/perl + ! configure.com +____________________________________________________________________________ +[ 8462] By: jhi on 2001/01/17 06:11:31 + Log: (Replaced by #8469) + + Subject: subversion undef on VMS (was Re: [ID 20001218.033] Not OK: perl v5.6.1 +v5.6.1-TRIAL1 on VMS_AXP V7.2-1) + From: "Craig A. Berry" <craigberry@mac.com> + Date: Tue, 16 Jan 2001 23:38:46 -0600 + Message-Id: <p04330103b68ad8cfcbfd@[172.16.52.1]> + Branch: perl + ! configure.com +____________________________________________________________________________ +[ 8461] By: jhi on 2001/01/17 05:56:12 + Log: Allow for one trailing slash in the directory of mkdir(). + Branch: perl + ! pp_sys.c +____________________________________________________________________________ +[ 8460] By: jhi on 2001/01/17 03:26:01 + Log: Metaconfig unit changes for #8459. + Branch: metaconfig + ! U/modified/Loc.U U/modified/sig_name.U +____________________________________________________________________________ +[ 8459] By: jhi on 2001/01/17 03:24:48 + Log: Define SIG_SIZE, the number of elements in the sig_name and + sig_num arrays, including the final NULL entry. + Branch: perl + ! Configure Porting/Glossary Porting/config.sh Porting/config_H + ! config_h.SH configure.com epoc/config.sh gv.c pod/perltoc.pod + ! sv.c uconfig.h uconfig.sh vos/config.alpha.def + ! vos/config.alpha.h vos/config.ga.def vos/config.ga.h + ! win32/config.bc win32/config.gc win32/config.vc +____________________________________________________________________________ +[ 8458] By: jhi on 2001/01/17 01:41:33 + Log: Integrate perlio. + Branch: perl + !> embed.h embed.pl embedvar.h gv.c intrpvar.h mg.c perl.c perl.h + !> perlapi.h proto.h sv.c +____________________________________________________________________________ +[ 8457] By: nick on 2001/01/16 22:07:26 + Log: Provide infrastructure for PERL_ASYNC_CHECK() style safe signals. + Provides all the "cost" but no benefit yet - it is to allow cost + to be measured, and implementation experiments (just in mg.c?). + Branch: perlio + ! embed.h embed.pl embedvar.h gv.c intrpvar.h mg.c perl.c perl.h + ! perlapi.h proto.h sv.c +____________________________________________________________________________ +[ 8456] By: nick on 2001/01/16 21:07:07 + Log: Integrate mainline. + Branch: perlio + !> (integrate 51 files) +____________________________________________________________________________ +[ 8455] By: jhi on 2001/01/16 18:13:43 + Log: Subject: [PATCH] regcomp.c old feature removal + From: mjd@plover.com + Date: 16 Jan 2001 14:43:18 -0000 + Message-ID: <20010116144318.7140.qmail@plover.com> + Branch: perl + ! regcomp.c +____________________________________________________________________________ +[ 8454] By: jhi on 2001/01/16 16:12:39 + Log: Subject: [PATCH: perl-5.6.1-TRIAL1] Win32 Makefile fixes - v2 + From: "Indy Singh" <indy@nusphere.com> + Date: Wed, 10 Jan 2001 20:17:49 -0500 + Message-ID: <003001c07b6c$524630b0$00957018@roadhog> + Branch: maint-5.6/perl + ! win32/Makefile +____________________________________________________________________________ +[ 8453] By: jhi on 2001/01/16 16:09:33 + Log: Update Changes. + Branch: perl + ! Changes patchlevel.h +____________________________________________________________________________ [ 8452] By: jhi on 2001/01/16 15:42:04 Log: Subject: Re: API Cleanup To: perl5-porters@perl.org diff --git a/configure.com b/configure.com index 76c85cfe34..1bbb65dfb8 100644 --- a/configure.com +++ b/configure.com @@ -4818,9 +4818,11 @@ $ ENDIF $ IF use_vmsdebug_perl $ THEN $ optimize="/Debug/NoOpt" +$ ldflags="/Debug/Trace/Map" $ dbgprefix = "DBG" $ ELSE $ optimize= "" +$ ldflags="/NoTrace/NoMap" $ dbgprefix = "" $ ENDIF $! @@ -5307,7 +5309,7 @@ $ WC "ivtype='" + ivtype + "'" $ WC "known_extensions='" + known_extensions + "'" $ WC "ld='" + ld + "'" $ WC "lddlflags='/Share'" -$ WC "ldflags='/NoTrace/NoMap'" +$ WC "ldflags='" + ldflags " "'" $ WC "lib_ext='" + lib_ext + "'" $ WC "libc='" + libc + "'" $ WC "libpth='/sys$share /sys$library'" diff --git a/patchlevel.h b/patchlevel.h index a1190bd8e6..553ddd33de 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -70,7 +70,7 @@ #if !defined(PERL_PATCHLEVEL_H_IMPLICIT) && !defined(LOCAL_PATCH_COUNT) static char *local_patches[] = { NULL - ,"DEVEL8452" + ,"DEVEL8481" ,NULL }; @@ -6704,6 +6704,21 @@ Perl_sv_vsetpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, maybe_tainted); } +I32 +S_expect_number(char** pattern) +{ + I32 var = 0; + switch (**pattern) { + case '1': case '2': case '3': + case '4': case '5': case '6': + case '7': case '8': case '9': + while (isDIGIT(**pattern)) + var = var * 10 + (*(*pattern)++ - '0'); + } + return var; +} +#define EXPECT_NUMBER(pattern, var) (var = S_expect_number(&pattern)) + /* =for apidoc sv_vcatpvfn @@ -6764,6 +6779,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV bool alt = FALSE; bool left = FALSE; bool vectorize = FALSE; + bool vectorarg = FALSE; bool utf = FALSE; char fill = ' '; char plus = 0; @@ -6801,10 +6817,13 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV STRLEN gap; char *dotstr = "."; STRLEN dotstrlen = 1; - I32 epix = 0; /* explicit parameter index */ + I32 efix = 0; /* explicit format parameter index */ I32 ewix = 0; /* explicit width index */ + I32 epix = 0; /* explicit precision index */ + I32 evix = 0; /* explicit vector index */ bool asterisk = FALSE; + /* echo everything up to the next format specification */ for (q = p; q < patend && *q != '%'; ++q) ; if (q > p) { sv_catpvn(sv, p, q - p); @@ -6813,6 +6832,25 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV if (q++ >= patend) break; +/* + We allow format specification elements in this order: + \d+\$ explicit format parameter index + [-+ 0#]+ flags + \*?(\d+\$)?v vector with optional (optionally specified) arg + \d+|\*(\d+\$)? width using optional (optionally specified) arg + \.(\d*|\*(\d+\$)?) precision using optional (optionally specified) arg + [hlqLV] size + [%bcdefginopsux_DFOUX] format (mandatory) +*/ + if (EXPECT_NUMBER(q, width)) { + if (*q == '$') { + ++q; + efix = width; + } else { + goto gotwidth; + } + } + /* FLAGS */ while (*q) { @@ -6836,64 +6874,63 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV q++; continue; - case '*': /* printf("%*vX",":",$ipv6addr) */ - if (q[1] != 'v') - break; - q++; - if (args) - vecsv = va_arg(*args, SV*); - else if (svix < svmax) - vecsv = svargs[svix++]; - else - continue; - dotstr = SvPVx(vecsv,dotstrlen); - if (DO_UTF8(vecsv)) - is_utf = TRUE; - /* FALL THROUGH */ - - case 'v': - vectorize = TRUE; - q++; - continue; - default: break; } break; } - /* WIDTH */ - - scanwidth: - + tryasterisk: if (*q == '*') { - if (asterisk) - goto unknown; + q++; + if (EXPECT_NUMBER(q, ewix)) + if (*q++ != '$') + goto unknown; asterisk = TRUE; + } + if (*q == 'v') { q++; + if (vectorize) + goto unknown; + if (vectorarg = asterisk) { + evix = ewix; + ewix = 0; + asterisk = FALSE; + } + vectorize = TRUE; + goto tryasterisk; } - switch (*q) { - case '1': case '2': case '3': - case '4': case '5': case '6': - case '7': case '8': case '9': - width = 0; - while (isDIGIT(*q)) - width = width * 10 + (*q++ - '0'); - if (*q == '$') { - if (asterisk && ewix == 0) { - ewix = width; - width = 0; - q++; - goto scanwidth; - } else if (epix == 0) { - epix = width; - width = 0; - q++; - goto scanwidth; - } else - goto unknown; + if (!asterisk) + EXPECT_NUMBER(q, width); + + if (vectorize) { + if (vectorarg) { + if (args) + vecsv = va_arg(*args, SV*); + else + vecsv = (evix ? evix <= svmax : svix < svmax) ? + svargs[ewix ? ewix-1 : svix++] : &PL_sv_undef; + dotstr = (U8*)SvPVx(vecsv, dotstrlen); + if (DO_UTF8(vecsv)) + is_utf = TRUE; + } + if (args) { + vecsv = va_arg(*args, SV*); + vecstr = (U8*)SvPVx(vecsv,veclen); + utf = DO_UTF8(vecsv); } + else if (efix ? efix <= svmax : svix < svmax) { + vecsv = svargs[efix ? efix-1 : svix++]; + vecstr = (U8*)SvPVx(vecsv,veclen); + utf = DO_UTF8(vecsv); + } + else { + vecstr = (U8*)""; + veclen = 0; + } + if (DO_UTF8(vecsv)) + is_utf = TRUE; } if (asterisk) { @@ -6905,19 +6942,22 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV left |= (i < 0); width = (i < 0) ? -i : i; } + gotwidth: /* PRECISION */ if (*q == '.') { q++; if (*q == '*') { + q++; + if (EXPECT_NUMBER(q, epix) && *q++ != '$') + goto unknown; if (args) i = va_arg(*args, int); else i = (ewix ? ewix <= svmax : svix < svmax) ? SvIVx(svargs[ewix ? ewix-1 : svix++]) : 0; precis = (i < 0) ? 0 : i; - q++; } else { precis = 0; @@ -6927,23 +6967,6 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV has_precis = TRUE; } - if (vectorize) { - if (args) { - vecsv = va_arg(*args, SV*); - vecstr = (U8*)SvPVx(vecsv,veclen); - utf = DO_UTF8(vecsv); - } - else if (epix ? epix <= svmax : svix < svmax) { - vecsv = svargs[epix ? epix-1 : svix++]; - vecstr = (U8*)SvPVx(vecsv,veclen); - utf = DO_UTF8(vecsv); - } - else { - vecstr = (U8*)""; - veclen = 0; - } - } - /* SIZE */ switch (*q) { @@ -6975,21 +6998,22 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV /* CONVERSION */ + if (*q == '%') { + eptr = q++; + elen = 1; + goto string; + } + + if (!args) + argsv = (efix ? efix <= svmax : svix < svmax) ? + svargs[efix ? efix-1 : svix++] : &PL_sv_undef; + switch (c = *q++) { /* STRINGS */ - case '%': - eptr = q - 1; - elen = 1; - goto string; - case 'c': - if (args) - uv = va_arg(*args, int); - else - uv = (epix ? epix <= svmax : svix < svmax) ? - SvIVx(svargs[epix ? epix-1 : svix++]) : 0; + uv = args ? va_arg(*args, int) : SvIVx(argsv); if ((uv > 255 || (uv > 127 && SvUTF8(sv))) && !IN_BYTE) { eptr = (char*)utf8buf; elen = uv_to_utf8((U8*)eptr, uv) - utf8buf; @@ -7018,8 +7042,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV elen = sizeof nullstr - 1; } } - else if (epix ? epix <= svmax : svix < svmax) { - argsv = svargs[epix ? epix-1 : svix++]; + else { eptr = SvPVx(argsv, elen); if (DO_UTF8(argsv)) { if (has_precis && precis < elen) { @@ -7043,7 +7066,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV */ if (!args) goto unknown; - argsv = va_arg(*args,SV*); + argsv = va_arg(*args, SV*); eptr = SvPVx(argsv, elen); if (DO_UTF8(argsv)) is_utf = TRUE; @@ -7059,11 +7082,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV case 'p': if (alt) goto unknown; - if (args) - uv = PTR2UV(va_arg(*args, void*)); - else - uv = (epix ? epix <= svmax : svix < svmax) ? - PTR2UV(svargs[epix ? epix-1 : svix++]) : 0; + uv = PTR2UV(args ? va_arg(*args, void*) : argsv); base = 16; goto integer; @@ -7078,10 +7097,8 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV case 'i': if (vectorize) { STRLEN ulen; - if (!veclen) { - vectorize = FALSE; - break; - } + if (!veclen) + continue; if (utf) iv = (IV)utf8_to_uv(vecstr, veclen, &ulen, 0); else { @@ -7103,8 +7120,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV } } else { - iv = (epix ? epix <= svmax : svix < svmax) ? - SvIVx(svargs[epix ? epix-1 : svix++]) : 0; + iv = SvIVx(argsv); switch (intsize) { case 'h': iv = (short)iv; break; default: break; @@ -7161,10 +7177,8 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV if (vectorize) { STRLEN ulen; vector: - if (!veclen) { - vectorize = FALSE; - break; - } + if (!veclen) + continue; if (utf) uv = utf8_to_uv(vecstr, veclen, &ulen, 0); else { @@ -7186,8 +7200,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV } } else { - uv = (epix ? epix <= svmax : svix < svmax) ? - SvUVx(svargs[epix ? epix-1 : svix++]) : 0; + uv = SvUVx(argsv); switch (intsize) { case 'h': uv = (unsigned short)uv; break; default: break; @@ -7276,11 +7289,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV /* This is evil, but floating point is even more evil */ vectorize = FALSE; - if (args) - nv = va_arg(*args, NV); - else - nv = (epix ? epix <= svmax : svix < svmax) ? - SvNVx(svargs[epix ? epix-1 : svix++]) : 0.0; + nv = args ? va_arg(*args, NV) : SvNVx(argsv); need = 0; if (c != 'e' && c != 'E') { @@ -7360,8 +7369,8 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV #endif } } - else if (epix ? epix <= svmax : svix < svmax) - sv_setuv_mg(svargs[epix ? epix-1 : svix++], (UV)i); + else + sv_setuv_mg(argsv, (UV)i); continue; /* not "break" */ /* UNKNOWN */ diff --git a/t/lib/1_compile.t b/t/lib/1_compile.t index c3462b3a2d..3613639119 100644 --- a/t/lib/1_compile.t +++ b/t/lib/1_compile.t @@ -7,222 +7,63 @@ BEGIN { use strict; use warnings; +use Config; +use File::Find; -# This list really needs to be dynamic. - -my @Core_Modules = ( - 'AnyDBM_File', - 'AutoLoader', - 'AutoSplit', - 'B', # Do all these B things compile everywhere? - 'B::Asmdata', - 'B::Assembler', - 'B::Bblock', - 'B::Bytecode', - 'B::C', - 'B::CC', - 'B::Concise', - 'B::Debug', - 'B::Deparse', - 'B::Disassembler', - 'B::Lint', - 'B::Showlex', - 'B::Stackobj', - 'B::Stash', - 'B::Terse', - 'B::Xref', - 'Benchmark', - 'ByteLoader', - 'CGI', - 'CGI::Apache', - 'CGI::Carp', - 'CGI::Cookie', - # 'CGI::Fast', # won't load without FCGI - 'CGI::Pretty', - 'CGI::Push', - 'CGI::Switch', - 'CGI::Util', - 'CPAN', - 'CPAN::FirstTime', - 'CPAN::Nox', - 'Carp', - 'Carp::Heavy', - 'Class::Struct', - 'Config', - 'Cwd', - 'DB', - # DB_File # config specific - 'Data::Dumper', - # 'Devel::DProf', # needs to run as -d:DProf - 'Devel::Peek', - 'Devel::SelfStubber', - 'DirHandle', - 'Dumpvalue', - 'DynaLoader', # config specific? - 'English', - 'Encode', - 'Env', - 'Errno', - 'Exporter', - 'Exporter::Heavy', - 'ExtUtils::Command', - 'ExtUtils::Embed', - 'ExtUtils::Install', - 'ExtUtils::Installed', - 'ExtUtils::Liblist', - # ExtUtils::MM_Cygwin # ExtUtils::MakeMaker takes - # ExtUtils::MM_OS2 # care of testing these. - # ExtUtils::MM_Unix - # ExtUtils::MM_VMS - # ExtUtils::MM_Win32 - 'ExtUtils::MakeMaker', - 'ExtUtils::Manifest', - 'ExtUtils::Mkbootstrap', - 'ExtUtils::Mksymlists', - 'ExtUtils::Packlist', - 'ExtUtils::testlib', - 'Fatal', - 'Fcntl', # config specific? - 'File::Basename', - 'File::CheckTree', - 'File::Compare', - 'File::Copy', - 'File::DosGlob', - 'File::Find', - 'File::Glob', - 'File::Path', - 'File::Spec', - 'File::Spec::Functions', - # File::Spec::EPOC # File::Spec will take care of - # File::Spec::Mac # testing these compile. - # File::Spec::OS2 - # File::Spec::Unix - # File::Spec::VMS - # File::Spec::Win32 - 'File::stat', - 'FileCache', - 'FileHandle', - 'Filter::Simple', - 'Filter::Util::Call', - 'FindBin', - 'Getopt::Long', - 'Getopt::Std', - 'I18N::Collate', - 'IO', - 'IO::Dir', - 'IO::File', - 'IO::Handle', - 'IO::Pipe', - 'IO::Poll', - 'IO::Seekable', - 'IO::Select', - 'IO::Socket', - 'IO::Socket::INET', - # IO::Socket::UNIX # config specific - 'IPC::Msg', - 'IPC::Open2', - 'IPC::Open3', - 'IPC::Semaphore', # config specific? - 'IPC::SysV', # config specific? - 'Math::BigFloat', - 'Math::BigInt', - 'Math::Complex', - 'Math::Trig', - 'Net::Ping', - 'Net::hostent', - 'Net::netent', - 'Net::protoent', - 'Net::servent', - 'O', - 'Opcode', - 'POSIX', # config specific? - 'Pod::Checker', - 'Pod::Find', - 'Pod::Functions', - 'Pod::Html', - 'Pod::InputObjects', - 'Pod::Man', - 'Pod::ParseUtils', - 'Pod::Parser', - 'Pod::Plainer', - 'Pod::Select', - 'Pod::Text', - 'Pod::Text::Color', - 'Pod::Text::Overstrike', - 'Pod::Text::Termcap', - 'Pod::Usage', - 'SDBM_File', - 'Safe', - 'Search::Dict', - 'SelectSaver', - 'SelfLoader', - 'Shell', - 'Socket', - 'Symbol', - 'Sys::Hostname', - 'Sys::Syslog', - 'Term::ANSIColor', - 'Term::Cap', - 'Term::Complete', - 'Term::ReadLine', - 'Test', - 'Test::Harness', - 'Text::Abbrev', - 'Text::ParseWords', - 'Text::Soundex', - 'Text::Tabs', - 'Text::Wrap', - 'Tie::Array', - 'Tie::Hash', - 'Tie::RefHash', - 'Tie::Scalar', - 'Tie::SubstrHash', - 'Time::Local', - 'Time::gmtime', - 'Time::localtime', - 'Time::tm', - 'UNIVERSAL', - 'User::grent', - 'User::pwent', - 'XSLoader', - 'attributes', - 'attrs', - 'autouse', - 'blib', - 'bytes', - 'charnames', - 'constant', - 'diagnostics', - 'filetest', - 'integer', - 'less', - 'lib', - 'locale', - 'open', - 'ops', - 'overload', - 're', - 'sigtrap', - 'strict', - 'subs', - 'unicode::distinct', - 'utf8', - 'vars', - 'warnings', - 'warnings::register', - ); +my %Core_Modules; + +find(sub { + if ($File::Find::name =~ m!^lib\W+(.+)\.pm$!i) { + my $module = $1; + $module =~ s/[^\w-]/::/g; + $Core_Modules{$module}++; + } + }, "lib"); + +# Delete stuff that can't be tested here. + +sub delete_unless_in_extensions { + delete $Core_Modules{$_[0]} unless $Config{extensions} =~ /\b$_[0]\b/; +} + +foreach my $known_extension (split(' ', $Config{known_extensions})) { + delete_unless_in_extensions($known_extension); +} + +sub delete_by_prefix { + delete @Core_Modules{grep { /^$_[0]/ } keys %Core_Modules}; +} + +delete $Core_Modules{'CGI::Fast'}; # won't load without FCGI + +delete $Core_Modules{'Devel::DProf'}; # needs to be run as -d:DProf + +delete_by_prefix('ExtUtils::MM_'); # ExtUtils::MakeMaker's domain + +delete_by_prefix('File::Spec::'); # File::Spec's domain +$Core_Modules{'File::Spec::Functions'}++; # put this back + +delete_by_prefix('Thread::') unless $Config{extensions} =~ /\bThread\b/; + +delete_by_prefix('unicode::'); +$Core_Modules{'unicode::distinct'}++; # put this back + +# Okay, this is the list. + +my @Core_Modules = sort keys %Core_Modules; print "1..".@Core_Modules."\n"; my $test_num = 1; + foreach my $module (@Core_Modules) { - print "not " unless compile_module($module); + print "# $module compile failed\nnot " unless compile_module($module); print "ok $test_num\n"; $test_num++; } -# We do this as a seperate process else we'll blow the hell out of our +# We do this as a separate process else we'll blow the hell out of our # namespace. sub compile_module { my($module) = @_; diff --git a/t/op/sprintf.t b/t/op/sprintf.t index 4e80999bc3..055b0e4b30 100755 --- a/t/op/sprintf.t +++ b/t/op/sprintf.t @@ -21,7 +21,9 @@ print '1..', scalar @tests, "\n"; $SIG{__WARN__} = sub { if ($_[0] =~ /^Invalid conversion/) { - $w = ' INVALID' + $w = ' INVALID'; + } elsif ($_[0] =~ /^Use of uninitialized value/) { + $w = ' UNINIT'; } else { warn @_; } @@ -175,19 +177,19 @@ __END__ >%#vd< >chr(1)< >1< >%vd< >"\01\02\03"< >1.2.3< >%v.3d< >"\01\02\03"< >001.002.003< ->%v03d< >"\01\02\03"< >001.002.003< ->%v-3d< >"\01\02\03"< >1 .2 .3 < ->%v+-3d< >"\01\02\03"< >+1 .2 .3 < +>%0v3d< >"\01\02\03"< >001.002.003< +>%-v3d< >"\01\02\03"< >1 .2 .3 < +>%+-v3d< >"\01\02\03"< >+1 .2 .3 < >%v4.3d< >"\01\02\03"< > 001. 002. 003< ->%v04.3d< >"\01\02\03"< >0001.0002.0003< ->%*v02d< >['-', "\0\7\14"]< >00-07-12< ->%v.*d< >[3, "\01\02\03"]< >001.002.003< ->%v0*d< >[3, "\01\02\03"]< >001.002.003< ->%v-*d< >[3, "\01\02\03"]< >1 .2 .3 < ->%v+-*d< >[3, "\01\02\03"]< >+1 .2 .3 < ->%v*.*d< >[4, 3, "\01\02\03"]< > 001. 002. 003< ->%v0*.*d< >[4, 3, "\01\02\03"]< >0001.0002.0003< ->%*v0*d< >['-', 2, "\0\7\13"]< >00-07-11< +>%0v4.3d< >"\01\02\03"< >0001.0002.0003< +>%0*v2d< >['-', "\0\7\14"]< >00-07-12< +>%v.*d< >["\01\02\03", 3]< >001.002.003< +>%0v*d< >["\01\02\03", 3]< >001.002.003< +>%-v*d< >["\01\02\03", 3]< >1 .2 .3 < +>%+-v*d< >["\01\02\03", 3]< >+1 .2 .3 < +>%v*.*d< >["\01\02\03", 4, 3]< > 001. 002. 003< +>%0v*.*d< >["\01\02\03", 4, 3]< >0001.0002.0003< +>%0*v*d< >['-', "\0\7\13", 2]< >00-07-11< >%e< >1234.875< >1.234875e+03< >%e< >0.000012345< >1.234500e-05< >%e< >1234567E96< >1.234567e+102< @@ -314,10 +316,11 @@ __END__ >%2$d %d %d< >[12, 34]< >34 12 34< >%3$d %d %d< >[12, 34, 56]< >56 12 34< >%2$*3$d %d< >[12, 34, 3]< > 34 12< ->%*3$2$d %d< >[12, 34, 3]< > 34 12< ->%2$d< >12< >0< +>%*3$2$d %d< >[12, 34, 3]< >%*3$2$d 34 INVALID< +>%2$d< >12< >0 UNINIT< >%0$d< >12< >%0$d INVALID< >%1$$d< >12< >%1$$d INVALID< >%1$1$d< >12< >%1$1$d INVALID< >%*2$*2$d< >[12, 3]< >%*2$*2$d INVALID< >%*2*2$d< >[12, 3]< >%*2*2$d INVALID< +>%0v2.2d< >''< >< diff --git a/t/op/ver.t b/t/op/ver.t index edfebd20ff..b9ba5891f0 100755 --- a/t/op/ver.t +++ b/t/op/ver.t @@ -102,10 +102,10 @@ print "not " unless sprintf("%vX", 1.22.333.4444) eq '1.16.14D.115C'; print "ok $test\n"; ++$test; if (ord("\t") == 9) { # ASCII - print "not " unless sprintf("%*v#o", ":", "Perl") eq '0120:0145:0162:0154'; + print "not " unless sprintf("%#*vo", ":", "Perl") eq '0120:0145:0162:0154'; } else { - print "not " unless sprintf("%*v#o", ":", "Perl") eq '0327:0205:0231:0223'; + print "not " unless sprintf("%#*vo", ":", "Perl") eq '0327:0205:0231:0223'; } print "ok $test\n"; ++$test; @@ -144,10 +144,10 @@ print "ok $test\n"; ++$test; print "ok $test\n"; ++$test; if (ord("\t") == 9) { # ASCII - print "not " unless sprintf("%*v#o", ":", "Perl") eq '0120:0145:0162:0154'; + print "not " unless sprintf("%#*vo", ":", "Perl") eq '0120:0145:0162:0154'; } else { - print "not " unless sprintf("%*v#o", ":", "Perl") eq '0327:0205:0231:0223'; + print "not " unless sprintf("%#*vo", ":", "Perl") eq '0327:0205:0231:0223'; } print "ok $test\n"; ++$test; diff --git a/t/pragma/locale.t b/t/pragma/locale.t index 61528b35c3..068fedeac8 100755 --- a/t/pragma/locale.t +++ b/t/pragma/locale.t @@ -15,8 +15,18 @@ use strict; my $debug = 1; +use Dumpvalue; + +my $dumper = Dumpvalue->new( + tick => qq{"}, + quoteHighBit => 0, + unctrl => "quote" + ); sub debug { - print @_ if $debug; + return unless $debug; + my($mess) = join "", @_; + chop $mess; + print $dumper->stringify($mess,1), "\n"; } sub debugf { @@ -428,8 +438,6 @@ my %Neoalpha; sub tryneoalpha { my ($Locale, $i, $test) = @_; - debug "# testing $i with locale '$Locale'\n" - unless $Testing{$i}{$Locale}++; unless ($test) { $Problem{$i}{$Locale} = 1; debug "# failed $i with locale '$Locale'\n"; @@ -441,7 +449,7 @@ sub tryneoalpha { foreach $Locale (@Locale) { debug "# Locale = $Locale\n"; @Alnum_ = getalnum_(); - debug "# \\w = @Alnum_\n"; + debug "# w = ", join("",@Alnum_), "\n"; unless (setlocale(LC_ALL, $Locale)) { foreach (99..103) { @@ -476,9 +484,9 @@ foreach $Locale (@Locale) { delete $lower{$_}; } - debug "# UPPER = ", join(" ", sort keys %UPPER ), "\n"; - debug "# lower = ", join(" ", sort keys %lower ), "\n"; - debug "# BoThCaSe = ", join(" ", sort keys %BoThCaSe), "\n"; + debug "# UPPER = ", join("", sort keys %UPPER ), "\n"; + debug "# lower = ", join("", sort keys %lower ), "\n"; + debug "# BoThCaSe = ", join("", sort keys %BoThCaSe), "\n"; # Find the alphabets that are not alphabets in the default locale. @@ -494,7 +502,7 @@ foreach $Locale (@Locale) { @Neoalpha = sort @Neoalpha; - debug "# Neoalpha = @Neoalpha\n"; + debug "# Neoalpha = ", join("",@Neoalpha), "\n"; if (@Neoalpha == 0) { # If we have no Neoalphas the remaining tests are no-ops. @@ -661,7 +669,6 @@ foreach $Locale (@Locale) { tryneoalpha($Locale, 114, $f == $c); } - debug "# testing 115 with locale '$Locale'\n"; # Does taking lc separately differ from taking # the lc "in-line"? (This was the bug 19990704.002, change #3568.) # The bug was in the caching of the 'o'-magic. @@ -687,7 +694,6 @@ foreach $Locale (@Locale) { lcA($x, $z) == 0 && lcB($x, $z) == 0); } - debug "# testing 116 with locale '$Locale'\n"; # Does lc of an UPPER (if different from the UPPER) match # case-insensitively the UPPER, and does the UPPER match # case-insensitively the lc of the UPPER. And vice versa. |