summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* numeric.c: Refactor #if #else in Perl_my_aotfKarl Williamson2017-11-081-5/+12
| | | | This simplifies things, eliminating nested #if's
* numeric.c: Rename some variablesKarl Williamson2017-11-081-3/+5
| | | | The new names are clearer.
* Perl_locale(): Refactor for clarityKarl Williamson2017-11-081-76/+37
| | | | | 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.
* locale.c:sync_locale(): Add debugging infoKarl Williamson2017-11-081-3/+16
|
* locale.c:sync_locale(): Rmv useless callKarl Williamson2017-11-081-1/+0
| | | | | | 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.
* locale.c: Use new nl_langinfo equivalentKarl Williamson2017-11-081-4/+7
| | | | | | | 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 "".
* locale.c: Rmv erroneous complement operatorKarl Williamson2017-11-081-1/+1
| | | | | | | | 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.
* locale.c: Refactor locale macrosKarl Williamson2017-11-081-22/+23
| | | | | This standardizes things to make things easier to understand and prepare for future commits
* locale.c: Convert setlocale() calls to macrosKarl Williamson2017-11-081-36/+41
| | | | This will be useful in future commits
* locale.c: Change static fcn nameKarl Williamson2017-11-084-4/+6
| | | | The new name more closely reflects what it does
* locale.c: Refactor static fcn to save workKarl Williamson2017-11-084-29/+39
| | | | | | | | | | | | | | | 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
* locale.c: Create extended internal Perl_langinfo()Karl Williamson2017-11-084-1/+35
| | | | | | | | 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
* locale.c: Rmv redundant fcn callKarl Williamson2017-11-081-2/+0
| | | | | This function is called as part of the call made in the line before. No need to do it twice.
* locale.c: White-space, comment, rearrange some #elseKarl Williamson2017-11-081-260/+452
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge branch 'BO' into bleadTodd Rinaldo2017-11-086-268/+501
|\ | | | | | | | | | | | | Make it simpler to divine if modules are there because of loading B/O or because the actual program used them. NPD
| * ext/B/t/strict.t: Assure B.pm and O.pm pass strict and warnings checks.Todd Rinaldo2017-11-082-0/+31
| | | | | | | | | | We need to test these in unit tests since they do not load these modules to prevent pollution of the stash in compilers.
| * Fix warnings (used once) for O.pmTodd Rinaldo2017-11-081-3/+6
| |
| * Fix warnings (used once) for B.pmTodd Rinaldo2017-11-081-5/+7
| |
| * Remove unnecessary module loads from B and OTodd Rinaldo2017-11-084-260/+457
|/ | | | | | | | | | 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.
* Simplify travis.yml config for Continuous IntegrationNicolas R2017-11-081-8/+13
| | | | | | | The goal is to have a quick smoke on travis smokers to plug in short future CI for any new commits/PR. NPD
* restore error message for unterminated stringsLukas Mai2017-11-082-7/+18
| | | | | | | | | | | 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
* disable t/porting/authors.t for distro packagingNicolas R2017-11-081-0/+1
| | | | NPD
* disable t/porting/podcheck.t for distro packagingNicolas R2017-11-081-0/+4
| | | | NPD
* Allow custom PL_strtab hash in perl_construct.Nicolas R2017-11-081-9/+14
| | | | | | | | 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.
* PERL_STRLEN_ROUNDUP: parenthesize macro parameterLukas Mai2017-11-081-2/+3
| | | | | | | Also: - factor out common expression - remove redundant double parens - add spaces to expression
* toke.c: Fix wrong use of memrchrKarl Williamson2017-11-071-1/+1
| | | | | | | | 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.
* Blead breaks DBD::SQLiteKarl Williamson2017-11-071-3/+2
| | | | | | | | | | | 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.
* Two fix-ups following b59bf0b288.Craig A. Berry2017-11-061-2/+1
| | | | | | In one case, memEQs was missing a length parameter, and in the other, two opening braces had been removed but only one closing brace.
* toke.c: use my_memrchr helper for portability [round 2]Nicolas R2017-11-061-2/+2
| | | | compilation broken on darwin using clang
* Use my_memrchr helper for portabilityNicolas R2017-11-061-1/+1
| | | | | | | | Recent commit '8725053bce' breaks darwin compilation. We should use my_memrchr helper to avoid portability issues, instead of calling directly memrchr.
* Merge branch 'convert strchr to memchr' into bleadKarl Williamson2017-11-0612-96/+134
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * toke.c: Convert some strchr to memchrKarl Williamson2017-11-061-14/+20
| | | | | | | | | | This allows things to work properly in the face of embedded NULs. See the branch merge message for more information.
| * toke.c use memBEGINs with prev commitKarl Williamson2017-11-061-2/+4
| |
| * toke.c: Add limit parameter to 3 static functionsKarl Williamson2017-11-064-37/+42
| | | | | | | | | | This will make it possible to fix to handle embedded NULs in the next commits.
| * regcomp.c: Convert some strchr to memchrKarl Williamson2017-11-061-4/+6
| | | | | | | | | | This allows things to work properly in the face of embedded NULs. See the branch merge message for more information.
| * perl.c: Use memchr instead of strchrKarl Williamson2017-11-061-2/+3
| | | | | | | | | | This allows things to work properly in the face of embedded NULs. See the branch merge message for more information.
| * op.c: Use memchr,memrchr instead of strchr,strrchrKarl Williamson2017-11-061-3/+5
| | | | | | | | | | This allows things to work properly in the face of embedded NULs. See the branch merge message for more information.
| * mg.c: Use memchr instead of strchrKarl Williamson2017-11-061-2/+3
| | | | | | | | | | This allows things to work properly in the face of embedded NULs. See the branch merge message for more information.
| * doio.c: Change strchr to memchrKarl Williamson2017-11-061-2/+2
| | | | | | | | | | This allows things to work properly in the face of embedded NULs. See the branch merge message for more information.
| * pp_sys.c; Use memchr instead of strchrKarl Williamson2017-11-061-1/+2
| | | | | | | | | | This allows things to work properly in the face of embedded NULs. See the branch merge message for more information.
| * utf8.c: Use memchr instead of strchrKarl Williamson2017-11-061-1/+1
| | | | | | | | | | This allows things to work properly in the face of embedded NULs. See the branch merge message for more information.
| * dquote.c: Use memchr() instead of strchr()Karl Williamson2017-11-066-28/+46
|/ | | | | | | 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.
* locale.c: Tighten what is considered a LC variableKarl Williamson2017-11-062-4/+14
| | | | | | | 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.
* locale.c: White space, extra braces onlyKarl Williamson2017-11-061-6/+8
| | | | | Align vertically, and indent blocks to standard. It adds braces for clarity.
* Merge branch for new string comparison macros into bleadKarl Williamson2017-11-0630-212/+259
|\ | | | | | | | | | | | | | | 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
| * handy.h: Add commentsKarl Williamson2017-11-061-0/+45
| | | | | | | | | | This adds a description of the naming conventions to be used for any new string comparison macros.
| * Make new macros privateKarl Williamson2017-11-061-2/+6
| | | | | | | | Until we decide these weren't a bad idea
| * ext/attributes/attributes.xs is PERL_EXTKarl Williamson2017-11-061-0/+2
| |
| * handy.h: Make uniform the defns of strFOO, memFOOKarl Williamson2017-11-061-6/+6
| | | | | | | | For consistency
| * Remove _memEQs, _memNEsKarl Williamson2017-11-061-6/+0
| | | | | | | | All uses of these private macros have been replaced by other calls.