Skip to content

Commit

Permalink
Small formatting tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
NWilson committed Dec 2, 2024
1 parent b62c07c commit 62da3b1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
4 changes: 0 additions & 4 deletions src/pcre2_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -6276,9 +6276,7 @@ for (;; pptr++)
/* Don't unconditionally request all the space we need - we may
already have asked for more during processing of the ECLASS. */
if (required_len > (*lengthptr - previous_length))
{
*lengthptr = previous_length + required_len;
}

/* The code we write out here won't be ignored, even during the
(lengthptr != NULL) phase, because if there's a following quantifier
Expand Down Expand Up @@ -6339,9 +6337,7 @@ for (;; pptr++)
if (lengthptr != NULL)
{
if (required_len > (*lengthptr - previous_length))
{
*lengthptr = previous_length + required_len;
}
}
else
{
Expand Down
16 changes: 2 additions & 14 deletions src/pcre2_printint.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,20 +656,6 @@ for(;;)

switch(*code)
{
/* ========================================================================== */
/* These cases are never obeyed. This is a fudge that causes a compile-
time error if the vectors OP_names or OP_lengths, which are indexed
by opcode, are not the correct length. It seems to be the only way to do
such a check at compile time, as the sizeof() operator does not work in
the C preprocessor. */

case OP_TABLE_LENGTH:
case OP_TABLE_LENGTH +
((sizeof(OP_names)/sizeof(const char *) == OP_TABLE_LENGTH) &&
(sizeof(OP_lengths) == OP_TABLE_LENGTH)):
return;
/* ========================================================================== */

case OP_END:
fprintf(f, " %s\n", OP_names[*code]);
fprintf(f, "------------------------------------------------------------------\n");
Expand Down Expand Up @@ -997,6 +983,8 @@ for(;;)
fprintf(f, "]\n");
ccode += 32 / sizeof(PCRE2_UCHAR);
}
else
fprintf(f, " no bitmap\n");
while (ccode < code + extra)
{
if (print_lengths)
Expand Down
5 changes: 5 additions & 0 deletions testdata/testoutput11-32
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ No match
------------------------------------------------------------------
Bra
eclass[
no bitmap
xclass: [\x{80000000}-\x{8000000f}]
xclass: [^\x{80000002}]
AND
Expand All @@ -922,6 +923,7 @@ No match
------------------------------------------------------------------
Bra
eclass[
no bitmap
xclass: [\x{80000000}-\x{8000000f}]
xclass: [^\x{80000002}]
AND
Expand All @@ -947,6 +949,7 @@ No match
------------------------------------------------------------------
Bra
eclass[
no bitmap
xclass: [\x{80000000}-\x{8000000f}]
xclass: [\x{8fffffff}]
OR
Expand All @@ -968,6 +971,7 @@ No match
------------------------------------------------------------------
Bra
eclass[
no bitmap
xclass: [\x{80000000}-\x{8000000f}]
xclass: [^\x{80000002}]
AND
Expand All @@ -987,6 +991,7 @@ No match
------------------------------------------------------------------
Bra
eclass[
no bitmap
xclass: [\x{80000000}-\x{8000000f}]
xclass: [^\x{80000002}]
AND
Expand Down
3 changes: 3 additions & 0 deletions testdata/testoutput5
Original file line number Diff line number Diff line change
Expand Up @@ -6876,6 +6876,7 @@ No match
Bra
Bra
eclass[
no bitmap
xclass: [^\p{Nd}]
xclass: [\p{Nd}]
AND
Expand Down Expand Up @@ -6981,6 +6982,7 @@ No match
------------------------------------------------------------------
Bra
eclass[
no bitmap
xclass: [\p{L}]
xclass: [^\p{L}]
AND
Expand All @@ -7000,6 +7002,7 @@ No match
------------------------------------------------------------------
Bra
eclass[
no bitmap
xclass: [\p{L}]
xclass: [^\p{L}]
AND
Expand Down

0 comments on commit 62da3b1

Please sign in to comment.