This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
10 years agoUpdate Config-Perl-V to version 0.18
H.Merijn Brand [Fri, 24 May 2013 15:33:07 +0000 (17:33 +0200)]
Update Config-Perl-V to version 0.18

10 years agoAdd NO_TAINT_SUPPORT to S_Internals_V ()
H.Merijn Brand [Fri, 24 May 2013 14:36:55 +0000 (16:36 +0200)]
Add NO_TAINT_SUPPORT to S_Internals_V ()

10 years agotypo fixes for porting scripts
David Steinbrunner [Tue, 21 May 2013 10:56:08 +0000 (06:56 -0400)]
typo fixes for porting scripts

10 years agotypo fixes for version pod
David Steinbrunner [Tue, 21 May 2013 10:57:44 +0000 (06:57 -0400)]
typo fixes for version pod

10 years agoTry to avoid nesting F<$F<...>> in generated Config.pm
David Golden [Thu, 23 May 2013 23:11:23 +0000 (19:11 -0400)]
Try to avoid nesting F<$F<...>> in generated Config.pm

10 years agofix various podcheck nits
David Golden [Thu, 23 May 2013 22:08:48 +0000 (18:08 -0400)]
fix various podcheck nits

10 years agofix various Pod line length warnings
David Golden [Thu, 23 May 2013 20:58:20 +0000 (16:58 -0400)]
fix various Pod line length warnings

10 years agohelp t/podcheck.t skip duplicate pod in utils
David Golden [Thu, 23 May 2013 22:08:24 +0000 (18:08 -0400)]
help t/podcheck.t skip duplicate pod in utils

10 years agostop t/podcheck.t from flagging blockquotes
David Golden [Thu, 23 May 2013 22:07:58 +0000 (18:07 -0400)]
stop t/podcheck.t from flagging blockquotes

10 years agoMake t/podcheck.t less sensitive
David Golden [Thu, 23 May 2013 20:33:09 +0000 (16:33 -0400)]
Make t/podcheck.t less sensitive

The max line length is increased to 100.  This eliminates dozens of
known issues.

The warnings about using F<> and L<> instead of C<> have been removed
on the rationale that they are too opinionated.  They flag stylistic
issues rather than syntactic or structural issues and have minimal
impact on the effectiveness of the resulting documentation.

10 years agotypo fixes for porting modules
David Steinbrunner [Tue, 21 May 2013 10:53:18 +0000 (06:53 -0400)]
typo fixes for porting modules

Bump $VERSION for Porting/Maintainers.pm.

10 years agotypo fixes for porting pod note optimiser
David Steinbrunner [Tue, 21 May 2013 10:52:43 +0000 (06:52 -0400)]
typo fixes for porting pod note optimiser

Change to optimizer to be consistent with other uses of optimizer in todo.
Clear up confusion in regex optimizer entry.

10 years agomaking DOS stand out in dosify
David Steinbrunner [Tue, 21 May 2013 10:50:14 +0000 (06:50 -0400)]
making DOS stand out in dosify

10 years agotypo fix for os2 module
David Steinbrunner [Tue, 21 May 2013 10:49:13 +0000 (06:49 -0400)]
typo fix for os2 module

Bump $VERSION for os2/OS2/OS2-Process/Process.pm.

10 years agotypo fix for util script
David Steinbrunner [Tue, 21 May 2013 10:48:37 +0000 (06:48 -0400)]
typo fix for util script

10 years agotypo fixes for win32 scripts
David Steinbrunner [Tue, 21 May 2013 10:48:17 +0000 (06:48 -0400)]
typo fixes for win32 scripts

10 years agoSync Module-CoreList version in Maintainers.pl
Chris 'BinGOs' Williams [Thu, 23 May 2013 20:52:08 +0000 (21:52 +0100)]
Sync Module-CoreList version in Maintainers.pl

10 years agoRefactor autodoc.pl to read MANIFEST line by line, instead of slurping it.
Nicholas Clark [Tue, 17 Apr 2012 13:59:44 +0000 (15:59 +0200)]
Refactor autodoc.pl to read MANIFEST line by line, instead of slurping it.

10 years agoautodoc.pl now uses regen/embed_lib.pl to parse embed.fnc
Nicholas Clark [Tue, 17 Apr 2012 13:47:13 +0000 (15:47 +0200)]
autodoc.pl now uses regen/embed_lib.pl to parse embed.fnc

Previously it had its own custom parsing code for embed.fnc.

10 years agoRefactor autodoc.pl to use regen_lib.pl to generate file headers & footers.
Nicholas Clark [Sun, 8 Apr 2012 17:44:11 +0000 (19:44 +0200)]
Refactor autodoc.pl to use regen_lib.pl to generate file headers & footers.

This reduces duplication of code that generates '-*- buffer-read-only: t -*-',
'ex: set ro:' etc.

10 years agoIn regen/regen_lib.pl, add 'Pod' as a third supported 'language'.
Nicholas Clark [Sun, 8 Apr 2012 17:36:49 +0000 (19:36 +0200)]
In regen/regen_lib.pl, add 'Pod' as a third supported 'language'.

Pod needs a commenting style distinct from C and Perl. (ie the empty string)

10 years agot/porting/diag.t now uses regen/embed_lib.pl to parse embed.fnc
Nicholas Clark [Sun, 8 Apr 2012 11:28:06 +0000 (13:28 +0200)]
t/porting/diag.t now uses regen/embed_lib.pl to parse embed.fnc

Previously it had its own custom parsing code for embed.fnc.

10 years agoIn t/porting/diag.t, use TestInit to chdir and set up @INC.
Nicholas Clark [Sun, 8 Apr 2012 11:08:28 +0000 (13:08 +0200)]
In t/porting/diag.t, use TestInit to chdir and set up @INC.

Also eliminate the $|=1, as it's really not necessary for tests that neither
fork nor shell out to other processes.

10 years agoAvoid VMS running autodoc.pl twice for no reason.
Nicholas Clark [Sun, 8 Apr 2012 17:56:47 +0000 (19:56 +0200)]
Avoid VMS running autodoc.pl twice for no reason.

Previous descrip_mms.template carried separate rules to build perlintern.pod
and perlapi.pod, each of which caused autodoc.pl to run. autdoc.pl builds
both files when it runs, so this was duplicate work.

10 years agoRefactor the "check categories and severity" logic in diag.t
Nicholas Clark [Wed, 22 May 2013 09:48:03 +0000 (11:48 +0200)]
Refactor the "check categories and severity" logic in diag.t

Move the "todo" bailout as early as possible, before any work is done.
Replace C<use 5.01> [sic] with C<use feature 'state'>, as this makes the
intent much clearer.
Use parenthesis for like() and is() as this is consistent with the rest of the
test, and permits a simplification of the BEGIN handling.

10 years agoProvide alternate email address for jkeenan.
James E Keenan [Thu, 23 May 2013 01:26:55 +0000 (03:26 +0200)]
Provide alternate email address for jkeenan.

10 years agoCorrect known_pod_issues.dat.
James Keenan [Thu, 23 May 2013 01:06:54 +0000 (03:06 +0200)]
Correct known_pod_issues.dat.

10 years agotypo fix for vms script
David Steinbrunner [Tue, 21 May 2013 10:47:33 +0000 (06:47 -0400)]
typo fix for vms script

10 years agotypo fixes for regen scripts
David Steinbrunner [Tue, 21 May 2013 10:47:05 +0000 (06:47 -0400)]
typo fixes for regen scripts

10 years agotypo fixes for root level scripts
David Steinbrunner [Tue, 21 May 2013 10:46:18 +0000 (06:46 -0400)]
typo fixes for root level scripts

Add David Steinbrunner to AUTHORS.
Update pod issues database.

10 years agoperldiag: Describe \g syntax error
Karl Williamson [Wed, 22 May 2013 19:28:07 +0000 (13:28 -0600)]
perldiag: Describe \g syntax error

Commit 779fedd7c3021f013726c8f53cb9e66c54637ebf added a warning,
which is nearly identical to an existing one, but didn't change the
description of the existing one to encompass both.  This rectifies that.

10 years agoregcomp.c: Actually emit proper warning
Karl Williamson [Wed, 20 Mar 2013 17:42:18 +0000 (11:42 -0600)]
regcomp.c: Actually emit proper warning

Before this commit, /\g/ raised the wrong warning
    Reference to invalid group 0
This rearranges the code so that the proper warning is emitted.
    Unterminated \g... pattern

10 years agoMake Unicode::UCD::search_invlist() available
Karl Williamson [Wed, 22 May 2013 02:34:47 +0000 (20:34 -0600)]
Make Unicode::UCD::search_invlist() available

This commit documents this function, removing the initial underscore
from its name.  (And it hardens input checking.)

10 years agoUnicode::UCD Clarifications in pod
Karl Williamson [Wed, 22 May 2013 01:41:44 +0000 (19:41 -0600)]
Unicode::UCD Clarifications in pod

There are no "missing" values in inversion maps; there is a default
value returned for each one.  So change the example variables' names.
Plus another sentence rewording for clarity.

10 years agoUnicode::UCD: Move function in file.
Karl Williamson [Mon, 20 May 2013 18:13:22 +0000 (12:13 -0600)]
Unicode::UCD: Move function in file.

This is in preparation for making this function public, and it should be
listed in the pod later than it otherwise would be.

10 years agoUnicode::UCD: Correct wrong pod info
Karl Williamson [Mon, 20 May 2013 16:41:01 +0000 (10:41 -0600)]
Unicode::UCD: Correct wrong pod info

 This was erroneous.  Extra clarifications are also added.

10 years agoremove a spurious space
Ricardo Signes [Wed, 22 May 2013 13:33:16 +0000 (09:33 -0400)]
remove a spurious space

10 years agoSome more comments describing the slab allocator.
Nicholas Clark [Wed, 22 May 2013 11:56:50 +0000 (13:56 +0200)]
Some more comments describing the slab allocator.

These are based on the description of commit 8be227ab5eaa23f2, but provide
explanations near to the relevant C code.

10 years agoAdd comments describing the operation of S_scan_ident().
Nicholas Clark [Mon, 8 Apr 2013 14:30:18 +0000 (16:30 +0200)]
Add comments describing the operation of S_scan_ident().

10 years agoMore tests for the "Ambiguous use of ... resolved ..." warning S_scan_ident().
Nicholas Clark [Mon, 8 Apr 2013 14:27:19 +0000 (16:27 +0200)]
More tests for the "Ambiguous use of ... resolved ..." warning S_scan_ident().

In particular, test that the special case for reporting $# as @ works.

10 years agoFix typo in Porting/sync-with-cpan
Max Maischein [Tue, 21 May 2013 19:40:21 +0000 (21:40 +0200)]
Fix typo in Porting/sync-with-cpan

I will run `make test_porting` on the correct branch before submitting a patch.
I will run `make test_porting` on the correct branch before submitting a patch.
I will run `make test_porting` on the correct branch before submitting a patch.

10 years agoEliminate external call to tar executable in favour of Archive::Tar
Max Maischein [Tue, 21 May 2013 17:09:47 +0000 (19:09 +0200)]
Eliminate external call to tar executable in favour of Archive::Tar

Archive::Tar has ->extract_archive, which does Just That. This means
we lose immediate support for bzip2 files, but not all
incarnations of `tar` support it either.

Signed-off-by: David Golden <dagolden@cpan.org>
10 years agoAdd new Module::CoreList::Utils to MANIFEST
Chris 'BinGOs' Williams [Tue, 21 May 2013 13:13:52 +0000 (14:13 +0100)]
Add new Module::CoreList::Utils to MANIFEST

10 years agoMerge branch 'smoke-me/coreutils' into blead
Chris 'BinGOs' Williams [Tue, 21 May 2013 12:32:53 +0000 (13:32 +0100)]
Merge branch 'smoke-me/coreutils' into blead

10 years agoRemove 2 superfluous use lines from ExtUtils::CBuilder.
Nicholas Clark [Wed, 24 Apr 2013 15:01:43 +0000 (17:01 +0200)]
Remove 2 superfluous use lines from ExtUtils::CBuilder.

use IO::File was added with the upgrade to 0.23 (commit c3fb68a339256eb3 in
April 2008), but the use of IO::File in the code was eliminated by the
upgrade to 0.2800 (commit 06e8058f27e4269b in Dec 2010), which replaced
the code in question with use of File::Temp. The latter refactoring also
added the use Data::Dumper; line, but did not add any code which uses
Data::Dumper.

10 years agoRefactor 3 tests so that they avoid clearing %:: via list assignment.
Nicholas Clark [Wed, 10 Apr 2013 11:44:07 +0000 (13:44 +0200)]
Refactor 3 tests so that they avoid clearing %:: via list assignment.

For all 3, clearing %:: was intended to expose another bug, not to directly
test the effects of clearing %::

Tested by building the 3 revisions that added the tests, and confirming that
the revised test also triggers the bug that each fixed.

10 years agoTest that caller does not SEGV when the current package is undefined.
Nicholas Clark [Fri, 5 Apr 2013 10:12:53 +0000 (12:12 +0200)]
Test that caller does not SEGV when the current package is undefined.

Prior to commit d4d03940c58a0177 this code would SEGV under ithreads.
Test suggested by Brian Fraser.

10 years agoRemove fakethr.h and eliminate all references to it and FAKE_THREADS
Nicholas Clark [Mon, 20 May 2013 15:55:46 +0000 (17:55 +0200)]
Remove fakethr.h and eliminate all references to it and FAKE_THREADS

fakethr.h and FAKE_THREADS were for a "green" threads implementation of
5005threads. 5005threads itself is long gone, and it's not clear that
-DFAKE_THREADS *ever* built correctly. Certainly it did not work for the
5.005 release, and it did not work at the time of the commits for the initial
checkin. The closest that it seems to have been to working is around commit
c6ee37c52f2ca9e5 (Dec 1997), where the headers no longer contained errors,
but perl.c failed to compile.

10 years agoMerge the refactoring of x2p's Makefile to blead.
Nicholas Clark [Tue, 21 May 2013 05:49:29 +0000 (07:49 +0200)]
Merge the refactoring of x2p's Makefile to blead.

10 years agoSimplify x2p's Makefile.
Nicholas Clark [Wed, 15 May 2013 19:48:12 +0000 (21:48 +0200)]
Simplify x2p's Makefile.

Eliminate plexe and plc, which relate to tests for the compiler and were
added as part of commit 52cebf5efc9883c7 in May 1988. The compiler was
removed by commit de1254415ffeb03b in Sept 2006.

The files a2p.man and s2p.man were removed with Perl 5.000.
The macros 'public', 'private' and 'util' mirror the structure of the top
level Makefile.SH. However, x2p only ever used 'public', so simplify things
by inlining the value of 'public' in the only place that uses it.
'addedbyconf' now only contains the value of 'plextract', so use the latter
directly in the one place that had used 'addedbyconf'.

10 years agoRemove rules to delete *.loadmap and *.prelmap files, generated on VM/ESA
Nicholas Clark [Wed, 15 May 2013 19:34:21 +0000 (21:34 +0200)]
Remove rules to delete *.loadmap and *.prelmap files, generated on VM/ESA

These rules to clean up properly on VM/ESA were added in Oct 1998 by
perforce changes 1961, 1962 and 1963 in the confperl branch. VM/ESA support
was removed by commit 043fec90e88a2e23 in Aug 2012.

10 years agoAdd x2p/Makefile.SH to the *.SH files processed by the top level Makefile.
Nicholas Clark [Wed, 15 May 2013 19:26:59 +0000 (21:26 +0200)]
Add x2p/Makefile.SH to the *.SH files processed by the top level Makefile.

This makes the top level Makefile responsible for deleting x2p/Makefile.
With this, we can eliminate the 'sh' and 'shextract' from x2p's Makefile.

10 years agoRemove the now unused 'shlist' Makefile targets.
Nicholas Clark [Wed, 15 May 2013 19:17:31 +0000 (21:17 +0200)]
Remove the now unused 'shlist' Makefile targets.

10 years agoProgrammatically generate dependencies for all *.SH files.
Nicholas Clark [Wed, 15 May 2013 18:57:37 +0000 (20:57 +0200)]
Programmatically generate dependencies for all *.SH files.

Previously dependencies for Makefile, config.h and makedepend were
explicitly coded into verbatim sections of Makefile.SH, with most of the
others being generated by makedepend.SH

10 years agoAdd runtests.SH to the code that generates the targets sh and shextract.
Nicholas Clark [Wed, 15 May 2013 18:25:47 +0000 (20:25 +0200)]
Add runtests.SH to the code that generates the targets sh and shextract.

The generated Makefile is functionally identical.

10 years agoEliminate x2p/cflags.SH. x2p's Makefile can use ../cflags
Nicholas Clark [Wed, 15 May 2013 15:14:50 +0000 (17:14 +0200)]
Eliminate x2p/cflags.SH. x2p's Makefile can use ../cflags

x2p/Makefile is only used on *nix, so this should not present a problem.

10 years agoPass in to makedepend the name(s) of files that all objects depend on.
Nicholas Clark [Wed, 15 May 2013 17:40:46 +0000 (19:40 +0200)]
Pass in to makedepend the name(s) of files that all objects depend on.

10 years agoIn the Makefile, generate the value of shextract programmatically.
Nicholas Clark [Wed, 15 May 2013 14:54:40 +0000 (16:54 +0200)]
In the Makefile, generate the value of shextract programmatically.

shextract lists the files generated by shell scripts named *.SH which need
deleting. Instead of maintaining it by hand, generate it in Makefile.SH from
the list of *.SH files.

This indirectly eliminates the last reference to F<makedir>. makedir.SH
was eliminated by commit ebca06e95b02d1a8 and the reference to makedir.SH in
Makefile.SH eliminated by commit 847471027aa42997 (both Sept 2009), but
that commit missed that the reference to makedir a few lines later was
related.

10 years agoDefer running makedepend in x2p/ until it's needed.
Nicholas Clark [Wed, 15 May 2013 11:01:22 +0000 (13:01 +0200)]
Defer running makedepend in x2p/ until it's needed.

We can run makedepend in x2p/ as part of the regular build process, which
means that it can run as part of a parallel make. This gets a slight
speedup (0.2s on this system), and increases flexibility on how x2p/Makefile
is generated.

10 years agoAdd x2p/makefile to the dependencies for targets within x2p/
Nicholas Clark [Wed, 15 May 2013 10:49:44 +0000 (12:49 +0200)]
Add x2p/makefile to the dependencies for targets within x2p/

This will give us more flexibility in when and how we generate it.

[x2p/makefile is x2p/GNUmakefile on OS X]

10 years agoRemove vestigial *.SH code which can link the extracted file into ../
Nicholas Clark [Wed, 15 May 2013 10:33:05 +0000 (12:33 +0200)]
Remove vestigial *.SH code which can link the extracted file into ../

4 of the *.SH files have code which links the extracted file into the parent
directory if the current directory ends SH. This code dates from Perl 1.
It seems that the intent was that the *.SH files could live in a SH/
directory, but that feature was neither used or mentioned in the
documentation in Perl 1, and hasn't been used since.

10 years agoMerge the pack refactoring to blead.
Nicholas Clark [Mon, 20 May 2013 19:42:33 +0000 (21:42 +0200)]
Merge the pack refactoring to blead.

10 years agoNotes in perldelta for the tiny XS-visible changes of the pack refactoring.
Nicholas Clark [Mon, 20 May 2013 19:40:27 +0000 (21:40 +0200)]
Notes in perldelta for the tiny XS-visible changes of the pack refactoring.

10 years agoAnnotate the "cold" paths in pp_pack.c with UNLIKELY().
Nicholas Clark [Wed, 8 May 2013 08:40:07 +0000 (10:40 +0200)]
Annotate the "cold" paths in pp_pack.c with UNLIKELY().

The usual case is nice regular bytes in the host's nice regular order.

10 years agoEliminate the implementations of [hv]to[vh][ls] for mixed-endian systems.
Nicholas Clark [Tue, 7 May 2013 16:25:53 +0000 (18:25 +0200)]
Eliminate the implementations of [hv]to[vh][ls] for mixed-endian systems.

As pp_pack.c has had mixed-endian support removed, there is little point in
keeping code in perl.h and util.c only needed for architectures that cannot
be built.

10 years agoEliminate Perl_my_swabn(), as it is now unused.
Nicholas Clark [Tue, 7 May 2013 16:17:39 +0000 (18:17 +0200)]
Eliminate Perl_my_swabn(), as it is now unused.

It is not marked as part of the API, and no code on CPAN is using it.

10 years agoWhen endian-swapping in pack, simply copy the bytes in reverse order.
Nicholas Clark [Tue, 7 May 2013 15:39:42 +0000 (17:39 +0200)]
When endian-swapping in pack, simply copy the bytes in reverse order.

This should restore support for big endian Crays. It doesn't support
mixed-endian systems.

10 years agoPass 'needs_swap' as a parameter to SHIFT_BYTES.
Nicholas Clark [Tue, 7 May 2013 14:22:08 +0000 (16:22 +0200)]
Pass 'needs_swap' as a parameter to SHIFT_BYTES.

It feels wrong to have it as an implicit parameter sucked in via the textual
expansion of the macro. Whilst it can be derived from the parameter
'datumtype', it seems that the C compiler generates a lot less efficient code
that way.

10 years agoWhen endian-swapping in unpack, simply copy the bytes in reverse order.
Nicholas Clark [Tue, 7 May 2013 13:15:54 +0000 (15:15 +0200)]
When endian-swapping in unpack, simply copy the bytes in reverse order.

It is considerably simpler to re-order the bytes before reading them into
the variable of the desired type, than to read into the variable and then
need a specialised "reverse this integer" function for each size of integer.

This should restore support for big endian Crays. It doesn't support
mixed-endian systems. Support for mixed-endian systems can be restored (if
needed) by re-ordering the bytes correctly at the locations which currently
only know how to reverse the bytes.

10 years agoFold the implementation of DO_BO_UNPACK into SHIFT_BYTES(), its only user.
Nicholas Clark [Tue, 7 May 2013 10:23:00 +0000 (12:23 +0200)]
Fold the implementation of DO_BO_UNPACK into SHIFT_BYTES(), its only user.

10 years agoRe-implement SHIFT16 and SHIFT32 as wrappers to SHIFT_BYTES.
Nicholas Clark [Tue, 7 May 2013 09:53:17 +0000 (11:53 +0200)]
Re-implement SHIFT16 and SHIFT32 as wrappers to SHIFT_BYTES.

10 years agoRefactor the two uses of SHIFT{16,32} not followed by DO_BO_UNPACK().
Nicholas Clark [Tue, 7 May 2013 08:08:53 +0000 (10:08 +0200)]
Refactor the two uses of SHIFT{16,32} not followed by DO_BO_UNPACK().

There is one place where SHIFT16() is not immediately followed by
DO_BO_UNPACK() ('n!' and 'v!'), and one place where SHIFT32() is not
immediately followed by DO_BO_UNPACK() ('N!' and 'V!'). Every other use of
either macro is followed by DO_BO_UNPACK(). For the two locations that don't
have DO_BO_UNPACK(), the modifiers '<' and '>' are illegal, hence
DO_BO_UNPACK() will always be a no-op. Hence add DO_BO_UNPACK() to both
(which permits refactoring to simplify things), and add assert()s that the
assumptions are true.

10 years agoRemove the now unused 'type' argument from the macros DO_BO_(UN)?PACK.
Nicholas Clark [Tue, 7 May 2013 07:25:39 +0000 (09:25 +0200)]
Remove the now unused 'type' argument from the macros DO_BO_(UN)?PACK.

10 years agoAs DO_BO_(UN)?PACK are now implemented with my_swabn(), simplify 'J' and 'j'.
Nicholas Clark [Mon, 6 May 2013 18:40:34 +0000 (20:40 +0200)]
As DO_BO_(UN)?PACK are now implemented with my_swabn(), simplify 'J' and 'j'.

The conditionally compiled code to figure out the correct named integer
size for UVs and IVs is no longer needed, as my_swabn() will swap UVs and
IVs, whatever their length.

10 years agoMerge the identical definitions of DO_BO_UNPACK and DO_BO_PACK.
Nicholas Clark [Mon, 6 May 2013 17:58:10 +0000 (19:58 +0200)]
Merge the identical definitions of DO_BO_UNPACK and DO_BO_PACK.

Delete the now-unused mixed-endian definitions of DO_BO_UNPACK and
DO_BO_PACK, and the macro BO_CANT_DOIT, as they were the last two things
using it.

10 years agoSwap byte order in DO_BO_(UN)?PACK based on a variable needs_swap.
Nicholas Clark [Mon, 6 May 2013 17:41:10 +0000 (19:41 +0200)]
Swap byte order in DO_BO_(UN)?PACK based on a variable needs_swap.

Add the macro NEEDS_SWAP to initialise needs_swap based on
TYPE_ENDIANNESS(datumtype). This makes the two definitions of DO_BO_UNPACK
identical, and the two definitions of DO_BO_PACK identical.

This also makes building pp_pack.c on a mixed endian byteorder architecture
a compile time error. The commit adds pointers on where to add code to
re-instate support for such architectures.

10 years agoDO_BO_{UN,}PACK can use my_swabn() directly.
Nicholas Clark [Mon, 6 May 2013 16:43:26 +0000 (18:43 +0200)]
DO_BO_{UN,}PACK can use my_swabn() directly.

This removes the only users of my_{be,le,h}to{be,le,h}n, so remove the
definitions for those macros.

10 years agoUse DO_BO_{UN,}PACK in place of DO_BO_UNPACK_{N,PC}
Nicholas Clark [Mon, 6 May 2013 16:05:24 +0000 (18:05 +0200)]
Use DO_BO_{UN,}PACK in place of DO_BO_UNPACK_{N,PC}

Also, eliminate the intermediate macros DO_BO_PACK_PTR and DO_BO_UNPACK_PTR.

10 years agoEliminate my_{hto[bl]e,[bl]etoh}{16,32,64,s,i,l} as nothing now uses them.
Nicholas Clark [Mon, 6 May 2013 15:16:18 +0000 (17:16 +0200)]
Eliminate my_{hto[bl]e,[bl]etoh}{16,32,64,s,i,l} as nothing now uses them.

10 years agoIn pp_pack.c, refactor DO_BO_(UN)?PACK to use my_letohn etc
Nicholas Clark [Mon, 6 May 2013 14:54:12 +0000 (16:54 +0200)]
In pp_pack.c, refactor DO_BO_(UN)?PACK to use my_letohn etc

Previously they were using a my_letoh* function for the appropriate size.

This commit probably breaks fixed 16 and 32 bit templates on big endian
Crays where sizeof(short) and sizeof(int) are 8. A future commit will
restore support. (Although it's not clear whether such Crays can still
build blead cleanly, as we've not had any feedback since Boeing
decommissioned their Cray.)

10 years agoIn pp_pack.c, refactor DO_BO_(UN)?PACK_PTR to use my_letohn etc
Nicholas Clark [Mon, 6 May 2013 14:36:09 +0000 (16:36 +0200)]
In pp_pack.c, refactor DO_BO_(UN)?PACK_PTR to use my_letohn etc

Previously they were casting the pointer to an integer value, calling
a my_letoh* function for the appropriate size, and casting the return value
back to a pointer.

10 years agoIn pp_pack.c, refactor DO_BO_(UN)?PACK_N to use sizeof() on the variable.
Nicholas Clark [Mon, 6 May 2013 14:22:01 +0000 (16:22 +0200)]
In pp_pack.c, refactor DO_BO_(UN)?PACK_N to use sizeof() on the variable.

Previously they were using sizeof() on the type argument passed to the
macro. This change makes their implementation more like DO_BO_(UN)?PACK
and DO_BO_(UN)?PACK_PTR.

10 years agoRefactor macros in pp_pack.c, removing support for mixed-endian byte orders.
Nicholas Clark [Mon, 6 May 2013 13:46:02 +0000 (15:46 +0200)]
Refactor macros in pp_pack.c, removing support for mixed-endian byte orders.

The byte-order handling can be simplified considerably if we don't have to
support mixed-endian systems. It's not clear whether Perl 5.000 even
compiled on PDP-11s, let alone more recent versions.

Support probably can be added back at the end of the refactoring, if someone
has time and a PDP-11 to test on, but for the intermediate stages it is a
lot easier not to need to think about such platforms.

10 years agoEliminate the conditionally-compiled fallback functions for htonl etc.
Nicholas Clark [Mon, 6 May 2013 12:40:04 +0000 (14:40 +0200)]
Eliminate the conditionally-compiled fallback functions for htonl etc.

These are now only being used for mixed-endian platforms which do not
provide their own htnol (etc) functions. Given that the fallbacks have been
buggy since they were added in Perl 3.0, it's safe to conclude that no
mixed-endian platforms were ever using these functions.

It's also unclear why these functions were ever marked as 'A', part of the
API. XS code can't call them directly, as it can't rely on them being
compiled. Unsurprisingly, no code on CPAN references them.

10 years agoRemove buggy loop-based byte swapping code.
Nicholas Clark [Mon, 6 May 2013 11:28:20 +0000 (13:28 +0200)]
Remove buggy loop-based byte swapping code.

The irony is that the union-based code special-cased for little endian
systems actually works everywhere, even on mixed-endian systems.

10 years agoUpdate the Win32 miniperl conditional compilation, for the htonl etc changes.
Nicholas Clark [Mon, 6 May 2013 06:20:57 +0000 (08:20 +0200)]
Update the Win32 miniperl conditional compilation, for the htonl etc changes.

As of commit 19253ae62cd13079 (Oct 2012), miniperl on Win32 avoids using
Winsock. The win32_* wrappers for htonl etc had used the pre-processor
macro MYSWAP to conditionally compile in the correct code. However, MYSWAP
was defined as a side effect of using the htonl etc wrappers in util.c,
which are no longer needed. Hence use the WIN32_NO_SOCKETS macro directly
in win32sck.c for the correct conditional compilation.

10 years agoFallbacks for ntohl, ntohs, htonl and htons for little endian systems.
Nicholas Clark [Sat, 4 May 2013 20:50:12 +0000 (22:50 +0200)]
Fallbacks for ntohl, ntohs, htonl and htons for little endian systems.

The host byteorder agnostic functions in util.c are now only used on mixed
endian systems.

10 years agoProvide ntohl, ntohs, htonl and htons no-op macros on big endian systems.
Nicholas Clark [Sat, 4 May 2013 20:03:59 +0000 (22:03 +0200)]
Provide ntohl, ntohs, htonl and htons no-op macros on big endian systems.

This means that there are always macros or functions for ntohl, ntohs,
htonl and htons available, so eliminate use of HAS_NTOHL etc, and
unconditionally compile the code that it was protecting. However, as code
on CPAN is using these guard macros, define all of them in perl.h

(Technically the 4 are not quite no-ops, as they truncate their values to
32 or 16 bits, to be consistent with the implementations for platforms which
need re-ordering.)

10 years agoProvide vtohl, vtohs, htovl and htovs no-op macros on little endian systems.
Nicholas Clark [Sat, 4 May 2013 19:30:27 +0000 (21:30 +0200)]
Provide vtohl, vtohs, htovl and htovs no-op macros on little endian systems.

This means that there are always macros or functions for vtohl, vtohs,
htovl and htovs available, so eliminate HAS_VTOHL etc, and unconditionally
compile the code that it was protecting. grep.cpan.me shows that no code on
CPAN uses any of these macros.

(Technically the 4 are not quite no-ops, as they truncate their values to
32 or 16 bits, to be consistent with the implementations for platforms which
need re-ordering.)

10 years agovtohl, vtohs, htovl and htovs are no-ops on 64 bit little endian systems.
Nicholas Clark [Sat, 4 May 2013 19:07:14 +0000 (21:07 +0200)]
vtohl, vtohs, htovl and htovs are no-ops on 64 bit little endian systems.

Previously they were implemented as function calls on 64 bit little endian
systems. Bit endian systems implemented them as byte-swapping macros. 32
little endian system didn't implement them at all. 32 and 64 bit little
endian systems now behave identically.

10 years agoEliminate the definitions for DO_BO_PACK_P and DO_BO_UNPACK_P.
Nicholas Clark [Fri, 3 May 2013 15:06:01 +0000 (17:06 +0200)]
Eliminate the definitions for DO_BO_PACK_P and DO_BO_UNPACK_P.

Commit 07409e015252427f in April 2005 replaced all the uses of these two
macros with DO_BO_PACK_PC and DO_BO_UNPACK_PC.

10 years agoEliminate pre-5.9.x conditional code for PERL_PACK_CAN_SHRIEKSIGN
Nicholas Clark [Fri, 3 May 2013 13:52:38 +0000 (15:52 +0200)]
Eliminate pre-5.9.x conditional code for PERL_PACK_CAN_SHRIEKSIGN

PERL_PACK_CAN_SHRIEKSIGN has been unconditionally defined for versions 5.9.x
and greater, and undefined for 5.8.x. As we are never going to need to
port changes back to maint-5.8 any more, eliminate all the 5.8.x related code
and the macro that supports it.

10 years agoEliminate pre-5.9.x conditional code for PERL_PACK_CAN_BYTEORDER
Nicholas Clark [Fri, 3 May 2013 13:26:34 +0000 (15:26 +0200)]
Eliminate pre-5.9.x conditional code for PERL_PACK_CAN_BYTEORDER

PERL_PACK_CAN_BYTEORDER has been unconditionally defined for versions 5.9.x
and greater, and undefined for 5.8.x. As we are never going to need to
port changes back to maint-5.8 any more, eliminate all the 5.8.x related code,
and the macro that supports it.

10 years agoMerge the reworking of how genpacksizetables.pl is used.
Nicholas Clark [Mon, 20 May 2013 19:12:01 +0000 (21:12 +0200)]
Merge the reworking of how genpacksizetables.pl is used.

10 years agoAdd regen/genpacksizetables.pl to t/porting/regen.t
Nicholas Clark [Mon, 29 Apr 2013 10:06:39 +0000 (12:06 +0200)]
Add regen/genpacksizetables.pl to t/porting/regen.t

10 years agoMove genpacksizetables.pl to regen/genpacksizetables.pl
Nicholas Clark [Mon, 29 Apr 2013 09:54:19 +0000 (11:54 +0200)]
Move genpacksizetables.pl to regen/genpacksizetables.pl

10 years agoRefactor genpacksizetables.pl to use regen/regen_lib.pl
Nicholas Clark [Mon, 29 Apr 2013 09:47:30 +0000 (11:47 +0200)]
Refactor genpacksizetables.pl to use regen/regen_lib.pl

10 years agoExtract the generated packprops array into packsizetables.c.
Nicholas Clark [Mon, 29 Apr 2013 09:23:11 +0000 (11:23 +0200)]
Extract the generated packprops array into packsizetables.c.

The C source is the output from genpacksizetables.pl
Previously it was pasted into pp_pack.c

 LocalWords:  packprops

10 years agoPropagate a change from commit 1651fc447620d361 into genpacksizetables.pl.
Nicholas Clark [Mon, 29 Apr 2013 09:08:05 +0000 (11:08 +0200)]
Propagate a change from commit 1651fc447620d361 into genpacksizetables.pl.

pp_pack.c contains a table generated by genpacksizetables.pl, pasted into the
C source. The C source was updated by commit 1651fc447620d361 in April 2007,
but the table used to generate the code was not.

10 years agogenpacksizetables.pl: Correct comment typo
Karl Williamson [Wed, 13 Mar 2013 22:18:12 +0000 (16:18 -0600)]
genpacksizetables.pl: Correct comment typo