Skip to content

Commit 54f3585

Browse files
committed
-Wold-style-cast
I changed (char)0x0040 to char{0x0040} tests compiled on gcc 10.2 so I think we're okay.
1 parent 4ee9add commit 54f3585

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed

include/ctre/actions/hexdec.inc.hpp

Lines changed: 2 additions & 2 deletions
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

Lines changed: 26 additions & 26 deletions
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'> >;

tests/generating.cpp

Lines changed: 7 additions & 7 deletions
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)