| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This simplifies things, eliminating nested #if's
|
|
|
|
| |
The new names are clearer.
|
|
|
|
|
| |
This code is full of 'if's interrupted by #ifdefs, which makes it hard
to read. Changing it to a switch() makes it much easier to understand.
|
| |
|
|
|
|
|
|
| |
This was changing to use the locale's radix, but this is unnecessary for
the later things in this function, and those change things to use dot,
so this call is useless.
|
|
|
|
|
|
|
| |
This converts the final plain nl_langinfo() function call in locale.c to
use the new equivalent that is more thread safe, and you don't have to
free the returned memory. There was an unlikely leak before this, if
the return was somehow "".
|
|
|
|
|
|
|
|
| |
The extra '!' that snuck in there caused this code to not work properly.
Fortunately, it doesn't get used except as a last resort, and that
apparently hasn't happened so as to have gotten reported from the field.
A test can't be added because it would only occur on a system that had
bad locales.
|
|
|
|
|
| |
This standardizes things to make things easier to understand and prepare
for future commits
|
|
|
|
| |
This will be useful in future commits
|
|
|
|
| |
The new name more closely reflects what it does
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a parameter to the function that sets the radix character for
floating point numbers. We know that the radix by default is a dot, so
no need to calculate it in that case.
This code was previously using localeconv() to find the locale's decimal
point. The just added my_nl_langinfo() fcn does the same with an easier
API, and is more thread safe, and automatically switches to use
localeconv() when n nl_langinfo() isn't available, so revise the
conditional compilation directives that previously were necessary, and
collapse directives that were unnecessarily nested.
And adjust indentation
|
|
|
|
|
|
|
|
| |
This extended version allows it to be called so that it uses the current
locale for the LC_NUMERIC, instead of toggling to the underlying one.
(This can be useful when in the middle of things.)
This ability won't be used until the next commit
|
|
|
|
|
| |
This function is called as part of the call made in the line before. No
need to do it twice.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This file is full of conditional compilation, due to the fact that
locale support has been highly variable in the OSes Perl has operated
on. This commit properly indents nested compiler directives, and makes
sure there is a blank line between the directives and real code. I find
that much easier to read. It also re-orders some
#ifdef some_feature
Many lines of code handling feature
#else
1 to 3 lines of trivial code to avoid compilation warnings
#endif
to
#ifndef some_feature
1 to 3 lines of trivial code to avoid compilation warnings
#else
Many lines of code handling feature
#endif
Otherwise the trivial code may be hundreds of lines from the original
'#if', which makes it hard to grok.
This commit also clarifies and fixes typos in comments, and removes some
obsolete comments.
|
|\
| |
| |
| |
| |
| |
| | |
Make it simpler to divine if modules are there because of loading B/O or
because the actual program used them.
NPD
|
| |
| |
| |
| |
| | |
We need to test these in unit tests since they do not load these modules to
prevent pollution of the stash in compilers.
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
This commit removes multiple unnecessary modules so that
perl -MO= can hand back to compile as cleanly as possible.
This change caused significant jitter in tests for B::Concise. While updating
the test to the new reality, OptreeCheck.pm was corrected to stop stripping
regexes off $got when it started failing so it would be easier to see where
the failure happened.
|
|
|
|
|
|
|
| |
The goal is to have a quick smoke on travis smokers
to plug in short future CI for any new commits/PR.
NPD
|
|
|
|
|
|
|
|
|
|
|
| |
The previous strchr/memchr changes inadvertently broke the error message
for perl -e '"'. Instead of
Can't find string terminator '"' anywhere before EOF
it became
Can't find string terminator """ anywhere before EOF
|
|
|
|
| |
NPD
|
|
|
|
| |
NPD
|
|
|
|
|
|
|
|
| |
Such a patch allow PL_strtab optimizations at compile time
to statically malloc PL_strtab to an optimized size at startup.
Custom entries can then be added (after PL_hash_seed initialization)
without risking the hash to be reset by perl_construct.
|
|
|
|
|
|
|
| |
Also:
- factor out common expression
- remove redundant double parens
- add spaces to expression
|
|
|
|
|
|
|
|
| |
This was a replacement of strchr(), so should not have used the
find-right-most memrchr.
This was spotted by Christian Hansen. I don't know what the
implications are, but thought I should get a fix in immediately.
|
|
|
|
|
|
|
|
|
|
|
| |
This partially reverts 0f12654f40.
The particular spot being reverted is in gv.c, and the change did not
take into account all the nuances involved, so simply revert it. I
believe what is happening is that a negative number is being generated
and treated as a very large number. Instead the code should retain the
original test that it was ok to do the subtraction, before actually
doing it.
|
|
|
|
|
|
| |
In one case, memEQs was missing a length parameter, and in the
other, two opening braces had been removed but only one closing
brace.
|
|
|
|
| |
compilation broken on darwin using clang
|
|
|
|
|
|
|
|
| |
Recent commit '8725053bce' breaks darwin compilation.
We should use my_memrchr helper to avoid
portability issues, instead of calling
directly memrchr.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Using C string functions on Perl strings doesn't work properly if they
contain embedded NULs. This can happen with Perl program text, for
example, and even if the NUL is illegal, the generated diagnostics are
likely to be misleading as the parsing would have terminated
prematurely.
I have done an audit on core for cases where C string functions are used
in contexts where a Perl string is being processed. This came down to
uses of strchr() and strrchr(). This branch changes many of them to
memchr() and memrchr() respectively. Not all uses of these functions
need change, as there are places where C strings are what is being
processed, such as dealing with OS strings that are NUL terminated.
File paths and environ are two examples.
Also, memchr and memrchr tend to be faster than their str equivalents,
as they only need to look for one termination condition, and there may
be hardware assistance on some platforms. Further, memrchr knows
exactly where to start looking, instead of having to find the NUL ending
the string (strrchr is likely to be implemented as iterating over the
string using strchr from the left, over and over until it fails).
I may have converted some str functions to mem ones unnecessarily, as I
didn't check in full detail if some were operating only on C strings, but
given that the mem ones are faster, this is OK
|
| |
| |
| |
| |
| | |
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
|
| | |
|
| |
| |
| |
| |
| | |
This will make it possible to fix to handle embedded NULs in the next
commits.
|
| |
| |
| |
| |
| | |
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
|
| |
| |
| |
| |
| | |
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
|
| |
| |
| |
| |
| | |
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
|
| |
| |
| |
| |
| | |
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
|
| |
| |
| |
| |
| | |
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
|
| |
| |
| |
| |
| | |
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
|
| |
| |
| |
| |
| | |
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
|
|/
|
|
|
|
|
| |
This allows \x and \o to work properly in the face of embedded NULs.
A limit parameter is added to each function, and that is passed to
memchr (which replaces strchr). See the branch merge message for more
information.
|
|
|
|
|
|
|
| |
Things like LC_CTYPE are locale variables, but not LC_ctype nor
LC__CTYPE. Prior to this commit all were treated as locale variables.
Many platforms have more locale variables than Perl knows about, e.g.,
LC_PAPER, and the code tries to catch all possibilities.
|
|
|
|
|
| |
Align vertically, and indent blocks to standard. It adds braces for
clarity.
|
|\
| |
| |
| |
| |
| |
| |
| | |
See thread beginning with
http://nntp.perl.org/group/perl.perl5.porters/244335
This branch creates various new macros that are easier to read and use
than the underlying code, and uses them in blead
|
| |
| |
| |
| |
| | |
This adds a description of the naming conventions to be used for any new
string comparison macros.
|
| |
| |
| |
| | |
Until we decide these weren't a bad idea
|
| | |
|
| |
| |
| |
| | |
For consistency
|
| |
| |
| |
| | |
All uses of these private macros have been replaced by other calls.
|