summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* Rely on C89 <stddef.h>Aaron Crane2017-10-211-3/+0
|
* Rely on C89 <stdlib.h>Aaron Crane2017-10-213-7/+3
| | | | | | | | The Configure changes here were generated using a version of metaconfig that copies U/modified/i_stdlib.U from dist/U/vaproto.U, and changes it to unconditionally define the i_stdlib Configure variable. That variable is used by a large number of other Configure units, so it's not actually practical to try and remove the relevant unit entirely.
* Rely on C89 prototypesAaron Crane2017-10-214-37/+31
| | | | | | The Configure changes here were generated using a version of metaconfig that modifies the prototype.U and Protochk.U units to assume that C89 prototypes work.
* Don't use VOL internally, because "volatile" works just fineAaron Crane2017-10-212-2/+2
| | | | However, we do preserve it outside PERL_CORE for the use of XS authors.
* Assume we have sane C89 memcmp()Aaron Crane2017-10-211-34/+4
| | | | | | | "Sane" means that it works correctly on bytes with their high bit set, as C89 also requires. We therefore no longer need to probe for and/or use BSD bcmp().
* Assume we have C89 memcpy() and memmove()Aaron Crane2017-10-212-25/+0
| | | | We can therefore also avoid probing for and/or using BSD bcopy().
* Assume we have C89 memset()Aaron Crane2017-10-211-16/+1
| | | | This means we also never need to consider using BSD bzero().
* [perl #127063] suppress warning on assigning 0 to $[Tony Cook2017-10-172-5/+8
|
* [perl #124349] deprecation warning on hostname() with argumentsTony Cook2017-10-162-10/+27
|
* (perl #131982) provide constants for get/setpriority in POSIX.pmTony Cook2017-10-165-2/+29
| | | | | | <sys/time.h> isn't necessarily needed, but apparently increases portability, since the rusage structure defined in <sys/resource.h> has struct timeval members.
* Document that POSIX::abs, ::alarm, ::atan2, ::chdir, ::chmod need explicit ↵James E Keenan2017-10-152-15/+39
| | | | | | | | argument. Reformat code in one foreach block for readability. Make podcheck happy. For: RT #132145
* delete unused file from SDBM_FileLukas Mai2017-10-141-88/+0
|
* get rid of "implicit fallthrough" warnings in SDBM_FileLukas Mai2017-10-142-8/+8
|
* SDBM_File: tabs -> spacesLukas Mai2017-10-142-170/+170
|
* Delete unused files from ext/SDBM_FileAaron Crane2017-10-142-122/+0
|
* perl no longer builds on MacOS ClassicTom Hukins2017-10-124-56/+47
|
* Increase B::Xref::VERSION to 1.07Father Chrysostomos2017-10-081-1/+1
|
* Fix B::Xref to handle sub refsFather Chrysostomos2017-10-081-2/+8
| | | | | This only applies to non-threaded builds. Threaded builds were already fine.
* B: Really remove unused varFather Chrysostomos2017-10-081-1/+0
| | | | | 6a4fc5265ba102 removed the useless assignment to it, but not the var itself.
* Increase B::Concise::VERSION to 1.002Father Chrysostomos2017-10-081-1/+1
|
* Make B::Concise handle subrefs in stashesFather Chrysostomos2017-10-081-4/+5
| | | | | | | | | | The concise_stashref sub, for dumping all subroutines in a package, would assign the value of a stash element to *s, and then use *s to access the code ref in it. If you do *s = *foo and then later *s = \&bar, then you have assigned \&bar to *foo{CODE}, and even a localisation of *s beforehand will not help. That is exactly what B::Concise was doing when dumping a package with some subref elements.
* Unbreak gv_fetchmeth_svFather Chrysostomos2017-10-081-1/+6
| | | | | | | | | Commit v5.21.6-383-gc290e18 stopped gv_fetchmeth_sv from working cor- rectly when fetching a constant with a utf8 name, because it no longer passed the utf8 flag to the underlying functions. That utf8 flag gets passed to gv_init when upgrading a glob proxy (such as a constant) into a real glob.
* Increase $B::VERSION to 1.70Father Chrysostomos2017-10-081-1/+1
|
* B.pm: Remove unused varFather Chrysostomos2017-10-081-1/+0
| | | | | This variable stopped being used in perl-5.005_02-1108-g8bac7e0 but continued to exist until now.
* Document that POSIX::localtime needs explicit argument.James E Keenan2017-09-261-2/+10
| | | | For: RT #132145
* avoid sysread()/syswrite() warnings from the default :utf8 from PERL_UNICODETony Cook2017-09-202-1/+6
| | | | | | | | | | | | In a UTF-8 locale, if the PERL_UNICODE environment variable is set, perl may add a :utf8 layer. v5.23.1-197-gfb10a8a deprecated using sysread(), syswrite() etc on such handles, which meant that a test run under PERL_UNICODE could produce a significant number of deprecation warnings. Prevent those warnings, typically by binmode(), but in one case by disabling the warning.
* APItest/t/locale.t: Fix to not show failures on OpenBsdKarl Williamson2017-09-181-5/+7
| | | | | | It turns out that this OS does not implement all of POSIX 2008, and so certain tests were failing. This moves the eval earlier and makes sure it succeeds before calling the API function
* I18N-Langinfo: Use new fcn Perl_langinfo()Karl Williamson2017-09-093-4/+29
| | | | | This automatically fixes the bug where it always returned a dot for the decimal point character.
* Add API function Perl_langinfo()Karl Williamson2017-09-093-4/+111
| | | | | | This is designed to generally replace nl_langinfo() in XS code. It is thread-safer, hides the quirks of perl's LC_NUMERIC handling, and can be used on systems lacking nl_langinfo.
* I18N-Langinfo/t/Langinfo.t: Reinstate tests, modernizeKarl Williamson2017-09-091-46/+20
| | | | | | | | | The comments say that a bunch of tests were disabled due to the poor support of nl_langinfo() at the time, 2001. I haven't seen these issues lately, and so am reinstating many of the tests, using the modern Test::More that the rest of the file in the meantime had been updated to use. The tests that weren't reinstated were because results for them may vary by platform.
* (perl #131746) avoid undefined behaviour in Copy() etcTony Cook2017-09-042-2/+2
| | | | | | | | | | | | | | | | | These functions depend on C library functions which have undefined behaviour when passed NULL pointers, even when passed a zero 'n' value. Some compilers use this information, ie. assume the pointers are non-NULL when optimizing any following code, so we do need to prevent such unguarded calls. My initial thought was to add conditionals to each macro to skip the call to the library function when n is zero, but this adds a cost to every use of these macros, even when the n value is always true. So instead I added asserts() which will give us a much more visible indicator of such broken code and revealed the pp_caller and Glob.xs issues also patched here.
* Drop VMS::stdio compatibility shimNeil Bowers2017-08-301-32/+6
|
* Add another param to validate_protoFather Chrysostomos2017-08-282-2/+2
| | | | | I need this in order to fix bug #131883. Since it has a bit of churn, I’m putting it in a separate commit.
* Use temp files with extensions in rt131211.t on VMS.Craig A. Berry2017-08-121-0/+3
| | | | | | | | | On VMS, a file without an extension is really a file with an explicitly specified "." indicating zero-length extension. This was causing tests to fail with, for example, "abbbbbbbbbbbbc" not matching "abbbbbbbbbbbbc." as returned by glob. So add a ".tmp" extension to all the temp files on VMS only.
* Fix missing break in tovmsspec.Craig A. Berry2017-08-121-0/+1
| | | | | | When encountering a question mark in a filespec being converted from Unix to VMS format, we were inadvertently adding an escaped space because of a missing break in a switch.
* utf8.c: EBCDIC fixKarl Williamson2017-08-091-1/+4
| | | | | | | | Commit d819dc506b9fbd0d9bb316e42ca5bbefdd5f1d77 did not fully work. I switched the wrong thing that should have been in native vs Unicode/Latin1, and forgot to update the test file. Hopefully this is correct.
* test cv_[gs]et_call_checker_flags()Zefram2017-08-082-15/+42
|
* use cv_set_call_checker_flags() where possibleZefram2017-08-082-2/+2
| | | | | | | | | | | | | | | Call checkers established by core code were being set through cv_set_call_checker(), so requiring GVs to be created in some cases where they could be avoided. Make all the checkers non-GV-namegv capable, and set them with cv_set_call_checker_flags(). The checkers for Devel::Peek::Dump() and utf8::{unicode_to_native,native_to_unicode}() were already fit to handle non-GV names, so required no changes. The checker for CORE:: subs, ck_entersub_args_core(), was naughtily using the name to decide which sub it was dealing with in some cases, so move that information into the ckobj that was already being used to identify the sub in most cases. It also required reformulation of some error reporting code to use cv_name().
* utf8_to_uvchr() EBCDIC fixKarl Williamson2017-08-051-1/+1
| | | | | | | | This fixes a warning message for EBCDIC. The native character set is different than Unicode, and needs special handling. I earlier tried to save an #ifdef, but the resulting warning was hard to test right, and that helped convince me that it would be confusing to anyone trying to make sense of the message. So, in goes the #ifdef.
* sv_dump(): display regex LEN and LV-as-RX regexpDavid Mitchell2017-08-041-1/+4
| | | | | | | | When the len field of a REGEXP isn't usurped, display it (it used to always be skipped for REGEXPs). When it's usurped by a PVLV to point to a 'struct regexp', display it as a pointer.
* APItest/t/utf8_warn_base.pl: Fix broken testsKarl Williamson2017-07-301-1/+2
| | | | | There was a typo in one test, and in the other, the code point is output as Unicode, not native.
* APItest/t/utf8.t: Fix broken test on EBCDICKarl Williamson2017-07-301-2/+4
| | | | | Perl-extended UTF-8 begins at a different code point on EBCDIC platforms.
* Give OP_RV2HV a targDavid Mitchell2017-07-273-20/+20
| | | | | | | OP_RV2AV already has one; its not clear why OP_RV2HV didn't. Having one means that in scalar context it can return an int value without having to create a mortal. Ditto when its doing 'keys %h' via OPpRV2HV_ISKEYS.
* optimise away OP_KEYS op in scalar/void contextDavid Mitchell2017-07-273-30/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In something like if (keys %h) { ... } the 'keys %h' is implemented as the op sequences gv[*h] s rv2hv lKRM/1 keys[t2] sK/1 or padhv[%h:1,6] lRM keys[t2] sK/1 It turns out that (%h) in scalar and void context now behaves very similarly to (keys %h) (except that it reset the iterator), so in these cases, convert the two ops rv2hv/padhv, keys into the single op rv2hv/padhv with a private flag indicating that the op is handling the 'keys' action by itself. As well as one less op to execute, this brings the boolean-context optimisation already present in padhv/rv2sv to keys. So if (keys %h) { ... } is no longer slower than if (%h) { ... }
* give REGEXP SVs the POK flag againDavid Mitchell2017-07-272-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit v5.17.5-99-g8d919b0 stopped SVt_REGEXP SVs (and PVLVs acting as regexes) from having the POK and pPOK flags set. This made things like SvOK() and SvTRUE() slower, because as well as the quick single test for any I/N/P/R flags, SvOK() also has to test for (SvTYPE(sv) == SVt_REGEXP || (SvFLAGS(sv) & (SVTYPEMASK|SVp_POK|SVpgv_GP|SVf_FAKE)) == (SVt_PVLV|SVf_FAKE)) This commit fixes the issue fixed by g8d919b0 in a slightly different way, which is less invasive and allows the POK flag. Background: PVLV are basically PVMGs with a few extra fields. They are intended to be a superset of all scalar types, so any scalar value can be assigned to a PVLV SV. However, once REGEXPs were made into first-class scalar SVs, this assumption broke - there are a whole bunch of fields in a regex SV body which can't be copied to to a PVLV. So this broke: sub f { my $r = qr/abc/; # $r is reference to an SVt_REGEXP $_[0] = $$r; } f($h{foo}); # the hash access is deferred - a temporary PVLV is # passed instead The basic idea behind the g8d919b0 fix was, for an LV-acting-as-regex, to attach both a PVLV body and a regex body to the SV head. This commit keeps this basic concept; it just changes how the extra body is attached. The original fix changed SVt_REGEXP SVs so that sv.sv_u.svu_pv no longer pointed to the regexp's string representation; instead this pointer was stored in a union made out of the xpv_len field. Doing this necessitated not turning the POK flag on for any REGEXP SVs. This freed up the sv_u to point to the regex body, while the sv_any field could continue to point to the PVLV body. An ReANY() macro was introduced that returned the sv_u field rather than the sv_any field. This commit changes it so that instead, on regexp SVs (and LV-as-regexp SVs), sv_u always points to the string buffer (so they can have POK set again), but on specifically LV-as-regex SVs, the xpv_len_u union of the PVLV body points to the regexp body. This means that SVt_REGEXP SVs are now completely "normal" again, and SVt_PVLV SVs are normal except in the one case where they hold a regex, in which case rather than storing the string buffer's length, the PVLV body stores a pointer to the regex body.
* make B.pm, Concise.pm support PL_sv_zeroDavid Mitchell2017-07-273-5/+8
|
* Revert B::Debug removalDagfinn Ilmari Mannsåker2017-07-251-2/+2
| | | | | | | | Per perlpolicy, modules need to be deprecated for at least one stable release before removal. This reverts commits ecfa068aa0dab432bfdef423766b665be127ef77 and 6be75e63260512c636a5bdc72bbf4981a37bad7d.
* Remove B::Debug from core distribution.James E Keenan2017-07-251-2/+2
| | | | | | | | | | It continues to exist as a CPAN distribution. Increment $B::Terse::VERSION due to change in POD. Remove internal links to B::Debug within two .pod files. For: RT #130410
* PerlIO::scalar: check invariant at compile timeLukas Mai2017-07-162-2/+2
|
* Opcode: check invariant at compile timeLukas Mai2017-07-162-2/+2
|