diff options
Diffstat (limited to 'lexlib')
| -rw-r--r-- | lexlib/Accessor.cxx | 4 | ||||
| -rw-r--r-- | lexlib/CharacterCategory.cxx | 8 | ||||
| -rw-r--r-- | lexlib/CharacterSet.cxx | 8 | ||||
| -rw-r--r-- | lexlib/LexAccessor.h | 2 | ||||
| -rw-r--r-- | lexlib/StyleContext.h | 4 | ||||
| -rw-r--r-- | lexlib/WordList.cxx | 8 | 
6 files changed, 17 insertions, 17 deletions
diff --git a/lexlib/Accessor.cxx b/lexlib/Accessor.cxx index e35894dd3..2e51fa32a 100644 --- a/lexlib/Accessor.cxx +++ b/lexlib/Accessor.cxx @@ -29,7 +29,7 @@ int Accessor::GetPropertyInt(const char *key, int defaultValue) const {  }  int Accessor::IndentAmount(Sci_Position line, int *flags, PFNIsCommentLeader pfnIsCommentLeader) { -	Sci_Position end = Length(); +	const Sci_Position end = Length();  	int spaceFlags = 0;  	// Determines the indentation level of the current line and also checks for consistent @@ -44,7 +44,7 @@ int Accessor::IndentAmount(Sci_Position line, int *flags, PFNIsCommentLeader pfn  	Sci_Position posPrev = inPrevPrefix ? LineStart(line-1) : 0;  	while ((ch == ' ' || ch == '\t') && (pos < end)) {  		if (inPrevPrefix) { -			char chPrev = (*this)[posPrev++]; +			const char chPrev = (*this)[posPrev++];  			if (chPrev == ' ' || chPrev == '\t') {  				if (chPrev != ch)  					spaceFlags |= wsInconsistent; diff --git a/lexlib/CharacterCategory.cxx b/lexlib/CharacterCategory.cxx index 0880171e8..c57c8bacb 100644 --- a/lexlib/CharacterCategory.cxx +++ b/lexlib/CharacterCategory.cxx @@ -3808,11 +3808,11 @@ bool IsIdStart(int character) {  	if (IsIdPattern(character)) {  		return false;  	} -	OtherID oid = OtherIDOfCharacter(character); +	const OtherID oid = OtherIDOfCharacter(character);  	if (oid == OtherID::oidStart) {  		return true;  	} -	CharacterCategory c = CategoriseCharacter(character); +	const CharacterCategory c = CategoriseCharacter(character);  	return (c == ccLl || c == ccLu || c == ccLt || c == ccLm || c == ccLo  		|| c == ccNl);  } @@ -3823,11 +3823,11 @@ bool IsIdContinue(int character) {  	if (IsIdPattern(character)) {  		return false;  	} -	OtherID oid = OtherIDOfCharacter(character); +	const OtherID oid = OtherIDOfCharacter(character);  	if (oid != OtherID::oidNone) {  		return true;  	} -	CharacterCategory c = CategoriseCharacter(character); +	const CharacterCategory c = CategoriseCharacter(character);  	return (c == ccLl || c == ccLu || c == ccLt || c == ccLm || c == ccLo  		|| c == ccNl || c == ccMn || c == ccMc || c == ccNd || c == ccPc);  } diff --git a/lexlib/CharacterSet.cxx b/lexlib/CharacterSet.cxx index bb9a86df6..0db3e41b7 100644 --- a/lexlib/CharacterSet.cxx +++ b/lexlib/CharacterSet.cxx @@ -22,8 +22,8 @@ namespace Scintilla {  int CompareCaseInsensitive(const char *a, const char *b) {  	while (*a && *b) {  		if (*a != *b) { -			char upperA = static_cast<char>(MakeUpperCase(*a)); -			char upperB = static_cast<char>(MakeUpperCase(*b)); +			const char upperA = static_cast<char>(MakeUpperCase(*a)); +			const char upperB = static_cast<char>(MakeUpperCase(*b));  			if (upperA != upperB)  				return upperA - upperB;  		} @@ -37,8 +37,8 @@ int CompareCaseInsensitive(const char *a, const char *b) {  int CompareNCaseInsensitive(const char *a, const char *b, size_t len) {  	while (*a && *b && len) {  		if (*a != *b) { -			char upperA = static_cast<char>(MakeUpperCase(*a)); -			char upperB = static_cast<char>(MakeUpperCase(*b)); +			const char upperA = static_cast<char>(MakeUpperCase(*a)); +			const char upperB = static_cast<char>(MakeUpperCase(*b));  			if (upperA != upperB)  				return upperA - upperB;  		} diff --git a/lexlib/LexAccessor.h b/lexlib/LexAccessor.h index f2cce50bd..064a17581 100644 --- a/lexlib/LexAccessor.h +++ b/lexlib/LexAccessor.h @@ -125,7 +125,7 @@ public:  		} else {  			// Old interface means only '\r', '\n' and '\r\n' line ends.  			Sci_Position startNext = pAccess->LineStart(line+1); -			char chLineEnd = SafeGetCharAt(startNext-1); +			const char chLineEnd = SafeGetCharAt(startNext-1);  			if (chLineEnd == '\n' && (SafeGetCharAt(startNext-2)  == '\r'))  				return startNext - 2;  			else diff --git a/lexlib/StyleContext.h b/lexlib/StyleContext.h index 6cbda358e..045939f14 100644 --- a/lexlib/StyleContext.h +++ b/lexlib/StyleContext.h @@ -130,7 +130,7 @@ public:  		}  	}  	void ForwardBytes(Sci_Position nb) { -		Sci_PositionU forwardPos = currentPos + nb; +		const Sci_PositionU forwardPos = currentPos + nb;  		while (forwardPos > currentPos) {  			Forward();  		} @@ -165,7 +165,7 @@ public:  			}  			Sci_Position diffRelative = n - offsetRelative;  			Sci_Position posNew = multiByteAccess->GetRelativePosition(posRelative, diffRelative); -			int chReturn = multiByteAccess->GetCharacterAndWidth(posNew, 0); +			const int chReturn = multiByteAccess->GetCharacterAndWidth(posNew, 0);  			posRelative = posNew;  			currentPosLastRelative = currentPos;  			offsetRelative = n; diff --git a/lexlib/WordList.cxx b/lexlib/WordList.cxx index 2f673397f..895fdf7dc 100644 --- a/lexlib/WordList.cxx +++ b/lexlib/WordList.cxx @@ -34,7 +34,7 @@ static char **ArrayFromWordList(char *wordlist, int *len, bool onlyLineEnds = fa  		wordSeparator[static_cast<unsigned int>('\t')] = true;  	}  	for (int j = 0; wordlist[j]; j++) { -		int curr = static_cast<unsigned char>(wordlist[j]); +		const int curr = static_cast<unsigned char>(wordlist[j]);  		if (!wordSeparator[curr] && wordSeparator[prev])  			words++;  		prev = curr; @@ -143,7 +143,7 @@ void WordList::Set(const char *s) {  bool WordList::InList(const char *s) const {  	if (0 == words)  		return false; -	unsigned char firstChar = s[0]; +	const unsigned char firstChar = s[0];  	int j = starts[firstChar];  	if (j >= 0) {  		while (static_cast<unsigned char>(words[j][0]) == firstChar) { @@ -185,7 +185,7 @@ bool WordList::InList(const char *s) const {  bool WordList::InListAbbreviated(const char *s, const char marker) const {  	if (0 == words)  		return false; -	unsigned char firstChar = s[0]; +	const unsigned char firstChar = s[0];  	int j = starts[firstChar];  	if (j >= 0) {  		while (static_cast<unsigned char>(words[j][0]) == firstChar) { @@ -239,7 +239,7 @@ bool WordList::InListAbbreviated(const char *s, const char marker) const {  bool WordList::InListAbridged(const char *s, const char marker) const {  	if (0 == words)  		return false; -	unsigned char firstChar = s[0]; +	const unsigned char firstChar = s[0];  	int j = starts[firstChar];  	if (j >= 0) {  		while (static_cast<unsigned char>(words[j][0]) == firstChar) {  | 
