This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
9 years agoFix i_bfd
H.Merijn Brand [Wed, 11 Jun 2014 07:09:04 +0000 (09:09 +0200)]
Fix i_bfd

The final i_bfd statement was a wrong copy-paste

re-order Configure: in preparation of backporting this change and
integration of another, some reorder is required

9 years agoAndrew Fresh is now a perl author
Tony Cook [Wed, 11 Jun 2014 04:52:26 +0000 (14:52 +1000)]
Andrew Fresh is now a perl author

9 years agoDefault to using OpenBSD's malloc
Andrew Fresh [Sat, 31 May 2014 17:30:40 +0000 (10:30 -0700)]
Default to using OpenBSD's malloc

While perl bug #75742 successfully convinced p5p that the speed of the
OpenBSD malloc was a good enough reason to instead use perl's malloc,
the system malloc has many security features that OpenBSD users expect.

The system malloc has always been used in the base system perl.

While the is slower than the perl malloc, the OpenBSD project believes
the tradeoff is worth it and would prefer that users who need the speed
specifically ask for it.

9 years agoCorrect architectures and versions for hints
Andrew Fresh [Sun, 1 Jun 2014 18:00:39 +0000 (11:00 -0700)]
Correct architectures and versions for hints

Over time, OpenBSD has kept this up-to-date locally without enough
patches going upstream.

This should bring perl in sync with reality.

9 years agocorrect handling of buffer sizes for POSIX::strxfrm()
Tony Cook [Wed, 11 Jun 2014 01:29:55 +0000 (11:29 +1000)]
correct handling of buffer sizes for POSIX::strxfrm()

There were two problems:

1) we allocated srclen*4+1, but then only supplied srclen to the first
  strxfrm() call, which meant we could be "failing" the strfrm()
  unnecessarily.

2) the return value of the first strxfrm() was being handled correctly,
  the contents of the output buffer supplied to strxfrm() is indeterminate
  when the return value is the buffer size or larger, so we should
  make a new call then.

9 years agoLocale tests assumed POSIX, not true in minitest.
Jarkko Hietaniemi [Wed, 11 Jun 2014 00:18:50 +0000 (20:18 -0400)]
Locale tests assumed POSIX, not true in minitest.

9 years agoperldelta for 7ac929242683
Tony Cook [Tue, 10 Jun 2014 00:39:49 +0000 (10:39 +1000)]
perldelta for 7ac929242683

9 years agoadd a warning for using the :win32 PerlIO layer
Tony Cook [Tue, 3 Jun 2014 06:56:40 +0000 (16:56 +1000)]
add a warning for using the :win32 PerlIO layer

9 years ago[perl #121733] fix t/op/stat.t 96 for windows
Reini Urban [Tue, 10 Jun 2014 00:15:23 +0000 (10:15 +1000)]
[perl #121733] fix t/op/stat.t 96 for windows

Tony: fixes for minitest

9 years ago[perl #121732] fix t/op/filetest.t for windows
Reini Urban [Mon, 9 Jun 2014 06:55:09 +0000 (16:55 +1000)]
[perl #121732] fix t/op/filetest.t for windows

Tony: fix for minitest

9 years agobump Benchmark version
David Mitchell [Mon, 9 Jun 2014 17:29:29 +0000 (18:29 +0100)]
bump Benchmark version

(whoops, I failed to run a full make test before my last commit)

9 years agoBenchmark.pm: avoid long walltime on calibration
David Mitchell [Mon, 9 Jun 2014 10:41:22 +0000 (11:41 +0100)]
Benchmark.pm: avoid long walltime on calibration

RT #122003

runloop() in Benchmark.pm does the equivalent of the following:

    $t = (times)[0];
    while ($t == (times)[0]) {}

so that it finishes in a position where the user CPU counter has just
incremented.

This is all well and good, but on some platforms (specifically OpenBSD
running under VirtualBox), the system CPU burned each time round the loop
to get times() is far greater than the user CPU burned. This can cause the
loop to run for minutes consuming system CPU until enough user CPU has
been burned to tick the user CPU counter.

The fix in this commit is to replace the empty body of the while loop with
something that does a gradually increasing amount of busy work.

9 years agoEliminate VMS-specific code in PerlIOStdio_fill.
Craig A. Berry [Sun, 8 Jun 2014 23:14:57 +0000 (18:14 -0500)]
Eliminate VMS-specific code in PerlIOStdio_fill.

The same logic but with more safety checks is already defined for
PerlSIO_ungetc in iperlsys.h, so DRY says we should just use that.

Also, that definition in iperlsys.h really depends on the library
we are using, not the compiler.  And there is only one viable C
library on VMS and it ships with the OS, so it's really just an
OS dependency.

N.B.  While it may be something of a fool's errand to maintain the
stdio layer, deleting redundant code can only be a good thing,
possibly enabling further refactoring and clean-up.

9 years agoremove 1 read of interp var from PUSHMARK
Daniel Dragan [Thu, 5 Jun 2014 03:17:39 +0000 (23:17 -0400)]
remove 1 read of interp var from PUSHMARK

PL_markstack_ptr was read once to do the ++ and comparison. Then after
the markstack_grow call, or not, depending on the branch. The code reads
PL_markstack_ptr a 2nd time. It has to be reread in case (or always does)
markstack_grow reallocs the mark stack. markstack_grow has a void retval.
That is a waste of a register. Let us put it to use to return the new
PL_markstack_ptr. In markstack_grow the contents that will be assigned to
PL_markstack_ptr are already in a register. So let the I32* flow out from
markstack_grow to its caller.

In VC2003 32 bit asm, mark_stack_entry is register eax. The retval of
markstack_grow is in eax. So the assignment "=" in
"mark_stack_entry = markstack_grow();" has no overhead. Since the other,
not extend branch, is function call free,
"(mark_stack_entry = ++PL_markstack_ptr)" assigns to eax. Ultimatly with
this patch a 3 byte mov instruction is saved for each instance of PUSHMARK,
and 1 interp var read is removed. I observed 42 callers of markstack_grow
with my disassembler, so theoretically 3*42 bytes of machine code was
removed for me.

Perl_pp_pushmark dropped from 0x2b to 0x28 bytes of x86 VC 2003
machine code. [perl #122034]

9 years agoDocument that "exec LIST" and "system LIST" may fall back to the shell on Win32
Thomas Sibley [Thu, 5 Jun 2014 17:17:42 +0000 (10:17 -0700)]
Document that "exec LIST" and "system LIST" may fall back to the shell on Win32

As noted on p5p [1] and subsequently discussed [2].

The Win32 functions for handling exec() and system() attempt to
specially handle shell builtins by catching spawn failures and
re-attempting the spawn using the shell with the given argument LIST.

If "exec PROGRAM LIST" syntax (or the equivalent for system()) is used,
then only the specified PROGRAM will ever be run (although Perl will
still try the spawn twice on Win32 if PROGRAM doesn't exist or otherwise
can't be executed).

[1] http://www.nntp.perl.org/group/perl.perl5.porters/2014/04/msg214556.html
[2] http://www.nntp.perl.org/group/perl.perl5.porters/2014/04/msg214564.html

9 years agoSmall grammatical fix.
James E Keenan [Sun, 8 Jun 2014 15:18:58 +0000 (11:18 -0400)]
Small grammatical fix.

9 years agoAdd C backtrace API.
Jarkko Hietaniemi [Tue, 3 Jun 2014 12:39:56 +0000 (08:39 -0400)]
Add C backtrace API.

Useful for at least debugging.

Supported in Linux and OS X (possibly to some extent in *BSD).

See perlhacktips for details.

9 years agoUpdate Test-Harness to CPAN version 3.31
Chris 'BinGOs' Williams [Sat, 7 Jun 2014 22:08:32 +0000 (23:08 +0100)]
Update Test-Harness to CPAN version 3.31

  [DELTA]

3.31    2014-06-07
        - Implement external rulesfile for TAP::Harness (David Golden)
        - Add harness_class argument to TAP::Harness::Env (Leon Timmermans)
        - Make prove respect environmental variables #28 (Leon Timmermans)

9 years agoSync autouse version for recent CPAN release
Chris 'BinGOs' Williams [Sat, 7 Jun 2014 22:07:09 +0000 (23:07 +0100)]
Sync autouse version for recent CPAN release

9 years agolocale.c: Fix uncomplemented 'if' test
Karl Williamson [Fri, 6 Jun 2014 20:43:04 +0000 (14:43 -0600)]
locale.c: Fix uncomplemented 'if' test

Somehow the ! in this if () got dropped, and there were no tests to
catch it.  Now both are remedied.

9 years agoPOSIX.xs: Add a const to a parameter
Karl Williamson [Fri, 6 Jun 2014 19:13:25 +0000 (13:13 -0600)]
POSIX.xs: Add a const to a parameter

9 years agoperlapi: Nit, and mention NUL for some functions
Karl Williamson [Fri, 6 Jun 2014 19:11:55 +0000 (13:11 -0600)]
perlapi: Nit, and mention NUL for some functions

This adds the mention of embedded or terminating NULs for some functions
where it wasn't previously indicated.

9 years agostrftime: Set UTF-8 flag appropriately on return
Karl Williamson [Fri, 6 Jun 2014 19:08:17 +0000 (13:08 -0600)]
strftime: Set UTF-8 flag appropriately on return

The flag was only getting set if the format was in UTF-8.  This looks at
the return values, and sets the flag if they are non-ASCII UTF-8 and, as
a further check, if the current locale is a UTF-8 one.

9 years agoPATCH: [perl #119425] strftime with %p
Karl Williamson [Fri, 6 Jun 2014 19:04:55 +0000 (13:04 -0600)]
PATCH: [perl #119425] strftime with %p

In a locale in which there is no a.m. nor p.m. indicator, a format with
only %p in it would print %p instead of nothing.

9 years agolib/locale.t: Change acceptable fail % for Win32
Karl Williamson [Fri, 6 Jun 2014 16:29:28 +0000 (10:29 -0600)]
lib/locale.t: Change acceptable fail % for Win32

Commit 375f5f0648cdf36c13cb11499b332c99c710d138 fixed the Windows ctype
functions to follow POSIX rules, so there is no need to make an
exception for them.

9 years agofix locale.c under -DPERL_GLOBAL_STRUCT
David Mitchell [Sat, 7 Jun 2014 13:16:21 +0000 (14:16 +0100)]
fix locale.c under -DPERL_GLOBAL_STRUCT

9 years agoCorrect socksizetype on VMS.
Craig A. Berry [Fri, 6 Jun 2014 19:12:19 +0000 (14:12 -0500)]
Correct socksizetype on VMS.

This was modified to comply with the standard in DEC C 5.0.  The
last 5.x release was 5.7 in 1998 and we've long since required
at least 6.0 to build Perl.  So this change is a wee bit behind
schedule.

9 years agoRefactor some compiler-based hints in configure.com.
Craig A. Berry [Fri, 6 Jun 2014 14:05:13 +0000 (09:05 -0500)]
Refactor some compiler-based hints in configure.com.

Once upon a time, there was VAX C, and there was a port of GCC
2.something that used the same library.  These both only ran on VAX
and both became obsolete years ago.  When DEC/Compaq/HP C came
along, it had its own library (typically referred to simply as
"the CRTL") that shipped with the operating system.  It was thus
natural to determine the presence or absence of a library function
based on the compiler choice, as that implied a library choice.

But there is now no choice of library nor has been for many years.
The CRTL is it, and even a new port of GCC (which apparently exists
in some form as part of Ada Core's toolchain) would almost
certainly use it.  So stop using the selected compiler to decide
whether a library function is present or not.

9 years agoSync ExtUtils-Install version for CPAN release
Chris 'BinGOs' Williams [Fri, 6 Jun 2014 15:06:43 +0000 (16:06 +0100)]
Sync ExtUtils-Install version for CPAN release

9 years agoupdate release schedule
Ricardo Signes [Fri, 6 Jun 2014 01:23:58 +0000 (21:23 -0400)]
update release schedule

9 years agoperlapi: Place in dictionary sort order
Karl Williamson [Thu, 5 Jun 2014 20:58:49 +0000 (14:58 -0600)]
perlapi: Place in dictionary sort order

Underscores or their lack can confuse people in finding sorted items.

9 years agoperlapi: Refactor placements, headings of some functions
Karl Williamson [Thu, 5 Jun 2014 20:29:44 +0000 (14:29 -0600)]
perlapi: Refactor placements, headings of some functions

It is not very user friendly to list functions as
"Functions found in file FOO".  Better is to group them by purpose, as
many were already.  I went through and placed the ones that weren't
already so grouped into groups.  Patches welcome if you have a better
classification.

I changed the headings of some so that the important disctinction was
the first word so that they are placed in the file more appropriately.

And a couple of ones that I had created myself, I came up with a name
that I think is better than the original

9 years agoperlapi: Include general information
Karl Williamson [Thu, 5 Jun 2014 20:22:50 +0000 (14:22 -0600)]
perlapi: Include general information

Unlike other pod handling routines, autodoc requires the line following
an =head1 to be non-empty for its text to be included in the paragraph
started by the heading.  If you fail to do this, silently the text will
be omitted from perlapi.  I went through the source code, and where it
was apparent that the text was supposed to be in perlapi, deleted the
empty line so it would be, with some revisions to make more sense.

I added =cuts where I thought it best for the text to not be included.

9 years agoMove a VMS-specific include file in sv.c.
Craig A. Berry [Thu, 5 Jun 2014 20:44:52 +0000 (15:44 -0500)]
Move a VMS-specific include file in sv.c.

C++ doesn't allow pulling in rms.h smack dab in the middle of a
function like that.  While we're in there, go ahead and start
using the correct __VMS macro instead of just VMS.  The latter
was only necessary for VAX C, the non-C89-compliant predecessor
to DEC C that died a natural death some years ago.

9 years agoA malloc cast in vms/vms.c.
Craig A. Berry [Thu, 5 Jun 2014 20:42:34 +0000 (15:42 -0500)]
A malloc cast in vms/vms.c.

C didn't notice this with standard warnings enabled, but C++ takes
vengeance, so cast appropriately.

9 years agowcs* fix-up for configure.com
Craig A. Berry [Thu, 5 Jun 2014 20:30:08 +0000 (15:30 -0500)]
wcs* fix-up for configure.com

VMS has had wcscmp and wcsxfrm since version 6.2 was released in
1995.  None of these functions depends on what compiler we're
running, only on what the C library has, and there is only one
viable CRTL in existence in modern times, so we probably need a
further refactor to eliminate the compiler check for this whole
section.

9 years agoupdate release schedule
Ricardo Signes [Thu, 5 Jun 2014 18:28:23 +0000 (14:28 -0400)]
update release schedule

9 years agot/run/locale.t: Remove unnecessary setlocales()
Karl Williamson [Wed, 4 Jun 2014 01:46:19 +0000 (19:46 -0600)]
t/run/locale.t: Remove unnecessary setlocales()

The locale is supposed to be passed in via the environment.  There is no
need to also set it explicitly.

9 years agoFix Windows ctype functions
Karl Williamson [Wed, 4 Jun 2014 01:37:45 +0000 (19:37 -0600)]
Fix Windows ctype functions

Windows doesn't follow the Posix standard for their functions like
isalnum(), isdigit(), etc.  This forces compliance by changing the
macros that are the interfaces to those functions to be smarter than
just calling the raw functions.

9 years agoRevert "PATCH: [perl #119499] "$!" with UTF-8 flag"
Karl Williamson [Wed, 4 Jun 2014 00:39:40 +0000 (18:39 -0600)]
Revert "PATCH: [perl #119499] "$!" with UTF-8 flag"

This reverts commit b17e32ea3ba5ef7362d2a3d1a433661afb897786.

With this commit, the stringification of $! will have the UTF-8 flag set
when the text is actually non-ASCII UTF-8.  The reverted commit itself
reverted code that was to fix bugs with this discrepancy of the UTF-8
flag, but which caused backward-compatibility problems with existing
code.

Several things have happened in the interim which allows us to
experimentally resotre the previously reverted changes.  One is that
this is early in the 5.21 cycle, and we have plenty of time to see what
negative consequences this may cause.  Two is that the returned text
will only be in UTF-8 if the stringification happens within the scope of
'use locale'.  This means that the negative effects won't happen for
code, like ack, that is otherwise locale unaware.  Third, the 'locale'
pragma has been enhanced to allow the program to only have locale
awareness of LC_MESSAGES.

Code that needs to continue the 5.20 and earlier behavior can do the
stringification within the scopes of both 'use bytes' and 'use locale
":messages".  No other Perl operations will be affected by locale; only
$! and $^E stringification.  The 'bytes' pragma causes the UTF-8 flag to
not be set, just as in previous Perl releases.

9 years agoUse C locale for "$!" ouside 'use locale' scope
Karl Williamson [Mon, 2 Jun 2014 21:56:05 +0000 (15:56 -0600)]
Use C locale for "$!" ouside 'use locale' scope

The stringification of $! has long been an outlier in Perl locale
handling.  The theory has been that these operating system messages are
likely to be of use to the final user, and should be in their language.
Things like
    No space left on device
    Can't fork
are not something the program is likely to handle, but could be
meaningfully helpful to the end-user.

There are problems with this though.  One is that many perl messages are
in English, with the $! appended to them, so that the resultant message
is of mixed language, and may need to be translated anyway.  Things like
    No space left on device
probably won't need the remaining portion of the message to give someone
a clear indication as to what's wrong.  But there are many other
messages where both the OS error and the Perl error would be needed
togther to understand the problem.  An on-line translation tool can be
used to do this.

Another problem is that it can lead to garbage coming out on the user's
terminal when the program is not expecting UTF-8, but the underlying
locale is UTF-8.  This is what happens in Bug #112208, and another that
was merged with it.  It's a lot harder to translate mojibake via an
online tool than English.

This commit solves that by using the C locale for messages, except
within the scope of 'use locale'.  It is extremely likely that the
messages in the C locale will be English, but if not they will be ASCII,
and there will be no garbage printed.  A program that says "use locale"
is indicating that it has the intelligence necessary to deal with
locales.

9 years agoData::Dumper: Fix wrong #if
Karl Williamson [Mon, 2 Jun 2014 21:00:05 +0000 (15:00 -0600)]
Data::Dumper: Fix wrong #if

The code being conditionally compiled is for LC_COLLATE, not LC_NUMERIC

9 years agoAdd parameters to "use locale"
Karl Williamson [Mon, 2 Jun 2014 20:49:30 +0000 (14:49 -0600)]
Add parameters to "use locale"

This commit allows one to specify to enable locale-awareness for only a
specified subset of the locale categories.  Thus you could make a
section of code LC_MESSAGES aware, with no locale-awareness for the
other categories.

9 years agonumeric.c: Remove unnecessary test
Karl Williamson [Mon, 2 Jun 2014 19:52:38 +0000 (13:52 -0600)]
numeric.c: Remove unnecessary test

The second test won't be true unless the first one is (but not vice
versa), so no need to test the first.

9 years agoop.c: Use macro instead of its expansion
Karl Williamson [Mon, 2 Jun 2014 18:15:47 +0000 (12:15 -0600)]
op.c: Use macro instead of its expansion

It's better to use a pre-defined macro when available.  This isn't quite
the same, as the macro is valid for both run-time and compile-time and
the code is only compile-time.  In the unlikely event that  this were
ever to be found to be other than negligible, a compile-time-only
version of the macro could be created.

9 years agoAllow dynamic lock of LC_NUMERIC
Karl Williamson [Mon, 2 Jun 2014 02:07:30 +0000 (20:07 -0600)]
Allow dynamic lock of LC_NUMERIC

When processing version strings, the radix character must be a dot even
if we otherwise would be using some other character.  vutil.c
upg_version() changes to the dot, but calls sv_catpvf() which may try to
change the character to something else.  This commit introduces a way to
lock the character to a dot around the call to sv_catpvf()

vutil.c is cpan-upstream, but already blead and cpan have diverged, so
this just updates the SHA of the new version

9 years agoFix up LC_NUMERIC wrap macros
Karl Williamson [Mon, 2 Jun 2014 01:40:12 +0000 (19:40 -0600)]
Fix up LC_NUMERIC wrap macros

perl.h has some macros used to manipulate the locale exposed for the
category LC_NUMERIC.  These are currently undocumented, but will need to
be documented as the development of 5.21 progresses.  This fixes these
up in several ways:

The tests for if we are in the correct state are made into macros.  This
is in preparation for the next commit, which will make one of them more
complicated, and so that complication will only have to be in one place.

The variable declared by them is renamed to be preceded by an
underscore.  It is dangerous practice to have a name used in a macro, as
it could conflict with a name used by outside code.  This alleviates it
somewhat by making it even less likely to conflict.  This will have to
be revisited when some of these macros are made part of the public API.

The tests to see if things need to change are reversed.  Previously we
said we need to change to standard, for example, if the variable for
'local' is set.  But both can be true at the same time if the underlying
locale is C.  In this case, we only need to change if we aren't in
standard.  Whether that is also local is irrelevant.

9 years agoKeep LC_NUMERIC in C locale, except for brief periods
Karl Williamson [Sun, 1 Jun 2014 20:05:48 +0000 (14:05 -0600)]
Keep LC_NUMERIC in C locale, except for brief periods

This is for XS modules, so they don't have to worry about the radix
being a non-dot.  When the locale needs to be in the underlying one, the
operation should be wrapped using macros for the purpose.  That API may
change as we gain experience in 5.21, so I'm not including it now.

9 years agonumeric.c: White-space only
Karl Williamson [Sun, 1 Jun 2014 22:05:20 +0000 (16:05 -0600)]
numeric.c: White-space only

The previous commit added a block around this code, so indent
correspondingly.

9 years agoMake sure locale set right for radix parsing
Karl Williamson [Sun, 1 Jun 2014 22:02:24 +0000 (16:02 -0600)]
Make sure locale set right for radix parsing

I haven't found a test case this fails for in v5.20, but I'm sure there
is one.  But two commits from now would fail if this wasn't done.

9 years agoperllocale: Wrap some text in C<...>
Karl Williamson [Mon, 2 Jun 2014 00:07:34 +0000 (18:07 -0600)]
perllocale: Wrap some text in C<...>

9 years agoAvoid locale function overhead
Karl Williamson [Sun, 1 Jun 2014 19:42:31 +0000 (13:42 -0600)]
Avoid locale function overhead

For the LC_NUMERIC locale category, one can swap between setlocale being
to "C" or to the underlying locale.  Perl keeps track of the state
using two boolean variables.  By testing these before calling the swap
functions, we can skip calling them if the current state is the one we
want to be in, and avoid the function call overhead, as the function
becomes a no-op if the current state is the desired one.

9 years ago'use locale' no longer ever fails.to compile
Karl Williamson [Fri, 16 May 2014 03:18:14 +0000 (21:18 -0600)]
'use locale' no longer ever fails.to compile

Thus we can skip the machinations we used to do to make sure things
compiled.

9 years agoSet utf8 flag properly in localeconv
Karl Williamson [Fri, 16 May 2014 01:29:41 +0000 (19:29 -0600)]
Set utf8 flag properly in localeconv

 Rare, but not unheard of, is for the strings returned by localeconv to
 be in UTF-8.  This commit looks for and sets the UTF-8 flag if they are.
 so encoded.

 A private function had to changed from static for this.  It is renamed
 to begin with an underscore to emphasize its private nature.

9 years agoExclude undefined hash elements from localeconv()
Karl Williamson [Fri, 16 May 2014 00:30:37 +0000 (18:30 -0600)]
Exclude undefined hash elements from localeconv()

A given platform may not have all the localeconv elements available, or
Perl may be compiled to not use them.  Don't define hash elements for
the missing ones.

9 years agoSwap #if sense for localeconv()
Karl Williamson [Fri, 16 May 2014 00:13:08 +0000 (18:13 -0600)]
Swap #if sense for localeconv()

When the else clause is trivial, and the if clause is long, It's far easier to understand if they're swapped
so the short clause and the else are right after the if.

9 years agoLocaleconv() should be independent of 'use locale'
Karl Williamson [Thu, 15 May 2014 21:40:51 +0000 (15:40 -0600)]
Localeconv() should be independent of 'use locale'

localeconv() should return the values for the underlying locale of
the program regardless of whether the calling place is within the
scope of "use locale" or not.  Otherwise, it makes no sense to call it
from outside such scope, and a pure perl module that calls it on behalf
of a caller would likely get it wrong.

In earlier versions of Perl the LC_NUMERIC category was initialized to
C, but was changed by the first setlocale() anywhere in the process.  It
is rare to call localeconv() without first having done a setlocale().
But to solve other bugs, future commits will keep LC_NUMERIC in the C
locale except during such operations where it should be the underlying
locale.  localeconv() is such a place, so this commit is being done
before the later ones so it doesn't break.

9 years agoperl.h: Move #if
Karl Williamson [Mon, 2 Jun 2014 20:56:51 +0000 (14:56 -0600)]
perl.h: Move #if

Some of the things in its scope should be defined even if we don't want
to use LC_NUMERIC.  That there have been no reports of compilation
failures from the field indicates that the Configure to exclude it
hasn't been used.

9 years agoUpdate Scalar-List-Utils to CPAN version 1.39
Chris 'BinGOs' Williams [Thu, 5 Jun 2014 15:16:27 +0000 (16:16 +0100)]
Update Scalar-List-Utils to CPAN version 1.39

  [DELTA]

1.39 -- 2014/06/05 15:54:59
  [CHANGES]
   * Have pairs() return blessed objects that recognise ->key and
     ->value as well as being two-element ARRAYs
   * Booleanise the result of looks_like_number() so as not to
     accidentally leak abstraction (RT94806)
   * Document the version each function was added in (RT96220)

  [BUGFIXES]
   * Try to preserve UV precision in sum() where possible (RT95902)
   * Document known lexical capture in pairmap bug RT95409
   * SvGETMAGIC() in set_prototype() (RT72080)

9 years agowhen unCOWing a string, set SvCUR to 0
David Mitchell [Thu, 5 Jun 2014 14:03:32 +0000 (15:03 +0100)]
when unCOWing a string, set SvCUR to 0

When a COW string is unCOWed, as well as setting SvPVX to NULL and SvLEN
to 0, set SvCUR to 0 too.

This is to avoid a later SvGROW on the same using the old SvCUR() value
to calculate a roundup to the buffer size.

Consider the following code:

    use Devel::Peek;
    for (1..3) {
        my $t;
        my $s = 'x' x 100;
        $t = $s;
        Dump $s;
    }

Looking at the LEN line of the Dump output, we got on 5.20.0:

  LEN = 102
  LEN = 135
  LEN = 135

and after this commit,

  LEN = 102
  LEN = 102
  LEN = 102

As well as wasting space, this extra LEN was then triggering the 'skip COW
if LEN >> CUR' mechanism, causing extra copies. See:

    [perl #121977] COWification seems expensive in PADMY variables

9 years agoEnable new wcs variables for Win32
H.Merijn Brand [Thu, 5 Jun 2014 10:42:12 +0000 (12:42 +0200)]
Enable new wcs variables for Win32

9 years agoprevent double single quotes for default cfg vars
H.Merijn Brand [Thu, 5 Jun 2014 10:28:37 +0000 (12:28 +0200)]
prevent double single quotes for default cfg vars

9 years agoundoubled bad quoting
H.Merijn Brand [Thu, 5 Jun 2014 10:21:04 +0000 (12:21 +0200)]
undoubled bad quoting

9 years agoProbe for working wcscmp and wcsxfrm
H.Merijn Brand [Mon, 2 Jun 2014 15:11:05 +0000 (17:11 +0200)]
Probe for working wcscmp and wcsxfrm

9 years agoThere's no UVdf, there is UVuf. (#if 0'ed code)
Jarkko Hietaniemi [Thu, 5 Jun 2014 00:58:06 +0000 (20:58 -0400)]
There's no UVdf, there is UVuf. (#if 0'ed code)

9 years agoBring a long line in threads.pm under 80 cols
kafka [Wed, 14 May 2014 16:10:49 +0000 (18:10 +0200)]
Bring a long line in threads.pm under 80 cols

For: https://rt.perl.org/Ticket/Display.html?id=121873

9 years agoevat => eval as found by Tom Hukins
H.Merijn Brand [Wed, 4 Jun 2014 07:07:24 +0000 (09:07 +0200)]
evat => eval as found by Tom Hukins

9 years agoDisallow omitting % and @ on hash and array names
Dagfinn Ilmari Mannsåker [Fri, 9 May 2014 23:04:58 +0000 (00:04 +0100)]
Disallow omitting % and @ on hash and array names

Really old Perl let you omit the @ on array names and the % on hash
names in some spots.  This has issued a deprecation warning since Perl
5.0, and is no longer permitted.

9 years agoBring all lines in CoreList.pod under 80 cols
kafka [Tue, 13 May 2014 20:26:41 +0000 (22:26 +0200)]
Bring all lines in CoreList.pod under 80 cols

9 years agorefactor pp_tied
Daniel Dragan [Tue, 27 May 2014 21:14:20 +0000 (17:14 -0400)]
refactor pp_tied

remove some redundant code regarding stack handling

-removed:
  -4/-8 pop on SP
  +4/+8 push on SP
  PUTBACK

function's machine code size dropped from 0xC5 to 0xBD bytes on VC2003

9 years agoCorrect heading level of perllexwarn changes summary
Thomas Sibley [Tue, 3 Jun 2014 06:24:12 +0000 (23:24 -0700)]
Correct heading level of perllexwarn changes summary

It was a =head2 in a sea of =head3s.

9 years agoReduce env var calls to one in ExtUtils::Install
Chris 'BinGOs' Williams [Tue, 3 Jun 2014 21:51:20 +0000 (22:51 +0100)]
Reduce env var calls to one in ExtUtils::Install

9 years agoUpgrade Module::Metadata from version 1.000023 to 1.000024
Steve Hay [Tue, 3 Jun 2014 21:33:28 +0000 (22:33 +0100)]
Upgrade Module::Metadata from version 1.000023 to 1.000024

9 years agoAdd quietening env var option to pm_to_blib in ExtUtils::Install
Chris 'BinGOs' Williams [Tue, 3 Jun 2014 20:16:48 +0000 (21:16 +0100)]
Add quietening env var option to pm_to_blib in ExtUtils::Install

9 years ago375ed12a broke Config::IniFiles
Jarkko Hietaniemi [Tue, 3 Jun 2014 12:41:34 +0000 (08:41 -0400)]
375ed12a broke Config::IniFiles

... among other things: https://rt.perl.org/Ticket/Display.html?id=122021

PerlIO::scalar (aka opening scalars for IO) has fileno of -1.

This (and probably other exotic PerlIO objects which have funny fds)
requires special care.

9 years ago38d96942 missed a side-effect in PerlIO_open flags parsing.
Jarkko Hietaniemi [Mon, 2 Jun 2014 13:57:28 +0000 (09:57 -0400)]
38d96942 missed a side-effect in PerlIO_open flags parsing.

The mode++ was essential in allowing 'rb' for the PerlIO_open() flags.
Without the mode++ the 'b' was left unprocessed and this caused
the oflags to become bogus.

Compress::Bzip2 caught this: https://rt.perl.org/Ticket/Display.html?id=122012
(also Unicode::Map8, Text::Scan, and otehrs)

While doing this, realized that for the "O_BINARY versus O_TEXT" it's
probably the clearest to test for the non-zero-ness of those two flags.

(Is there any "unit testing" of PerlIO? In this case it would be:
 PerlIO_open -> PerlIO_openn -> PerlIOBuf_open -> PerlIOUnix_open ->
 PerlIOUnix_oflags with mode of "rb")

9 years agoperl.h: move PERL_GET_CONTEXT fallbacks earlier
David Mitchell [Tue, 3 Jun 2014 09:06:20 +0000 (10:06 +0100)]
perl.h: move PERL_GET_CONTEXT fallbacks earlier

A recent commit added a 'dTHX' to inline.h for the first time;
this broke -DPERL_GLOBAL_STRUCT* builds.

The fix is to move the 'fallback' definitions in perl.h, such as

    #ifndef PERL_GET_CONTEXT
    #  define PERL_GET_CONTEXT             PERL_GET_INTERP

to earlier in the file so that they come before

    #include "inline.h"

9 years agoFix 2 overlong verbatim lines in Hash::Util
Karl Williamson [Mon, 2 Jun 2014 19:35:13 +0000 (13:35 -0600)]
Fix 2 overlong verbatim lines in Hash::Util

And regenerate known issues to not warn about the rest

9 years agoUpdate Porting/Maintainers.pl for Devel-PPPort upgrade in ea4b7f3223
Steve Hay [Mon, 2 Jun 2014 17:42:01 +0000 (18:42 +0100)]
Update Porting/Maintainers.pl for Devel-PPPort upgrade in ea4b7f3223

Also remove all the IGNORABLE files. These are not required in core for
cpan/ distributions; we save space by leaving them out. And we don't want
EXCLUDED files either.

9 years agoRemove undefined Makefile.SH 'translators' target for x2p.
Andy Dougherty [Mon, 2 Jun 2014 16:48:48 +0000 (12:48 -0400)]
Remove undefined Makefile.SH 'translators' target for x2p.

Since x2p has been removed, there is no translators target in the
Makefile, but it was still referenced in some definitions.  This was a
fatal error for Solaris make.

9 years agotemporary fix for https://rt.cpan.org/Ticket/Display.html?id=96126
Tony Cook [Mon, 2 Jun 2014 13:12:35 +0000 (23:12 +1000)]
temporary fix for https://rt.cpan.org/Ticket/Display.html?id=96126

9 years agoUpgrade Module-Metadata from version 1.000022 to 1.000023
Steve Hay [Mon, 2 Jun 2014 12:25:54 +0000 (13:25 +0100)]
Upgrade Module-Metadata from version 1.000022 to 1.000023

9 years agoperldelta for 207c4a46d1
Steve Hay [Mon, 2 Jun 2014 12:09:14 +0000 (13:09 +0100)]
perldelta for 207c4a46d1

9 years agoBump Locale-Codes from 3.30 to 3.31
Sullivan Beck [Wed, 28 May 2014 15:45:59 +0000 (11:45 -0400)]
Bump Locale-Codes from 3.30 to 3.31

9 years agox2p is gone, do not install its pod.
Jarkko Hietaniemi [Mon, 2 Jun 2014 12:53:04 +0000 (08:53 -0400)]
x2p is gone, do not install its pod.

9 years agoUse PERL_UNUSED_RESULT.
Jarkko Hietaniemi [Sat, 31 May 2014 20:56:00 +0000 (16:56 -0400)]
Use PERL_UNUSED_RESULT.

(1) Enhance its description.
(2) Simplify it: define only if has warn_unused_result.
(3) Make it use STMT_START { ... } STMT_END to be less GNU-extensiony.
(4) Redo 04783dc7 ("fix 'ignoring return value' compiler warnings") with it.

9 years agoremove intentional leak in win32/win32.c ansify_path
Daniel Dragan [Mon, 19 May 2014 23:45:41 +0000 (19:45 -0400)]
remove intentional leak in win32/win32.c ansify_path

The leak for was workaround for a bug (feature?) of Borland RTL where
putenv kept the passed in pointer, see commit 3e5d884e5e .
Borland was removed so this goes too. Leak found with Dr Memory.
msvcrt.dll from WinXP SP3 does not leak on a call to putenv, static linked
CRT from VC6 was confirmed to leak.

9 years agoregcomp.c - cleanup the ahocorasick start class logic so it more self-documenting
Yves Orton [Sat, 19 Apr 2014 12:42:47 +0000 (14:42 +0200)]
regcomp.c - cleanup the ahocorasick start class logic so it more self-documenting

The logic of setting up an AHO-CORASICK regex start class was not fully
encapsuated in the make_trie_failtable() function, which itself was
poorly named. Merged the code into make_trie_failtable() and renamed
it to construct_ahocorasick_from_trie().

9 years agoHash::Util - fixes to hash stats and add bucket_stats_formatted()
Yves Orton [Sun, 13 Apr 2014 11:29:44 +0000 (13:29 +0200)]
Hash::Util - fixes to hash stats and add bucket_stats_formatted()

* we should do the mean/stddev on the on the occupied buckets not all buckets.

This was always intended to the be average chain-length, which implies
that empty buckets with no-chains at all are excluded.

* Add bucket_stats_formatted(), bump version

Creates reports like this:

    Keys: 500 Buckets: 314/512 Quality-Score: 1.01 (Good)
    Utilized Buckets: 61.33% Optimal: 97.66% Keys In Collision: 37.20%
    Chain Length - mean: 1.59 stddev: 0.81
    Buckets 512         [0000000000000000000000000111111111111111111111122222222222233334]
    Len   0 Pct:  38.67 [#########################]
    Len   1 Pct:  34.57 [######################]
    Len   2 Pct:  19.53 [############]
    Len   3 Pct:   5.47 [####]
    Len   4 Pct:   1.17 [#]
    Len   5 Pct:   0.59 []
    Keys    500         [1111111111111111111111111111111111111111222222222222222222333334]
    Pos   1 Pct:  62.80 [########################################]
    Pos   2 Pct:  27.40 [##################]
    Pos   3 Pct:   7.40 [#####]
    Pos   4 Pct:   1.80 [#]
    Pos   5 Pct:   0.60 []

* Make it possible to get stats on PL_strtab

* bump version to 0.17

9 years agohv_func.h - fix seed initialization in sdbm and djb2 hashing algorithms.
Yves Orton [Sun, 13 Apr 2014 10:54:12 +0000 (12:54 +0200)]
hv_func.h - fix seed initialization in sdbm and djb2 hashing algorithms.

In a previous commit I added code to "mix in" the length of the
string into the seed used by these functions, to avoid issues with
zero seeds, and with the hope that it makes it harder to create
multicollision attacks against these hash functions.

Unfortunately when I restructured the seed logic for the inline
functions in hv_func.h I messed it up, and these hash functions
were broken. I never noticed because they are both such bad hash
functions for our needs that I never built with them, and we have
no infrastructure to make it easy to test building with non-standard
hash functions so it never got automatically tested. Hopefully
at some point someone will find a round-tuit and teach Configure
about selecting alternate hash functions.

9 years agouniversal.c - utf8::downgrade($x,FAIL_OK) is not supposed to treat FAIL_OK as an...
Yves Orton [Fri, 21 Mar 2014 16:47:45 +0000 (17:47 +0100)]
universal.c - utf8::downgrade($x,FAIL_OK) is not supposed to treat FAIL_OK as an integer

9 years agot/loc_tools.pl: Clarify comment
Karl Williamson [Fri, 16 May 2014 03:25:32 +0000 (21:25 -0600)]
t/loc_tools.pl: Clarify comment

9 years agoperllocale: Wrap some text in C<...>
Karl Williamson [Sun, 1 Jun 2014 20:03:53 +0000 (14:03 -0600)]
perllocale: Wrap some text in C<...>

9 years agoregcomp.c: Skip work that is a no-op
Karl Williamson [Sun, 11 May 2014 23:41:48 +0000 (17:41 -0600)]
regcomp.c: Skip work that is a no-op

There are a few characters in the Latin1 range that can be folded to by
above-Latin1 characters.  Some of these are folded to as part of a
single character fold, like KELVIN SIGN folds to 'k'.  More are folded
to as part of a multi-character fold.  Until this commit, there wasn't a
quick way to distinguish between the two classes.  A couple of places
only want the single-character ones.  It is more efficient to look for
just those than to include the multi-char ones which end up not doing
anything.  This uses a bit in l1_char_class_tab.h to indicate those
characters that are in the desired class.

9 years agoregcomp.c: Update comment to new reality
Karl Williamson [Mon, 12 May 2014 00:20:54 +0000 (18:20 -0600)]
regcomp.c: Update comment to new reality

9 years agoUpdate Socket to CPAN version 2.014
Chris 'BinGOs' Williams [Sun, 1 Jun 2014 10:30:21 +0000 (11:30 +0100)]
Update Socket to CPAN version 2.014

  [DELTA]

2.014   2014/06/01 00:09:13
        [BUGFIXES]
         * Make sure to (UV)-cast arguments sprintf'ed with UVf
         * Use STRUCT_OFFSET() instead of plain C99 offsetof() (RT96036)
         * Fix the regexp used to filter for numeric IP addresses in
           fake_getaddrinfo() (RT95758)
         * Protect against getprotobyname() not being available (RT90217)

9 years agoUpdate Digest-SHA to CPAN version 5.92
Chris 'BinGOs' Williams [Sun, 1 Jun 2014 10:29:00 +0000 (11:29 +0100)]
Update Digest-SHA to CPAN version 5.92

  [DELTA]

5.92  Sun Jun  1 00:15:44 MST 2014
  - fixed reserved-word clash when compiling with C++
    -- use 'classname' instead of 'class'
      -- ref. SHA.xs (rt.cpan.org #96090)
  - silenced MSC compiler warning about signed/unsigned comparison
    -- ref. SHA.xs (rt.cpan.org #95830)

5.91  Fri May 16 10:21:44 MST 2014
  - restored original 'addfile' for use on opened file handles
    -- allows callbacks in place of actual files
      -- ref. IO::Callback (rt.cpan.org #95643)
  - re-established inheritance from Digest::base
    -- to pick up future Digest enhancements automatically
  - cleaned up documentation

5.90  Wed May  7 07:57:08 MST 2014
  - consolidated all dynamic memory allocation into XSUBs
    -- streamlines referencing of SHA objects
    -- simplifies DESTROYing of objects
  - enhanced Makefile.PL to allow 'use warnings'
    -- automatically reverts to $^W for early Perls
  - scrubbed C and Perl code to remove all compiler warnings

5.89  Sat Apr 19 05:14:48 MST 2014
  - added universal newlines mode ("U") to addfile and shasum
    -- based on Python Universal Newlines concept
      -- newlines identical across MacOS, DOS, and UNIX
    -- will deprecate portable mode ("p") in future
      -- "U" mode is cleaner and more efficient
  - enhanced performance
    -- reduced number of dynamic memory allocations
    -- sped up addfile method with use of C code
      -- ref. SHA.xs (_addfilebin and _addfileuniv)
  - eliminated experimental -M option in favor of new -R option
    -- reverses order of digest module preference
    -- undocumented: for test and development use only
  - sealed memory leak in SHA.xs
    -- arose only with SvPVbyte exceptions during eval
  - patched inheritence bug (ref: rt.cpan.org #94830)
    -- use sv_isobject/sv_derived_from instead of sv_isa
  - added 'allocated' flag to SHA structure (ref. src/sha.h)
    -- to guard against Perl double frees

9 years agoRegen META files after CPAN-Meta update
Chris 'BinGOs' Williams [Sun, 1 Jun 2014 10:26:30 +0000 (11:26 +0100)]
Regen META files after CPAN-Meta update

9 years agoUpdate CPAN-Meta to CPAN version 2.141520
Chris 'BinGOs' Williams [Sun, 1 Jun 2014 10:22:45 +0000 (11:22 +0100)]
Update CPAN-Meta to CPAN version 2.141520

  [DELTA]

2.141520  2014-05-31 23:41:13-04:00 America/New_York

  [DOCUMENTED]

  - Clarified use of 'file' for the 'provides' field in the Spec

9 years agoregen for removed Configure symbol
Tony Cook [Sun, 1 Jun 2014 10:12:21 +0000 (20:12 +1000)]
regen for removed Configure symbol