@@ -595,7 +595,7 @@ S_pat_upgrade_to_utf8(pTHX_ RExC_state_t * const pRExC_state,
595
595
*plen_p = d - dst;
596
596
*pat_p = (char*) dst;
597
597
SAVEFREEPV(*pat_p);
598
- RExC_orig_utf8 = RExC_utf8 = 1 ;
598
+ RExC_orig_utf8 = RExC_utf8 = true ;
599
599
}
600
600
601
601
@@ -1602,7 +1602,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
1602
1602
}
1603
1603
1604
1604
/* ignore the utf8ness if the pattern is 0 length */
1605
- RExC_utf8 = RExC_orig_utf8 = (plen == 0 || IN_BYTES) ? 0 : SvUTF8(pat);
1605
+ RExC_utf8 = RExC_orig_utf8 = (plen == 0 || IN_BYTES) ? false : cBOOL( SvUTF8(pat) );
1606
1606
RExC_strict = cBOOL(pm_flags & RXf_PMf_STRICT);
1607
1607
1608
1608
@@ -1637,7 +1637,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
1637
1637
1638
1638
if ( old_re
1639
1639
&& !recompile
1640
- && cBOOL(RX_UTF8(old_re)) == cBOOL( RExC_utf8)
1640
+ && cBOOL(RX_UTF8(old_re)) == RExC_utf8
1641
1641
&& ( RX_COMPFLAGS(old_re) == ( orig_rx_flags & RXf_PMf_FLAGCOPYMASK ) )
1642
1642
&& RX_PRELEN(old_re) == plen
1643
1643
&& memEQ(RX_PRECOMP(old_re), exp, plen)
@@ -1669,7 +1669,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
1669
1669
/* Set to use unicode semantics if the pattern is in utf8 and has the
1670
1670
* 'depends' charset specified, as it means unicode when utf8 */
1671
1671
set_regex_charset(&rx_flags, REGEX_UNICODE_CHARSET);
1672
- RExC_uni_semantics = 1 ;
1672
+ RExC_uni_semantics = true ;
1673
1673
}
1674
1674
1675
1675
RExC_pm_flags = pm_flags;
@@ -1688,14 +1688,14 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
1688
1688
}
1689
1689
assert(!pRExC_state->runtime_code_qr);
1690
1690
1691
- RExC_sawback = 0 ;
1691
+ RExC_sawback = false ;
1692
1692
1693
1693
RExC_seen = 0;
1694
1694
RExC_maxlen = 0;
1695
- RExC_in_lookaround = 0 ;
1695
+ RExC_in_lookaround = false ;
1696
1696
RExC_seen_zerolen = *exp == '^' ? -1 : 0;
1697
- RExC_recode_x_to_native = 0 ;
1698
- RExC_in_multi_char_class = 0 ;
1697
+ RExC_recode_x_to_native = false ;
1698
+ RExC_in_multi_char_class = false ;
1699
1699
1700
1700
RExC_start = RExC_copy_start_in_constructed = RExC_copy_start_in_input = RExC_precomp = exp;
1701
1701
RExC_precomp_end = RExC_end = exp + plen;
@@ -2910,7 +2910,7 @@ S_handle_named_backref(pTHX_ RExC_state_t *pRExC_state,
2910
2910
RExC_rxi->data->data[num]=(void*)sv_dat;
2911
2911
SvREFCNT_inc_simple_void_NN(sv_dat);
2912
2912
}
2913
- RExC_sawback = 1 ;
2913
+ RExC_sawback = true ;
2914
2914
ret = reg2node(pRExC_state,
2915
2915
((! FOLD)
2916
2916
? REFN
@@ -2945,7 +2945,7 @@ S_handle_named_backref(pTHX_ RExC_state_t *pRExC_state,
2945
2945
* If the construct is empty generates a NOTHING op and returns its
2946
2946
* regnode_offset, which the caller would then return to its caller.
2947
2947
*
2948
- * If the construct is not empty increments RExC_in_lookaround, and turns
2948
+ * If the construct is not empty sets RExC_in_lookaround, and turns
2949
2949
* on any flags provided in RExC_seen, and then returns 0 to signify
2950
2950
* that parsing should continue.
2951
2951
*
@@ -2976,7 +2976,7 @@ S_reg_la_NOTHING(pTHX_ RExC_state_t *pRExC_state, U32 flags,
2976
2976
}
2977
2977
2978
2978
RExC_seen |= flags;
2979
- RExC_in_lookaround++ ;
2979
+ RExC_in_lookaround = true ;
2980
2980
return 0; /* keep parsing! */
2981
2981
}
2982
2982
@@ -2993,7 +2993,7 @@ S_reg_la_NOTHING(pTHX_ RExC_state_t *pRExC_state, U32 flags,
2993
2993
* If the construct is empty generates an OPFAIL op and returns its
2994
2994
* regnode_offset which the caller should then return to its caller.
2995
2995
*
2996
- * If the construct is not empty increments RExC_in_lookaround, and also
2996
+ * If the construct is not empty sets RExC_in_lookaround, and also
2997
2997
* increments RExC_seen_zerolen, and turns on the flags provided in
2998
2998
* RExC_seen, and then returns 0 to signify that parsing should continue.
2999
2999
*
@@ -3026,7 +3026,7 @@ S_reg_la_OPFAIL(pTHX_ RExC_state_t *pRExC_state, U32 flags,
3026
3026
* does not match ever. */
3027
3027
RExC_seen_zerolen++;
3028
3028
RExC_seen |= flags;
3029
- RExC_in_lookaround++ ;
3029
+ RExC_in_lookaround = true ;
3030
3030
return 0; /* keep parsing! */
3031
3031
}
3032
3032
@@ -3105,7 +3105,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp, U32 depth)
3105
3105
I32 after_freeze = 0;
3106
3106
I32 num; /* numeric backreferences */
3107
3107
SV * max_open; /* Max number of unclosed parens */
3108
- I32 was_in_lookaround = RExC_in_lookaround;
3108
+ bool was_in_lookaround = RExC_in_lookaround;
3109
3109
I32 fake_eval = 0; /* matches paren */
3110
3110
3111
3111
/* The difference between the following variables can be seen with *
@@ -3427,7 +3427,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp, U32 depth)
3427
3427
}
3428
3428
3429
3429
RExC_seen_zerolen++;
3430
- RExC_in_lookaround++ ;
3430
+ RExC_in_lookaround = true ;
3431
3431
RExC_seen |= seen_flag_set;
3432
3432
3433
3433
RExC_parse_set(start_arg);
@@ -5453,7 +5453,7 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state,
5453
5453
5454
5454
/* The values are Unicode, and therefore have to be converted to native
5455
5455
* on a non-Unicode (meaning non-ASCII) platform. */
5456
- SET_recode_x_to_native(1 );
5456
+ SET_recode_x_to_native(true );
5457
5457
}
5458
5458
5459
5459
/* Here, we have the string the name evaluates to, ready to be parsed,
@@ -5479,7 +5479,7 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state,
5479
5479
RExC_start = save_start;
5480
5480
RExC_parse_set(endbrace);
5481
5481
RExC_end = orig_end;
5482
- SET_recode_x_to_native(0 );
5482
+ SET_recode_x_to_native(true );
5483
5483
5484
5484
SvREFCNT_dec_NN(substitute_parse);
5485
5485
@@ -5901,7 +5901,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
5901
5901
RExC_seen_d_op = true;
5902
5902
}
5903
5903
else if (op == BOUNDL) {
5904
- RExC_contains_locale = 1 ;
5904
+ RExC_contains_locale = true ;
5905
5905
}
5906
5906
5907
5907
if (invert) {
@@ -6203,7 +6203,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
6203
6203
REQUIRE_PARENS_PASS;
6204
6204
}
6205
6205
}
6206
- RExC_sawback = 1 ;
6206
+ RExC_sawback = true ;
6207
6207
ret = reg2node(pRExC_state,
6208
6208
((! FOLD)
6209
6209
? REF
@@ -6770,7 +6770,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
6770
6770
* existing node, so can start a new node with this one */
6771
6771
if (! len) {
6772
6772
node_type = EXACTFL;
6773
- RExC_contains_locale = 1 ;
6773
+ RExC_contains_locale = true ;
6774
6774
}
6775
6775
else if (node_type == EXACT) {
6776
6776
p = oldp;
@@ -10822,7 +10822,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
10822
10822
RExC_parse_set( RExC_start );
10823
10823
RExC_copy_start_in_constructed = RExC_start + constructed_prefix_len;
10824
10824
RExC_end = RExC_parse + len;
10825
- RExC_in_multi_char_class = 1 ;
10825
+ RExC_in_multi_char_class = true ;
10826
10826
10827
10827
ret = reg(pRExC_state, 1, ®_flags, depth+1);
10828
10828
@@ -10832,7 +10832,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
10832
10832
RExC_parse_set(save_parse);
10833
10833
RExC_start = RExC_copy_start_in_constructed = RExC_copy_start_in_input = save_start;
10834
10834
RExC_end = save_end;
10835
- RExC_in_multi_char_class = 0 ;
10835
+ RExC_in_multi_char_class = false ;
10836
10836
SvREFCNT_dec_NN(multi_char_matches);
10837
10837
SvREFCNT_dec(properties);
10838
10838
SvREFCNT_dec(cp_list);
@@ -11245,7 +11245,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
11245
11245
}
11246
11246
11247
11247
if (anyof_flags & ANYOF_LOCALE_FLAGS) {
11248
- RExC_contains_locale = 1 ;
11248
+ RExC_contains_locale = true ;
11249
11249
}
11250
11250
11251
11251
if (optimizable) {
0 commit comments