@@ -53,11 +53,11 @@ namespace
5353 return c;
5454 }
5555
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 ;
6161
6262 class SimilarToCompiler
6363 {
@@ -335,7 +335,7 @@ namespace
335335 const char * re2ClassInclude;
336336 const char * re2ClassExcludeUtf;
337337 const char * re2ClassExcludeLatin;
338- } static const classes[] =
338+ } static constexpr classes[] =
339339 {
340340 {" alnum" , " [:alnum:]" , " [:^alnum:]" , " [:^alnum:]" },
341341 {" alpha" , " [:alpha:]" , " [:^alpha:]" , " [:^alpha:]" },
@@ -646,7 +646,7 @@ namespace
646646 }
647647
648648 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
650650
651651 string re2PatternStr;
652652 const char * patternStr;
@@ -880,7 +880,7 @@ bool SubstringSimilarRegex::matches(const char* buffer, unsigned bufferLen,
880880 if (RE2::FullMatch (sp, *regexp.get (), nullptr , &spResult, nullptr ))
881881 {
882882 *resultStart = spResult.begin () - buffer;
883- *resultLength = spResult.length ();
883+ *resultLength = static_cast < unsigned >( spResult.length () );
884884 return true ;
885885 }
886886 else
0 commit comments