summaryrefslogtreecommitdiff
path: root/handy.h
Commit message (Collapse)AuthorAgeFilesLines
* perlapi: Fix function prototypesKarl Williamson2020-09-141-4/+4
| | | | These were wrong, and Devel::PPPort found the mistakes.
* perlapi: Fix typo.Karl Williamson2020-09-141-1/+1
|
* Fix input type on isFOO macrosKarl Williamson2020-09-141-114/+114
| | | | These macros accept any UV as input, but not a signed number
* gv_fetchpvn and gv_fetchpvn_flags are identicalKarl Williamson2020-09-141-2/+1
|
* Use macro instead of its expansionKarl Williamson2020-09-091-1/+1
| | | | | We already have a macro that expands to what this code does; it's clearer to use it.
* perlapi: Fix poor wording in MUTABLE_PTRKarl Williamson2020-09-071-2/+2
|
* perlapi: Display PERL_VERSION_xy betterKarl Williamson2020-09-051-10/+5
| | | | Now that we have the tools to show these as a whole list, do so
* Document MUTABLE_PTR, MUTABLE_AV, ...Karl Williamson2020-09-051-7/+23
|
* perlapi: Don't show a return type for __ASSERT_Karl Williamson2020-09-051-1/+1
|
* Change formal parameter name of gv_fetchpv*Karl Williamson2020-09-051-4/+5
| | | | This is a flags parameter, not a particular single flag
* perlapi: Improve display of isFOOKarl Williamson2020-09-051-254/+198
| | | | The character classification macro variants are now presented as a list
* perlapi: Display toFOO betterKarl Williamson2020-09-041-9/+9
| | | | | The character case change macro variants are now displayed all together
* Reorganize perlapiKarl Williamson2020-09-041-10/+40
| | | | | This uses a new organization of sections that I came up with. I asked for comments on p5p, but there were none.
* Change some =head1 to apidoc_section linesKarl Williamson2020-09-041-2/+2
| | | | | apidoc_section is slightly favored over head1, as it is known only to autodoc, and can't be confused with real pod.
* Fixup handy.h to use PERL_VERSION macro☢ ℕicolas ℝ2020-08-021-10/+10
| | | | | | | | | | | handy.h was recently updated in 4a1bbd3d but this is not using the accurate definitions of the new semantic versions introduced as part of #18020 They are: - PERL_VERSION_MAJOR - PERL_VERSION_MINOR - PERL_VERSION_PATCH
* More preparation for 7.0 in versioningKarl Williamson2020-08-021-15/+75
| | | | | | | | | | | | This modifies the macros introduced in 9b6e95106e18e4fd33678d0df9b2293fd4f8ab9c that allow one to determine how the version of the perl currently being compiled compares to an arbitrary one. The modification is based on changes in the plan, including renaming of variables. This also introduces the use of '*' for the subversion (or micro as it is now called) to make conversion from the soon-to-be deprecated PERL_VERSION macro more rote, with less thinking involved.
* Use UINTMAX_C() in nBIT_MASK() definitionDagfinn Ilmari Mannsåker2020-07-201-5/+1
| | | | | | We already have a macro for constants of the largest available type, use that instead of HAS_LONG_LONG, which is (erroneously?) not defined under MSVC.
* handy.h: Add commentsKarl Williamson2020-07-171-1/+4
|
* handy.h: Create nBIT_UMAX() macroKarl Williamson2020-07-171-0/+3
| | | | This encapsulates a common paradigm
* handy.h: Create nBIT_MASK(n) macroKarl Williamson2020-07-171-0/+7
| | | | | This encapsulates a common paradigm, making sure that it is done correctly for the platform's size.
* handy.h: Update commentKarl Williamson2020-07-171-1/+1
|
* MUTABLE_PTR() Rmv non-standard syntaxKarl Williamson2020-07-171-1/+1
| | | | | Variables in C are beginning with an underscore are reserved for use by the C implementation. Change this non-conformant usage.
* Add PERL_VERSION_GE macro, and kinKarl Williamson2020-07-171-1/+39
| | | | | This moves things from vutil.h, and into handy.h; this is required for v7
* Fix a bunch of repeated-word typosDagfinn Ilmari Mannsåker2020-05-221-1/+1
| | | | | Mostly in comments and docs, but some in diagnostic messages and one case of 'or die die'.
* Move cntrl_to_mnemonic() to util.c from regcomp.cKarl Williamson2020-01-231-2/+5
| | | | | This is in preparation for it being used elsewhere, to reduce duplication of code.
* l1_char_class_tab.h: Add bits for binary, octal digitsKarl Williamson2020-01-131-1/+3
| | | | | | The motivation behind these extra bits is to allow three functions that deal with, respectively, binary, octal, and hex data to use the same paradigm, and hence be collapsible into a single function.
* handy.h: Convert XDIGIT_VALUE to branchlessKarl Williamson2020-01-131-11/+16
| | | | | | | | | | This removes a branch and an array lookup in the XDIGIT_VALUE() macro. It adds some shifts, masks, and additions instead, though replacing a mask and addition in the old way. A somewhat more complicated version could be made for EBCDIC, but I'm not bothering to do that, using an array lookup to convert the salient value to ASCII, so on EBCDIC there isn't an array lookup removal.
* Add memCHRs() macro and use itKarl Williamson2019-12-181-0/+9
| | | | | | | This replaces strchr("list", c) calls throughout the core. They don't work properly when 'c' is a NUL, returning the position of the terminating NUL in "list" instead of failure. This could lead to segfaults or even security issues.
* handy.h: Fix typo in little-used macroKarl Williamson2019-12-071-1/+1
| | | | | | This only affected an EBCDIC build where no other tools are around. This is no longer really used. It was used to bootstrap EBCDIC when first porting to it (after the 5.8 series).
* Convert issue links from rt.perl.org to GitHubDan Book2019-11-261-1/+1
|
* Add missing back compat macrosKarl Williamson2019-11-241-1/+4
| | | | These are needed only to allow some modules to stay updated with blead.
* handy.h: Change references to swashesKarl Williamson2019-11-061-54/+55
| | | | As these are no longer used.
* Rmv more deprecated characlassify/case change macrosKarl Williamson2019-10-311-9/+8
| | | | These were missed by 059703b088f44d5665f67fba0b9d80cad89085fd.
* Consolidate uses of PERL_SMALL_MACRO_BUFFERKarl Williamson2019-10-311-1/+2
| | | | | | | At the moment the _ASSERT_() is the one which has been showing large expansions. Change so it doesn't do anything if PERL_SMALL_MACRO_BUFFER is defined. That means various other calls that use PERL_SMALL_MACRO_BUFFER can be simplified to not use it.
* Fix up apidoc entries for isFOO_utf8()Karl Williamson2019-10-261-17/+17
| | | | | These were recently changed to take a second parameter, but the docs did not change to correspond.
* The VC6 Chainsaw MassacreSteve Hay2019-10-171-2/+1
| | | | | Remove MS Visual C++ 6.0 support as agreed in the thread starting here: https://www.nntp.perl.org/group/perl.perl5.porters/2019/07/msg255625.html
* Change bug URL from http://rt.perl.org to https://rt.perl.orgMax Maischein2019-10-111-1/+1
| | | | | | | | | | | | | This updates the bug tracker URL from http://rt.perl.org to https://rt.perl.org. There is a place in the code, in corelist.pl, that is sensitive to the URL of the bug tracker. This now understands both versions of the bug tracker URL. Ideally, this will be consolidated once the dust settles. This patch also updates ExtUtils::CBuilder, Safe, threads and threads::shared to point to the new bug tracker URL.
* Don't test for 16-bit inputs in inRANGE()Karl Williamson2019-10-101-1/+0
| | | | | | | | | | | This macro has been expanding to overflow some assertion strings on Windows and HP. This commit omits handling one unlikely scenario, namely that the input is a short, 16-bits. And that is enough to get it to compile on Windows. HP isn't smoked on branches, so I don't know if this will fix it. More discussion may be needed, but this is all I have time for at the moment.
* l1_char_class_tab.h: Remove some special EBCDIC casesKarl Williamson2019-10-091-5/+2
| | | | These are no longer needed.
* Fix pod entry for toLOWER_utf8Karl Williamson2019-10-091-1/+1
| | | | It was missing a parameter
* Remove deprecated character classification/case changing macrosKarl Williamson2019-09-291-232/+151
| | | | | | | | | | | | | | It has been deprecated since 5.26 to use various macros that deal with UTF-8 inputs but don't have a parameter indicating the maximum length beyond which we should not look. This commit changes all such macros, as threatened in existing documentation and warning messages, to have an extra parameter giving the length. This was originally scheduled to happen in 5.30, but was delayed because it broke some CPAN modules, and there wasn't really a good way around it. But now that Devel::PPPort 3.54 is out, ppport.h has new facilities for getting modules making these changes to work with older Perl releases.
* APItest: Remove use of macros about to be removedKarl Williamson2019-09-291-2/+3
| | | | | The next commit removes some macros that this uses. They have been deprecated, and the uses here were to test those deprecations.
* handy.h: Avoid compiler warnings for withinCOUNT()Karl Williamson2019-09-251-3/+6
| | | | | | | | | | | If a parameter to this function is unsigned, gcc, at least, generates a comparison-always-true warning for the asserts on the parameters. Silence these by casting to an NV. Any extra machine instructions will be gone from non-DEBUGGING builds. The value in an NV won't necessarily be exact, but all the assertions care about is the sign, which is guaranteed by C11 standard 6.3.1.4 item 2. This technique was the idea of Tomasz Konojacki.
* handy.h: Rmv duplicated assert in inRANGE()Karl Williamson2019-09-251-1/+1
| | | | This assertion is done in the macro that is called to do the real work.
* handy.h Fix withinCOUNT() for > 32 bit operandsKarl Williamson2019-09-251-2/+2
| | | | | It needs to cast to unsigned in all circumstances; prior to this commit it failed to do so for oprands wider than 32 bits
* Generalize inRANGE()Karl Williamson2019-09-141-19/+6
| | | | | | I figured out a way to make this work generally. I've also tested this vs what some modern compilers do under -O2. It seems this macro is slightly better.
* Add withinCOUNT() macro and change inRANGE to use itKarl Williamson2019-09-141-2/+9
| | | | | This uses just one conditional to see if a value is between low and (low + n).
* Note that STR_WITH_LEN() is unorthodoxKarl Williamson2019-09-021-7/+15
| | | | | Now that we have the 'u' flag for macros, this one returns a pair of values, so should be marked as such.
* Change pod for macros that require "literal strings"Karl Williamson2019-09-021-18/+18
| | | | | Now that Devel::PPPort has the ability to handle these, we can loosen the syntax for clarity.
* Document WIDEST_UTYPEKarl Williamson2019-09-021-1/+16
|