@@ -53,11 +53,11 @@ namespace
53
53
return c;
54
54
}
55
55
56
- static const unsigned COMP_FLAG_PREFER_FEWER = 0x01 ;
57
- static const unsigned COMP_FLAG_GROUP_CAPTURE = 0x02 ;
58
- static const unsigned COMP_FLAG_CASE_INSENSITIVE = 0x04 ;
59
- static const unsigned COMP_FLAG_LATIN = 0x08 ;
60
- static const unsigned COMP_FLAG_WELLFORMED = 0x10 ;
56
+ static constexpr unsigned COMP_FLAG_PREFER_FEWER = 0x01 ;
57
+ static constexpr unsigned COMP_FLAG_GROUP_CAPTURE = 0x02 ;
58
+ static constexpr unsigned COMP_FLAG_CASE_INSENSITIVE = 0x04 ;
59
+ static constexpr unsigned COMP_FLAG_LATIN = 0x08 ;
60
+ static constexpr unsigned COMP_FLAG_WELLFORMED = 0x10 ;
61
61
62
62
class SimilarToCompiler
63
63
{
@@ -335,7 +335,7 @@ namespace
335
335
const char * re2ClassInclude;
336
336
const char * re2ClassExcludeUtf;
337
337
const char * re2ClassExcludeLatin;
338
- } static const classes[] =
338
+ } static constexpr classes[] =
339
339
{
340
340
{" alnum" , " [:alnum:]" , " [:^alnum:]" , " [:^alnum:]" },
341
341
{" alpha" , " [:alpha:]" , " [:^alpha:]" , " [:^alpha:]" },
@@ -646,7 +646,7 @@ namespace
646
646
}
647
647
648
648
private:
649
- static const int PARSE_FLAG_NOT_EMPTY = 1 ; // known never to match empty string
649
+ static constexpr int PARSE_FLAG_NOT_EMPTY = 1 ; // known never to match empty string
650
650
651
651
string re2PatternStr;
652
652
const char * patternStr;
@@ -880,7 +880,7 @@ bool SubstringSimilarRegex::matches(const char* buffer, unsigned bufferLen,
880
880
if (RE2::FullMatch (sp, *regexp.get (), nullptr , &spResult, nullptr ))
881
881
{
882
882
*resultStart = spResult.begin () - buffer;
883
- *resultLength = spResult.length ();
883
+ *resultLength = static_cast < unsigned >( spResult.length () );
884
884
return true ;
885
885
}
886
886
else
0 commit comments