diff options
| author | Neil <nyamatongwe@gmail.com> | 2020-04-17 09:46:20 +1000 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2020-04-17 09:46:20 +1000 |
| commit | 5dfc62a244a8ca24efb9ce9cb51c1098e908a9a8 (patch) | |
| tree | a0578605a3c17ce144db2c4ce2823d2112f74fdb /src/RESearch.h | |
| parent | 1788b2e28939dfa9629db6533edeaa4b348d277a (diff) | |
| download | scintilla-mirror-5dfc62a244a8ca24efb9ce9cb51c1098e908a9a8.tar.gz | |
Backport: Arithmetic between enums is deprecated so use constexpr instead of enum or cast.
Added constexpr where reasonable.
Backport of changeset 8151:5f70c1eb371b.
Diffstat (limited to 'src/RESearch.h')
| -rw-r--r-- | src/RESearch.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/RESearch.h b/src/RESearch.h index 10ed4380d..49bfc0541 100644 --- a/src/RESearch.h +++ b/src/RESearch.h @@ -29,8 +29,8 @@ public: const char *Compile(const char *pattern, Sci::Position length, bool caseSensitive, bool posix) noexcept; int Execute(const CharacterIndexer &ci, Sci::Position lp, Sci::Position endp); - enum { MAXTAG=10 }; - enum { NOTFOUND=-1 }; + static constexpr int MAXTAG = 10; + static constexpr int NOTFOUND = -1; Sci::Position bopat[MAXTAG]; Sci::Position eopat[MAXTAG]; @@ -38,12 +38,12 @@ public: private: - enum { MAXNFA = 4096 }; - // The following enums are not meant to be changeable. + static constexpr int MAXNFA = 4096; + // The following constants are not meant to be changeable. // They are for readability only. - enum { MAXCHR = 256 }; - enum { CHRBIT = 8 }; - enum { BITBLK = MAXCHR / CHRBIT }; + static constexpr int MAXCHR = 256; + static constexpr int CHRBIT = 8; + static constexpr int BITBLK = MAXCHR / CHRBIT; void ChSet(unsigned char c) noexcept; void ChSetWithCase(unsigned char c, bool caseSensitive) noexcept; |
