diff options
| author | Neil <nyamatongwe@gmail.com> | 2020-03-23 09:32:03 +1100 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2020-03-23 09:32:03 +1100 | 
| commit | 6d46095c897fa597b963b83dbb66ef4eab42badb (patch) | |
| tree | e972bf30eddf3c1dc06b83c4026a4b8c6c5510dd /src | |
| parent | 7b2e7fedf52c3d08508713a99e2dbe9f96339e94 (diff) | |
| download | scintilla-mirror-6d46095c897fa597b963b83dbb66ef4eab42badb.tar.gz | |
Drop possibility of Sci_Position, Sci::Line, Sci::Position not being ptrdiff_t.
This reduces casting.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Document.cxx | 16 | 
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index b2f355c24..16a56cd52 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -370,7 +370,7 @@ Sci::Line Document::LineFromHandle(int markerHandle) const {  }  Sci_Position SCI_METHOD Document::LineStart(Sci_Position line) const { -	return cb.LineStart(static_cast<Sci::Line>(line)); +	return cb.LineStart(line);  }  bool Document::IsLineStartPosition(Sci::Position position) const { @@ -454,10 +454,10 @@ Sci::Line Document::LineFromPositionIndex(Sci::Position pos, int lineCharacterIn  }  int SCI_METHOD Document::SetLevel(Sci_Position line, int level) { -	const int prev = Levels()->SetLevel(static_cast<Sci::Line>(line), level, LinesTotal()); +	const int prev = Levels()->SetLevel(line, level, LinesTotal());  	if (prev != level) {  		DocModification mh(SC_MOD_CHANGEFOLD | SC_MOD_CHANGEMARKER, -		                   LineStart(line), 0, 0, nullptr, static_cast<Sci::Line>(line)); +		                   LineStart(line), 0, 0, nullptr, line);  		mh.foldLevelNow = level;  		mh.foldLevelPrev = prev;  		NotifyModified(mh); @@ -466,7 +466,7 @@ int SCI_METHOD Document::SetLevel(Sci_Position line, int level) {  }  int SCI_METHOD Document::GetLevel(Sci_Position line) const { -	return Levels()->GetLevel(static_cast<Sci::Line>(line)); +	return Levels()->GetLevel(line);  }  void Document::ClearLevels() { @@ -876,9 +876,9 @@ Document::CharacterExtracted Document::CharacterBefore(Sci::Position position) c  			Sci::Position startUTF = position;  			Sci::Position endUTF = position;  			if (InGoodUTF8(position, startUTF, endUTF)) { -				const int widthCharBytes = static_cast<int>(endUTF - startUTF); +				const Sci::Position widthCharBytes = endUTF - startUTF;  				unsigned char charBytes[UTF8MaxBytes] = { 0, 0, 0, 0 }; -				for (int b = 0; b<widthCharBytes; b++) +				for (Sci::Position b = 0; b<widthCharBytes; b++)  					charBytes[b] = cb.UCharAt(startUTF + b);  				const int utf8status = UTF8Classify(charBytes, widthCharBytes);  				if (utf8status & UTF8MaskInvalid) { @@ -2271,7 +2271,7 @@ void Document::SetLexInterface(LexInterface *pLexInterface) {  }  int SCI_METHOD Document::SetLineState(Sci_Position line, int state) { -	const int statePrevious = States()->SetLineState(static_cast<Sci::Line>(line), state); +	const int statePrevious = States()->SetLineState(line, state);  	if (state != statePrevious) {  		const DocModification mh(SC_MOD_CHANGELINESTATE, LineStart(line), 0, 0, nullptr,  			static_cast<Sci::Line>(line)); @@ -2281,7 +2281,7 @@ int SCI_METHOD Document::SetLineState(Sci_Position line, int state) {  }  int SCI_METHOD Document::GetLineState(Sci_Position line) const { -	return States()->GetLineState(static_cast<Sci::Line>(line)); +	return States()->GetLineState(line);  }  Sci::Line Document::GetMaxLineState() const {  | 
