Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions handy.h
Original file line number Diff line number Diff line change
Expand Up @@ -1623,23 +1623,23 @@ END_EXTERN_C
=for apidoc Cm|U32|CC_mask_|U8 c|U8 classnum

This translates C<classnum> into a bit pattern to use in conjunction with
entries in C<PL_charclass[]>, and operations such is C<L</Perl_isCC_by_bit>>.
entries in C<PL_charclass[]>, and operations such is C<L</isCC_by_bit_pl_>>.
C<classnum> is one of the classes defined in F<handy.h> for this purpose.

=for apidoc Cm|bool|Perl_isCC_by_bit|U8 c|U32 bit_pattern
=for apidoc Cm|bool|isCC_by_bit_pl_|U8 c|U32 bit_pattern

Returns a boolean as to whether or not the character C<c> in the Latin1 range
is a member of the class(es) given by C<bit_pattern>, as formed by
C<L</CC_mask_>>.

=cut
*/
# define Perl_isCC_by_bit(c, bit_pattern) \
# define isCC_by_bit_pl_(c, bit_pattern) \
(FITS_IN_8_BITS(c) && (PL_charclass[(U8) (c)] & (bit_pattern)))

/* For internal core Perl use only: the base macro for defining macros like
* isALPHA */
# define generic_isCC_(c, classnum) Perl_isCC_by_bit(c, CC_mask_(classnum))
# define generic_isCC_(c, classnum) isCC_by_bit_pl_(c, CC_mask_(classnum))

/* The mask for the _A versions of the macros; it just adds in the bit for
* ASCII. */
Expand Down
26 changes: 13 additions & 13 deletions numeric.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ Perl_grok_bin_hex(pTHX_ const char * const start,
/* An acceptable underscore must not be trailing, which also implies there
* must be a legal digit after it */
#define underscore_valid(s, e, lookup_bit) \
(s < e - 1 && Perl_isCC_by_bit(s[1], lookup_bit))
(s < e - 1 && isCC_by_bit_pl_(s[1], lookup_bit))


UV
Expand Down Expand Up @@ -444,48 +444,48 @@ Other compromises kick in only when the result is within a digit of overflowing.
goto redo_switch;
}

if (! LIKELY(Perl_isCC_by_bit(*s, lookup_bit))) break;
if (! LIKELY(isCC_by_bit_pl_(*s, lookup_bit))) break;
accumulated = XDIGIT_VALUE(*s);
s++;
goto loop;

case 8:
if (! LIKELY(Perl_isCC_by_bit(*s, lookup_bit))) break;
if (! LIKELY(isCC_by_bit_pl_(*s, lookup_bit))) break;
accumulated = XDIGIT_VALUE(*s);
s++;
/* FALLTHROUGH */
case 7:
if (! LIKELY(Perl_isCC_by_bit(*s, lookup_bit))) break;
if (! LIKELY(isCC_by_bit_pl_(*s, lookup_bit))) break;
accumulated = MULTIPLY_BY_BASE(accumulated) + XDIGIT_VALUE(*s);
s++;
/* FALLTHROUGH */
case 6:
if (! LIKELY(Perl_isCC_by_bit(*s, lookup_bit))) break;
if (! LIKELY(isCC_by_bit_pl_(*s, lookup_bit))) break;
accumulated = MULTIPLY_BY_BASE(accumulated) + XDIGIT_VALUE(*s);
s++;
/* FALLTHROUGH */
case 5:
if (! LIKELY(Perl_isCC_by_bit(*s, lookup_bit))) break;
if (! LIKELY(isCC_by_bit_pl_(*s, lookup_bit))) break;
accumulated = MULTIPLY_BY_BASE(accumulated) + XDIGIT_VALUE(*s);
s++;
/* FALLTHROUGH */
case 4:
if (! LIKELY(Perl_isCC_by_bit(*s, lookup_bit))) break;
if (! LIKELY(isCC_by_bit_pl_(*s, lookup_bit))) break;
accumulated = MULTIPLY_BY_BASE(accumulated) + XDIGIT_VALUE(*s);
s++;
/* FALLTHROUGH */
case 3:
if (! LIKELY(Perl_isCC_by_bit(*s, lookup_bit))) break;
if (! LIKELY(isCC_by_bit_pl_(*s, lookup_bit))) break;
accumulated = MULTIPLY_BY_BASE(accumulated) + XDIGIT_VALUE(*s);
s++;
/* FALLTHROUGH */
case 2:
if (! LIKELY(Perl_isCC_by_bit(*s, lookup_bit))) break;
if (! LIKELY(isCC_by_bit_pl_(*s, lookup_bit))) break;
accumulated = MULTIPLY_BY_BASE(accumulated) + XDIGIT_VALUE(*s);
s++;
/* FALLTHROUGH */
case 1:
if (! LIKELY(Perl_isCC_by_bit(*s, lookup_bit))) break;
if (! LIKELY(isCC_by_bit_pl_(*s, lookup_bit))) break;
accumulated = MULTIPLY_BY_BASE(accumulated) + XDIGIT_VALUE(*s);
s++;
/* FALLTHROUGH */
Expand Down Expand Up @@ -540,7 +540,7 @@ Other compromises kick in only when the result is within a digit of overflowing.
valid_digit_or_underscore_bits = (lookup_bit|CC_mask_(CC_UNDERSCORE_));

/* Loop through the characters */
while (s < e && Perl_isCC_by_bit(*s, valid_digit_or_underscore_bits)) {
while (s < e && isCC_by_bit_pl_(*s, valid_digit_or_underscore_bits)) {

/* Handle non-trailing underscores when those are accepted */
if (UNLIKELY(*s == '_')) {
Expand Down Expand Up @@ -735,7 +735,7 @@ Other compromises kick in only when the result is within a digit of overflowing.

/* Find end of input, seeing if need to round */
s++;
while (s < e && Perl_isCC_by_bit(*s, valid_digit_or_underscore_bits)) {
while (s < e && isCC_by_bit_pl_(*s, valid_digit_or_underscore_bits)) {
if ( UNLIKELY(*s == '_')
&& ( ! allow_underscores
|| ! underscore_valid(s, e, lookup_bit)))
Expand Down Expand Up @@ -774,7 +774,7 @@ Other compromises kick in only when the result is within a digit of overflowing.
* So, find the end of the string */
const char * s1 = s; /* Save our place */
s++;
while (s < e && Perl_isCC_by_bit(*s, valid_digit_or_underscore_bits)) {
while (s < e && isCC_by_bit_pl_(*s, valid_digit_or_underscore_bits)) {
if ( UNLIKELY(*s == '_')
&& ( ! allow_underscores
|| ! underscore_valid(s, e, lookup_bit)))
Expand Down
16 changes: 8 additions & 8 deletions op.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ typedef PERL_BITFIELD16 Optype;
U8 op_private;
#endif

#define o1_ PERL_UNIQUE_NAME(o)
#define type1_ PERL_UNIQUE_NAME(type)
#define OpTYPE_set(o,type) \
STMT_START { \
OP *o1_ = (OP *)o; \
OPCODE type1_ = type; \
o1_->op_type = type1_; \
o1_->op_ppaddr = PL_ppaddr[type1_]; \
#define o1_pl_ PERL_UNIQUE_NAME(o)
#define type1_pl_ PERL_UNIQUE_NAME(type)
#define OpTYPE_set(o,type) \
STMT_START { \
OP *o1_pl_ = (OP *)o; \
OPCODE type1_pl_ = type; \
o1_pl_->op_type = type1_pl_; \
o1_pl_->op_ppaddr = PL_ppaddr[type1_pl_]; \
} STMT_END

/* If op_type:9 is changed to :10, also change cx_pusheval()
Expand Down
2 changes: 0 additions & 2 deletions regen/embed.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3404,7 +3404,6 @@ BEGIN
msbit_pos_uintmax_
NOT_IN_NUMERIC_STANDARD_
NOT_IN_NUMERIC_UNDERLYING_
o1_
OFFUNISKIP_helper_
__PATCHLEVEL_H_INCLUDED__
PLATFORM_SYS_INIT_
Expand All @@ -3417,7 +3416,6 @@ BEGIN
SBOX32_CASE_
SVf_
TOO_LATE_FOR_
type1_
UNISKIP_BY_MSB_
UTF8_IS_SUPER_NO_CHECK_
UTF8_NO_CONFIDENCE_IN_CURLEN_
Expand Down
Loading