diff options
author | Neil <nyamatongwe@gmail.com> | 2018-06-04 14:42:02 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-06-04 14:42:02 +1000 |
commit | d3accd58aeb1ae49ef3ca9003fadbcd3daafb93e (patch) | |
tree | d923fe71efe720dcfb30fb3825a147bead0891b4 | |
parent | 7ed728ef6188885e01221a6d89be7ce8707e4ac1 (diff) | |
download | scintilla-mirror-d3accd58aeb1ae49ef3ca9003fadbcd3daafb93e.tar.gz |
Backport: Use const in lexlib headers.
Backport of changeset 7018:b14abcf3e0ac.
-rw-r--r-- | lexlib/LexAccessor.h | 2 | ||||
-rw-r--r-- | lexlib/StyleContext.h | 4 | ||||
-rw-r--r-- | lexlib/SubStyles.h | 12 |
3 files changed, 9 insertions, 9 deletions
diff --git a/lexlib/LexAccessor.h b/lexlib/LexAccessor.h index 822c81dfb..f8c180e14 100644 --- a/lexlib/LexAccessor.h +++ b/lexlib/LexAccessor.h @@ -170,7 +170,7 @@ public: if (validLen + (pos - startSeg + 1) >= bufferSize) Flush(); - char attr = static_cast<char>(chAttr); + const char attr = static_cast<char>(chAttr); if (validLen + (pos - startSeg + 1) >= bufferSize) { // Too big for buffer so send directly pAccess->SetStyleFor(pos - startSeg + 1, attr); diff --git a/lexlib/StyleContext.h b/lexlib/StyleContext.h index 6e457dd59..8cb683619 100644 --- a/lexlib/StyleContext.h +++ b/lexlib/StyleContext.h @@ -167,8 +167,8 @@ public: posRelative = currentPos; offsetRelative = 0; } - Sci_Position diffRelative = n - offsetRelative; - Sci_Position posNew = multiByteAccess->GetRelativePosition(posRelative, diffRelative); + const Sci_Position diffRelative = n - offsetRelative; + const Sci_Position posNew = multiByteAccess->GetRelativePosition(posRelative, diffRelative); const int chReturn = multiByteAccess->GetCharacterAndWidth(posNew, nullptr); posRelative = posNew; currentPosLastRelative = currentPos; diff --git a/lexlib/SubStyles.h b/lexlib/SubStyles.h index 682909bf2..3e99efe83 100644 --- a/lexlib/SubStyles.h +++ b/lexlib/SubStyles.h @@ -120,11 +120,11 @@ public: } int Allocate(int styleBase, int numberStyles) { - int block = BlockFromBaseStyle(styleBase); + const int block = BlockFromBaseStyle(styleBase); if (block >= 0) { if ((allocated + numberStyles) > stylesAvailable) return -1; - int startBlock = styleFirst + allocated; + const int startBlock = styleFirst + allocated; allocated += numberStyles; classifiers[block].Allocate(startBlock, numberStyles); return startBlock; @@ -134,17 +134,17 @@ public: } int Start(int styleBase) { - int block = BlockFromBaseStyle(styleBase); + const int block = BlockFromBaseStyle(styleBase); return (block >= 0) ? classifiers[block].Start() : -1; } int Length(int styleBase) { - int block = BlockFromBaseStyle(styleBase); + const int block = BlockFromBaseStyle(styleBase); return (block >= 0) ? classifiers[block].Length() : 0; } int BaseStyle(int subStyle) const { - int block = BlockFromStyle(subStyle); + const int block = BlockFromStyle(subStyle); if (block >= 0) return classifiers[block].Base(); else @@ -174,7 +174,7 @@ public: } void SetIdentifiers(int style, const char *identifiers) { - int block = BlockFromStyle(style); + const int block = BlockFromStyle(style); if (block >= 0) classifiers[block].SetIdentifiers(style, identifiers); } |