Skip to content

Commit eeada60

Browse files
authored
Merge pull request #201 from Sebanisu/main
-Wold-style-cast GCC 10.2
2 parents 4ee9add + af4d3c2 commit eeada60

File tree

5 files changed

+91
-91
lines changed

5 files changed

+91
-91
lines changed

include/ctre/actions/hexdec.inc.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ template <auto V, size_t N, typename... Ts, typename Parameters> static constexp
2020
template <auto V, size_t N, typename... Ts, typename Parameters> static constexpr auto apply(pcre::finish_hexdec, ctll::term<V>, pcre_context<ctll::list<number<N>, Ts...>, Parameters> subject) {
2121
constexpr size_t max_char = std::numeric_limits<char>::max();
2222
if constexpr (N <= max_char) {
23-
return pcre_context{ctll::push_front(character<(char)N>(), ctll::list<Ts...>()), subject.parameters};
23+
return pcre_context{ctll::push_front(character<char{N}>(), ctll::list<Ts...>()), subject.parameters};
2424
} else {
25-
return pcre_context{ctll::push_front(character<(char32_t)N>(), ctll::list<Ts...>()), subject.parameters};
25+
return pcre_context{ctll::push_front(character<char32_t{N}>(), ctll::list<Ts...>()), subject.parameters};
2626
}
2727
}
2828

include/ctre/atoms_characters.hpp

+26-26
Original file line numberDiff line numberDiff line change
@@ -54,35 +54,35 @@ using word_chars = set<char_range<'A','Z'>, char_range<'a','z'>, char_range<'0',
5454
using space_chars = enumeration<' ', '\t', '\n', '\v', '\f', '\r'>;
5555

5656
using vertical_space_chars = enumeration<
57-
(char)0x000A, // Linefeed (LF)
58-
(char)0x000B, // Vertical tab (VT)
59-
(char)0x000C, // Form feed (FF)
60-
(char)0x000D, // Carriage return (CR)
61-
(char32_t)0x0085, // Next line (NEL)
62-
(char32_t)0x2028, // Line separator
63-
(char32_t)0x2029 // Paragraph separator
57+
char{0x000A}, // Linefeed (LF)
58+
char{0x000B}, // Vertical tab (VT)
59+
char{0x000C}, // Form feed (FF)
60+
char{0x000D}, // Carriage return (CR)
61+
char32_t{0x0085}, // Next line (NEL)
62+
char32_t{0x2028}, // Line separator
63+
char32_t{0x2029} // Paragraph separator
6464
>;
6565

6666
using horizontal_space_chars = enumeration<
67-
(char)0x0009, // Horizontal tab (HT)
68-
(char)0x0020, // Space
69-
(char32_t)0x00A0, // Non-break space
70-
(char32_t)0x1680, // Ogham space mark
71-
(char32_t)0x180E, // Mongolian vowel separator
72-
(char32_t)0x2000, // En quad
73-
(char32_t)0x2001, // Em quad
74-
(char32_t)0x2002, // En space
75-
(char32_t)0x2003, // Em space
76-
(char32_t)0x2004, // Three-per-em space
77-
(char32_t)0x2005, // Four-per-em space
78-
(char32_t)0x2006, // Six-per-em space
79-
(char32_t)0x2007, // Figure space
80-
(char32_t)0x2008, // Punctuation space
81-
(char32_t)0x2009, // Thin space
82-
(char32_t)0x200A, // Hair space
83-
(char32_t)0x202F, // Narrow no-break space
84-
(char32_t)0x205F, // Medium mathematical space
85-
(char32_t)0x3000 // Ideographic space
67+
char{0x0009}, // Horizontal tab (HT)
68+
char{0x0020}, // Space
69+
char32_t{0x00A0}, // Non-break space
70+
char32_t{0x1680}, // Ogham space mark
71+
char32_t{0x180E}, // Mongolian vowel separator
72+
char32_t{0x2000}, // En quad
73+
char32_t{0x2001}, // Em quad
74+
char32_t{0x2002}, // En space
75+
char32_t{0x2003}, // Em space
76+
char32_t{0x2004}, // Three-per-em space
77+
char32_t{0x2005}, // Four-per-em space
78+
char32_t{0x2006}, // Six-per-em space
79+
char32_t{0x2007}, // Figure space
80+
char32_t{0x2008}, // Punctuation space
81+
char32_t{0x2009}, // Thin space
82+
char32_t{0x200A}, // Hair space
83+
char32_t{0x202F}, // Narrow no-break space
84+
char32_t{0x205F}, // Medium mathematical space
85+
char32_t{0x3000} // Ideographic space
8686
>;
8787

8888
using alphanum_chars = set<char_range<'A','Z'>, char_range<'a','z'>, char_range<'0','9'> >;

single-header/ctre-unicode.hpp

+28-28
Original file line numberDiff line numberDiff line change
@@ -1429,35 +1429,35 @@ using word_chars = set<char_range<'A','Z'>, char_range<'a','z'>, char_range<'0',
14291429
using space_chars = enumeration<' ', '\t', '\n', '\v', '\f', '\r'>;
14301430

14311431
using vertical_space_chars = enumeration<
1432-
(char)0x000A, // Linefeed (LF)
1433-
(char)0x000B, // Vertical tab (VT)
1434-
(char)0x000C, // Form feed (FF)
1435-
(char)0x000D, // Carriage return (CR)
1436-
(char32_t)0x0085, // Next line (NEL)
1437-
(char32_t)0x2028, // Line separator
1438-
(char32_t)0x2029 // Paragraph separator
1432+
char{0x000A}, // Linefeed (LF)
1433+
char{0x000B}, // Vertical tab (VT)
1434+
char{0x000C}, // Form feed (FF)
1435+
char{0x000D}, // Carriage return (CR)
1436+
char32_t{0x0085}, // Next line (NEL)
1437+
char32_t{0x2028}, // Line separator
1438+
char32_t{0x2029} // Paragraph separator
14391439
>;
14401440

14411441
using horizontal_space_chars = enumeration<
1442-
(char)0x0009, // Horizontal tab (HT)
1443-
(char)0x0020, // Space
1444-
(char32_t)0x00A0, // Non-break space
1445-
(char32_t)0x1680, // Ogham space mark
1446-
(char32_t)0x180E, // Mongolian vowel separator
1447-
(char32_t)0x2000, // En quad
1448-
(char32_t)0x2001, // Em quad
1449-
(char32_t)0x2002, // En space
1450-
(char32_t)0x2003, // Em space
1451-
(char32_t)0x2004, // Three-per-em space
1452-
(char32_t)0x2005, // Four-per-em space
1453-
(char32_t)0x2006, // Six-per-em space
1454-
(char32_t)0x2007, // Figure space
1455-
(char32_t)0x2008, // Punctuation space
1456-
(char32_t)0x2009, // Thin space
1457-
(char32_t)0x200A, // Hair space
1458-
(char32_t)0x202F, // Narrow no-break space
1459-
(char32_t)0x205F, // Medium mathematical space
1460-
(char32_t)0x3000 // Ideographic space
1442+
char{0x0009}, // Horizontal tab (HT)
1443+
char{0x0020}, // Space
1444+
char32_t{0x00A0}, // Non-break space
1445+
char32_t{0x1680}, // Ogham space mark
1446+
char32_t{0x180E}, // Mongolian vowel separator
1447+
char32_t{0x2000}, // En quad
1448+
char32_t{0x2001}, // Em quad
1449+
char32_t{0x2002}, // En space
1450+
char32_t{0x2003}, // Em space
1451+
char32_t{0x2004}, // Three-per-em space
1452+
char32_t{0x2005}, // Four-per-em space
1453+
char32_t{0x2006}, // Six-per-em space
1454+
char32_t{0x2007}, // Figure space
1455+
char32_t{0x2008}, // Punctuation space
1456+
char32_t{0x2009}, // Thin space
1457+
char32_t{0x200A}, // Hair space
1458+
char32_t{0x202F}, // Narrow no-break space
1459+
char32_t{0x205F}, // Medium mathematical space
1460+
char32_t{0x3000} // Ideographic space
14611461
>;
14621462

14631463
using alphanum_chars = set<char_range<'A','Z'>, char_range<'a','z'>, char_range<'0','9'> >;
@@ -2169,9 +2169,9 @@ template <auto V, size_t N, typename... Ts, typename Parameters> static constexp
21692169
template <auto V, size_t N, typename... Ts, typename Parameters> static constexpr auto apply(pcre::finish_hexdec, ctll::term<V>, pcre_context<ctll::list<number<N>, Ts...>, Parameters> subject) {
21702170
constexpr size_t max_char = std::numeric_limits<char>::max();
21712171
if constexpr (N <= max_char) {
2172-
return pcre_context{ctll::push_front(character<(char)N>(), ctll::list<Ts...>()), subject.parameters};
2172+
return pcre_context{ctll::push_front(character<char{N}>(), ctll::list<Ts...>()), subject.parameters};
21732173
} else {
2174-
return pcre_context{ctll::push_front(character<(char32_t)N>(), ctll::list<Ts...>()), subject.parameters};
2174+
return pcre_context{ctll::push_front(character<char32_t{N}>(), ctll::list<Ts...>()), subject.parameters};
21752175
}
21762176
}
21772177

single-header/ctre.hpp

+28-28
Original file line numberDiff line numberDiff line change
@@ -1426,35 +1426,35 @@ using word_chars = set<char_range<'A','Z'>, char_range<'a','z'>, char_range<'0',
14261426
using space_chars = enumeration<' ', '\t', '\n', '\v', '\f', '\r'>;
14271427

14281428
using vertical_space_chars = enumeration<
1429-
(char)0x000A, // Linefeed (LF)
1430-
(char)0x000B, // Vertical tab (VT)
1431-
(char)0x000C, // Form feed (FF)
1432-
(char)0x000D, // Carriage return (CR)
1433-
(char32_t)0x0085, // Next line (NEL)
1434-
(char32_t)0x2028, // Line separator
1435-
(char32_t)0x2029 // Paragraph separator
1429+
char{0x000A}, // Linefeed (LF)
1430+
char{0x000B}, // Vertical tab (VT)
1431+
char{0x000C}, // Form feed (FF)
1432+
char{0x000D}, // Carriage return (CR)
1433+
char32_t{0x0085}, // Next line (NEL)
1434+
char32_t{0x2028}, // Line separator
1435+
char32_t{0x2029} // Paragraph separator
14361436
>;
14371437

14381438
using horizontal_space_chars = enumeration<
1439-
(char)0x0009, // Horizontal tab (HT)
1440-
(char)0x0020, // Space
1441-
(char32_t)0x00A0, // Non-break space
1442-
(char32_t)0x1680, // Ogham space mark
1443-
(char32_t)0x180E, // Mongolian vowel separator
1444-
(char32_t)0x2000, // En quad
1445-
(char32_t)0x2001, // Em quad
1446-
(char32_t)0x2002, // En space
1447-
(char32_t)0x2003, // Em space
1448-
(char32_t)0x2004, // Three-per-em space
1449-
(char32_t)0x2005, // Four-per-em space
1450-
(char32_t)0x2006, // Six-per-em space
1451-
(char32_t)0x2007, // Figure space
1452-
(char32_t)0x2008, // Punctuation space
1453-
(char32_t)0x2009, // Thin space
1454-
(char32_t)0x200A, // Hair space
1455-
(char32_t)0x202F, // Narrow no-break space
1456-
(char32_t)0x205F, // Medium mathematical space
1457-
(char32_t)0x3000 // Ideographic space
1439+
char{0x0009}, // Horizontal tab (HT)
1440+
char{0x0020}, // Space
1441+
char32_t{0x00A0}, // Non-break space
1442+
char32_t{0x1680}, // Ogham space mark
1443+
char32_t{0x180E}, // Mongolian vowel separator
1444+
char32_t{0x2000}, // En quad
1445+
char32_t{0x2001}, // Em quad
1446+
char32_t{0x2002}, // En space
1447+
char32_t{0x2003}, // Em space
1448+
char32_t{0x2004}, // Three-per-em space
1449+
char32_t{0x2005}, // Four-per-em space
1450+
char32_t{0x2006}, // Six-per-em space
1451+
char32_t{0x2007}, // Figure space
1452+
char32_t{0x2008}, // Punctuation space
1453+
char32_t{0x2009}, // Thin space
1454+
char32_t{0x200A}, // Hair space
1455+
char32_t{0x202F}, // Narrow no-break space
1456+
char32_t{0x205F}, // Medium mathematical space
1457+
char32_t{0x3000} // Ideographic space
14581458
>;
14591459

14601460
using alphanum_chars = set<char_range<'A','Z'>, char_range<'a','z'>, char_range<'0','9'> >;
@@ -2166,9 +2166,9 @@ template <auto V, size_t N, typename... Ts, typename Parameters> static constexp
21662166
template <auto V, size_t N, typename... Ts, typename Parameters> static constexpr auto apply(pcre::finish_hexdec, ctll::term<V>, pcre_context<ctll::list<number<N>, Ts...>, Parameters> subject) {
21672167
constexpr size_t max_char = std::numeric_limits<char>::max();
21682168
if constexpr (N <= max_char) {
2169-
return pcre_context{ctll::push_front(character<(char)N>(), ctll::list<Ts...>()), subject.parameters};
2169+
return pcre_context{ctll::push_front(character<char{N}>(), ctll::list<Ts...>()), subject.parameters};
21702170
} else {
2171-
return pcre_context{ctll::push_front(character<(char32_t)N>(), ctll::list<Ts...>()), subject.parameters};
2171+
return pcre_context{ctll::push_front(character<char32_t{N}>(), ctll::list<Ts...>()), subject.parameters};
21722172
}
21732173
}
21742174

tests/generating.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ static_assert(same_f(CTRE_GEN("abc"), ctre::string<'a','b','c'>()));
5050
static_assert(same_f(CTRE_GEN("(?:abc)"), ctre::string<'a','b','c'>()));
5151

5252
// support for hexdec
53-
static_assert(same_f(CTRE_GEN("\\x40"), ctre::character<(char)0x40>()));
54-
static_assert(same_f(CTRE_GEN("\\x7F"), ctre::character<(char)0x7F>()));
53+
static_assert(same_f(CTRE_GEN("\\x40"), ctre::character<char{0x40}>()));
54+
static_assert(same_f(CTRE_GEN("\\x7F"), ctre::character<char{0x7F}>()));
5555
// only characters with value < 128 are char otherwise they are internally char32_t
56-
static_assert(same_f(CTRE_GEN("\\x80"), ctre::character<(char32_t)0x80>()));
57-
static_assert(same_f(CTRE_GEN("\\xFF"), ctre::character<(char32_t)0xFF>()));
58-
static_assert(same_f(CTRE_GEN("\\x{FF}"), ctre::character<(char32_t)0xFF>()));
59-
static_assert(same_f(CTRE_GEN("\\x{FFF}"), ctre::character<(char32_t)0xFFF>()));
60-
static_assert(same_f(CTRE_GEN("\\x{ABCD}"), ctre::character<(char32_t)0xABCD>()));
56+
static_assert(same_f(CTRE_GEN("\\x80"), ctre::character<char32_t{0x80}>()));
57+
static_assert(same_f(CTRE_GEN("\\xFF"), ctre::character<char32_t{0xFF}>()));
58+
static_assert(same_f(CTRE_GEN("\\x{FF}"), ctre::character<char32_t{0xFF}>()));
59+
static_assert(same_f(CTRE_GEN("\\x{FFF}"), ctre::character<char32_t{0xFFF}>()));
60+
static_assert(same_f(CTRE_GEN("\\x{ABCD}"), ctre::character<char32_t{0xABCD}>()));
6161

6262
// anything
6363
static_assert(same_f(CTRE_GEN("."), ctre::any()));

0 commit comments

Comments
 (0)