diff options
| -rw-r--r-- | src/Catalogue.cxx | 2 | ||||
| -rw-r--r-- | src/Catalogue.h | 2 | ||||
| -rw-r--r-- | src/CellBuffer.cxx | 2 | ||||
| -rw-r--r-- | src/CellBuffer.h | 2 | ||||
| -rw-r--r-- | src/CharClassify.cxx | 2 | ||||
| -rw-r--r-- | src/CharClassify.h | 2 | ||||
| -rw-r--r-- | src/ContractionState.cxx | 52 | ||||
| -rw-r--r-- | src/ContractionState.h | 24 | ||||
| -rw-r--r-- | src/Decoration.cxx | 4 | ||||
| -rw-r--r-- | src/Decoration.h | 4 | ||||
| -rw-r--r-- | src/Document.h | 2 | ||||
| -rw-r--r-- | src/EditModel.cxx | 2 | ||||
| -rw-r--r-- | src/EditModel.h | 2 | ||||
| -rw-r--r-- | src/EditView.cxx | 6 | ||||
| -rw-r--r-- | src/EditView.h | 6 | ||||
| -rw-r--r-- | src/ElapsedPeriod.h | 2 | ||||
| -rw-r--r-- | src/MarginView.cxx | 2 | ||||
| -rw-r--r-- | src/PositionCache.cxx | 28 | ||||
| -rw-r--r-- | src/PositionCache.h | 26 | ||||
| -rw-r--r-- | src/Selection.cxx | 24 | ||||
| -rw-r--r-- | src/Selection.h | 24 | ||||
| -rw-r--r-- | src/UniConversion.cxx | 2 | ||||
| -rw-r--r-- | src/UniConversion.h | 2 | ||||
| -rw-r--r-- | src/ViewStyle.cxx | 10 | ||||
| -rw-r--r-- | src/ViewStyle.h | 10 | 
25 files changed, 122 insertions, 122 deletions
| diff --git a/src/Catalogue.cxx b/src/Catalogue.cxx index 50254de8b..7f2415e0b 100644 --- a/src/Catalogue.cxx +++ b/src/Catalogue.cxx @@ -34,7 +34,7 @@ const LexerModule *Catalogue::Find(int language) {  	return catalogueDefault.Find(language);  } -const LexerModule *Catalogue::Find(const char *languageName) { +const LexerModule *Catalogue::Find(const char *languageName) noexcept {  	return catalogueDefault.Find(languageName);  } diff --git a/src/Catalogue.h b/src/Catalogue.h index d8769a896..05a1f1d29 100644 --- a/src/Catalogue.h +++ b/src/Catalogue.h @@ -15,7 +15,7 @@ namespace Scintilla {  class Catalogue {  public:  	static const LexerModule *Find(int language); -	static const LexerModule *Find(const char *languageName); +	static const LexerModule *Find(const char *languageName) noexcept;  	static void AddLexerModule(LexerModule *plm);  }; diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index 877a2c46f..636f9d2a7 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -667,7 +667,7 @@ bool CellBuffer::SetStyleAt(Sci::Position position, char styleValue) noexcept {  	}  } -bool CellBuffer::SetStyleFor(Sci::Position position, Sci::Position lengthStyle, char styleValue) { +bool CellBuffer::SetStyleFor(Sci::Position position, Sci::Position lengthStyle, char styleValue) noexcept {  	if (!hasStyles) {  		return false;  	} diff --git a/src/CellBuffer.h b/src/CellBuffer.h index 3e16bcdc8..599b6062f 100644 --- a/src/CellBuffer.h +++ b/src/CellBuffer.h @@ -173,7 +173,7 @@ public:  	/// Setting styles for positions outside the range of the buffer is safe and has no effect.  	/// @return true if the style of a character is changed.  	bool SetStyleAt(Sci::Position position, char styleValue) noexcept; -	bool SetStyleFor(Sci::Position position, Sci::Position lengthStyle, char styleValue); +	bool SetStyleFor(Sci::Position position, Sci::Position lengthStyle, char styleValue) noexcept;  	const char *DeleteChars(Sci::Position position, Sci::Position deleteLength, bool &startSequence); diff --git a/src/CharClassify.cxx b/src/CharClassify.cxx index eb40a89c2..b5e2870f3 100644 --- a/src/CharClassify.cxx +++ b/src/CharClassify.cxx @@ -43,7 +43,7 @@ void CharClassify::SetCharClasses(const unsigned char *chars, cc newCharClass) {  	}  } -int CharClassify::GetCharsOfClass(cc characterClass, unsigned char *buffer) const { +int CharClassify::GetCharsOfClass(cc characterClass, unsigned char *buffer) const noexcept {  	// Get characters belonging to the given char class; return the number  	// of characters (if the buffer is NULL, don't write to it).  	int count = 0; diff --git a/src/CharClassify.h b/src/CharClassify.h index 1381a1b34..36cc34558 100644 --- a/src/CharClassify.h +++ b/src/CharClassify.h @@ -17,7 +17,7 @@ public:  	enum cc { ccSpace, ccNewLine, ccWord, ccPunctuation };  	void SetDefaultCharClasses(bool includeWordClass);  	void SetCharClasses(const unsigned char *chars, cc newCharClass); -	int GetCharsOfClass(cc characterClass, unsigned char *buffer) const; +	int GetCharsOfClass(cc characterClass, unsigned char *buffer) const noexcept;  	cc GetClass(unsigned char ch) const noexcept { return static_cast<cc>(charClass[ch]);}  	bool IsWord(unsigned char ch) const noexcept { return static_cast<cc>(charClass[ch]) == ccWord;} diff --git a/src/ContractionState.cxx b/src/ContractionState.cxx index 8b5821470..81fefdfeb 100644 --- a/src/ContractionState.cxx +++ b/src/ContractionState.cxx @@ -61,32 +61,32 @@ public:  	void Clear() noexcept override; -	Sci::Line LinesInDoc() const override; -	Sci::Line LinesDisplayed() const override; -	Sci::Line DisplayFromDoc(Sci::Line lineDoc) const override; -	Sci::Line DisplayLastFromDoc(Sci::Line lineDoc) const override; -	Sci::Line DocFromDisplay(Sci::Line lineDisplay) const override; +	Sci::Line LinesInDoc() const noexcept override; +	Sci::Line LinesDisplayed() const noexcept override; +	Sci::Line DisplayFromDoc(Sci::Line lineDoc) const noexcept override; +	Sci::Line DisplayLastFromDoc(Sci::Line lineDoc) const noexcept override; +	Sci::Line DocFromDisplay(Sci::Line lineDisplay) const noexcept override;  	void InsertLines(Sci::Line lineDoc, Sci::Line lineCount) override;  	void DeleteLines(Sci::Line lineDoc, Sci::Line lineCount) override; -	bool GetVisible(Sci::Line lineDoc) const override; +	bool GetVisible(Sci::Line lineDoc) const noexcept override;  	bool SetVisible(Sci::Line lineDocStart, Sci::Line lineDocEnd, bool isVisible) override; -	bool HiddenLines() const override; +	bool HiddenLines() const noexcept override; -	const char *GetFoldDisplayText(Sci::Line lineDoc) const override; +	const char *GetFoldDisplayText(Sci::Line lineDoc) const noexcept override;  	bool SetFoldDisplayText(Sci::Line lineDoc, const char *text) override; -	bool GetExpanded(Sci::Line lineDoc) const override; +	bool GetExpanded(Sci::Line lineDoc) const noexcept override;  	bool SetExpanded(Sci::Line lineDoc, bool isExpanded) override; -	Sci::Line ContractedNext(Sci::Line lineDocStart) const override; +	Sci::Line ContractedNext(Sci::Line lineDocStart) const noexcept override; -	int GetHeight(Sci::Line lineDoc) const override; +	int GetHeight(Sci::Line lineDoc) const noexcept override;  	bool SetHeight(Sci::Line lineDoc, int height) override; -	void ShowAll() override; +	void ShowAll() noexcept override; -	void Check() const; +	void Check() const noexcept;  };  template <typename LINE> @@ -158,7 +158,7 @@ void ContractionState<LINE>::Clear() noexcept {  }  template <typename LINE> -Sci::Line ContractionState<LINE>::LinesInDoc() const { +Sci::Line ContractionState<LINE>::LinesInDoc() const noexcept {  	if (OneToOne()) {  		return linesInDocument;  	} else { @@ -167,7 +167,7 @@ Sci::Line ContractionState<LINE>::LinesInDoc() const {  }  template <typename LINE> -Sci::Line ContractionState<LINE>::LinesDisplayed() const { +Sci::Line ContractionState<LINE>::LinesDisplayed() const noexcept {  	if (OneToOne()) {  		return linesInDocument;  	} else { @@ -176,7 +176,7 @@ Sci::Line ContractionState<LINE>::LinesDisplayed() const {  }  template <typename LINE> -Sci::Line ContractionState<LINE>::DisplayFromDoc(Sci::Line lineDoc) const { +Sci::Line ContractionState<LINE>::DisplayFromDoc(Sci::Line lineDoc) const noexcept {  	if (OneToOne()) {  		return (lineDoc <= linesInDocument) ? lineDoc : linesInDocument;  	} else { @@ -187,12 +187,12 @@ Sci::Line ContractionState<LINE>::DisplayFromDoc(Sci::Line lineDoc) const {  }  template <typename LINE> -Sci::Line ContractionState<LINE>::DisplayLastFromDoc(Sci::Line lineDoc) const { +Sci::Line ContractionState<LINE>::DisplayLastFromDoc(Sci::Line lineDoc) const noexcept {  	return DisplayFromDoc(lineDoc) + GetHeight(lineDoc) - 1;  }  template <typename LINE> -Sci::Line ContractionState<LINE>::DocFromDisplay(Sci::Line lineDisplay) const { +Sci::Line ContractionState<LINE>::DocFromDisplay(Sci::Line lineDisplay) const noexcept {  	if (OneToOne()) {  		return lineDisplay;  	} else { @@ -233,7 +233,7 @@ void ContractionState<LINE>::DeleteLines(Sci::Line lineDoc, Sci::Line lineCount)  }  template <typename LINE> -bool ContractionState<LINE>::GetVisible(Sci::Line lineDoc) const { +bool ContractionState<LINE>::GetVisible(Sci::Line lineDoc) const noexcept {  	if (OneToOne()) {  		return true;  	} else { @@ -270,7 +270,7 @@ bool ContractionState<LINE>::SetVisible(Sci::Line lineDocStart, Sci::Line lineDo  }  template <typename LINE> -bool ContractionState<LINE>::HiddenLines() const { +bool ContractionState<LINE>::HiddenLines() const noexcept {  	if (OneToOne()) {  		return false;  	} else { @@ -279,7 +279,7 @@ bool ContractionState<LINE>::HiddenLines() const {  }  template <typename LINE> -const char *ContractionState<LINE>::GetFoldDisplayText(Sci::Line lineDoc) const { +const char *ContractionState<LINE>::GetFoldDisplayText(Sci::Line lineDoc) const noexcept {  	Check();  	return foldDisplayTexts->ValueAt(lineDoc).get();  } @@ -300,7 +300,7 @@ bool ContractionState<LINE>::SetFoldDisplayText(Sci::Line lineDoc, const char *t  }  template <typename LINE> -bool ContractionState<LINE>::GetExpanded(Sci::Line lineDoc) const { +bool ContractionState<LINE>::GetExpanded(Sci::Line lineDoc) const noexcept {  	if (OneToOne()) {  		return true;  	} else { @@ -327,7 +327,7 @@ bool ContractionState<LINE>::SetExpanded(Sci::Line lineDoc, bool isExpanded) {  }  template <typename LINE> -Sci::Line ContractionState<LINE>::ContractedNext(Sci::Line lineDocStart) const { +Sci::Line ContractionState<LINE>::ContractedNext(Sci::Line lineDocStart) const noexcept {  	if (OneToOne()) {  		return -1;  	} else { @@ -345,7 +345,7 @@ Sci::Line ContractionState<LINE>::ContractedNext(Sci::Line lineDocStart) const {  }  template <typename LINE> -int ContractionState<LINE>::GetHeight(Sci::Line lineDoc) const { +int ContractionState<LINE>::GetHeight(Sci::Line lineDoc) const noexcept {  	if (OneToOne()) {  		return 1;  	} else { @@ -378,7 +378,7 @@ bool ContractionState<LINE>::SetHeight(Sci::Line lineDoc, int height) {  }  template <typename LINE> -void ContractionState<LINE>::ShowAll() { +void ContractionState<LINE>::ShowAll() noexcept {  	const LINE lines = static_cast<LINE>(LinesInDoc());  	Clear();  	linesInDocument = lines; @@ -387,7 +387,7 @@ void ContractionState<LINE>::ShowAll() {  // Debugging checks  template <typename LINE> -void ContractionState<LINE>::Check() const { +void ContractionState<LINE>::Check() const noexcept {  #ifdef CHECK_CORRECTNESS  	for (Sci::Line vline = 0; vline < LinesDisplayed(); vline++) {  		const Sci::Line lineDoc = DocFromDisplay(vline); diff --git a/src/ContractionState.h b/src/ContractionState.h index f9ec7b645..b30d071b4 100644 --- a/src/ContractionState.h +++ b/src/ContractionState.h @@ -18,30 +18,30 @@ public:  	virtual void Clear()=0; -	virtual Sci::Line LinesInDoc() const=0; -	virtual Sci::Line LinesDisplayed() const=0; -	virtual Sci::Line DisplayFromDoc(Sci::Line lineDoc) const=0; -	virtual Sci::Line DisplayLastFromDoc(Sci::Line lineDoc) const=0; -	virtual Sci::Line DocFromDisplay(Sci::Line lineDisplay) const=0; +	virtual Sci::Line LinesInDoc() const noexcept=0; +	virtual Sci::Line LinesDisplayed() const noexcept=0; +	virtual Sci::Line DisplayFromDoc(Sci::Line lineDoc) const noexcept=0; +	virtual Sci::Line DisplayLastFromDoc(Sci::Line lineDoc) const noexcept=0; +	virtual Sci::Line DocFromDisplay(Sci::Line lineDisplay) const noexcept=0;  	virtual void InsertLines(Sci::Line lineDoc, Sci::Line lineCount)=0;  	virtual void DeleteLines(Sci::Line lineDoc, Sci::Line lineCount)=0; -	virtual bool GetVisible(Sci::Line lineDoc) const=0; +	virtual bool GetVisible(Sci::Line lineDoc) const noexcept=0;  	virtual bool SetVisible(Sci::Line lineDocStart, Sci::Line lineDocEnd, bool isVisible)=0; -	virtual bool HiddenLines() const=0; +	virtual bool HiddenLines() const noexcept=0; -	virtual const char *GetFoldDisplayText(Sci::Line lineDoc) const=0; +	virtual const char *GetFoldDisplayText(Sci::Line lineDoc) const noexcept=0;  	virtual bool SetFoldDisplayText(Sci::Line lineDoc, const char *text)=0; -	virtual bool GetExpanded(Sci::Line lineDoc) const=0; +	virtual bool GetExpanded(Sci::Line lineDoc) const noexcept=0;  	virtual bool SetExpanded(Sci::Line lineDoc, bool isExpanded)=0; -	virtual Sci::Line ContractedNext(Sci::Line lineDocStart) const=0; +	virtual Sci::Line ContractedNext(Sci::Line lineDocStart) const noexcept =0; -	virtual int GetHeight(Sci::Line lineDoc) const=0; +	virtual int GetHeight(Sci::Line lineDoc) const noexcept=0;  	virtual bool SetHeight(Sci::Line lineDoc, int height)=0; -	virtual void ShowAll()=0; +	virtual void ShowAll() noexcept=0;  };  std::unique_ptr<IContractionState> ContractionStateCreate(bool largeDocument); diff --git a/src/Decoration.cxx b/src/Decoration.cxx index 39f0c62cc..ff6493f67 100644 --- a/src/Decoration.cxx +++ b/src/Decoration.cxx @@ -113,10 +113,10 @@ public:  	Sci::Position Start(int indicator, Sci::Position position) noexcept override;  	Sci::Position End(int indicator, Sci::Position position) noexcept override; -	bool ClickNotified() const override { +	bool ClickNotified() const noexcept override {  		return clickNotified;  	} -	void SetClickNotified(bool notified) override { +	void SetClickNotified(bool notified) noexcept override {  		clickNotified = notified;  	}  }; diff --git a/src/Decoration.h b/src/Decoration.h index 923b0ce15..bab8e2500 100644 --- a/src/Decoration.h +++ b/src/Decoration.h @@ -46,8 +46,8 @@ public:  	virtual Sci::Position Start(int indicator, Sci::Position position) noexcept = 0;  	virtual Sci::Position End(int indicator, Sci::Position position) noexcept = 0; -	virtual bool ClickNotified() const = 0; -	virtual void SetClickNotified(bool notified) = 0; +	virtual bool ClickNotified() const noexcept = 0; +	virtual void SetClickNotified(bool notified) noexcept = 0;  };  std::unique_ptr<IDecoration> DecorationCreate(bool largeDocument, int indicator); diff --git a/src/Document.h b/src/Document.h index 2ff0e8b27..a1017810e 100644 --- a/src/Document.h +++ b/src/Document.h @@ -366,7 +366,7 @@ public:  	bool TentativeActive() const noexcept { return cb.TentativeActive(); }  	const char * SCI_METHOD BufferPointer() override { return cb.BufferPointer(); } -	const char *RangePointer(Sci::Position position, Sci::Position rangeLength) { return cb.RangePointer(position, rangeLength); } +	const char *RangePointer(Sci::Position position, Sci::Position rangeLength) noexcept { return cb.RangePointer(position, rangeLength); }  	Sci::Position GapPosition() const noexcept { return cb.GapPosition(); }  	int SCI_METHOD GetLineIndentation(Sci_Position line) override; diff --git a/src/EditModel.cxx b/src/EditModel.cxx index becfaf355..3f9874358 100644 --- a/src/EditModel.cxx +++ b/src/EditModel.cxx @@ -97,7 +97,7 @@ const char *EditModel::GetDefaultFoldDisplayText() const noexcept {  	return defaultFoldDisplayText.get();  } -const char *EditModel::GetFoldDisplayText(Sci::Line lineDoc) const { +const char *EditModel::GetFoldDisplayText(Sci::Line lineDoc) const noexcept {  	if (foldDisplayTextStyle == SC_FOLDDISPLAYTEXT_HIDDEN || pcs->GetExpanded(lineDoc)) {  		return nullptr;  	} diff --git a/src/EditModel.h b/src/EditModel.h index 733ccd82c..56d341abb 100644 --- a/src/EditModel.h +++ b/src/EditModel.h @@ -68,7 +68,7 @@ public:  	bool BidirectionalR2L() const noexcept;  	void SetDefaultFoldDisplayText(const char *text);  	const char *GetDefaultFoldDisplayText() const noexcept; -	const char *GetFoldDisplayText(Sci::Line lineDoc) const; +	const char *GetFoldDisplayText(Sci::Line lineDoc) const noexcept;  };  } diff --git a/src/EditView.cxx b/src/EditView.cxx index 597d20b47..9599e293f 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -213,14 +213,14 @@ void EditView::ClearAllTabstops() noexcept {  	ldTabstops.reset();  } -XYPOSITION EditView::NextTabstopPos(Sci::Line line, XYPOSITION x, XYPOSITION tabWidth) const { +XYPOSITION EditView::NextTabstopPos(Sci::Line line, XYPOSITION x, XYPOSITION tabWidth) const noexcept {  	const int next = GetNextTabstop(line, static_cast<int>(x + tabWidthMinimumPixels));  	if (next > 0)  		return static_cast<XYPOSITION>(next);  	return (static_cast<int>((x + tabWidthMinimumPixels) / tabWidth) + 1) * tabWidth;  } -bool EditView::ClearTabstops(Sci::Line line) { +bool EditView::ClearTabstops(Sci::Line line) noexcept {  	return ldTabstops && ldTabstops->ClearTabstops(line);  } @@ -231,7 +231,7 @@ bool EditView::AddTabstop(Sci::Line line, int x) {  	return ldTabstops && ldTabstops->AddTabstop(line, x);  } -int EditView::GetNextTabstop(Sci::Line line, int x) const { +int EditView::GetNextTabstop(Sci::Line line, int x) const noexcept {  	if (ldTabstops) {  		return ldTabstops->GetNextTabstop(line, x);  	} else { diff --git a/src/EditView.h b/src/EditView.h index bf62f011d..6eb63a686 100644 --- a/src/EditView.h +++ b/src/EditView.h @@ -102,10 +102,10 @@ public:  	bool LinesOverlap() const noexcept;  	void ClearAllTabstops() noexcept; -	XYPOSITION NextTabstopPos(Sci::Line line, XYPOSITION x, XYPOSITION tabWidth) const; -	bool ClearTabstops(Sci::Line line); +	XYPOSITION NextTabstopPos(Sci::Line line, XYPOSITION x, XYPOSITION tabWidth) const noexcept; +	bool ClearTabstops(Sci::Line line) noexcept;  	bool AddTabstop(Sci::Line line, int x); -	int GetNextTabstop(Sci::Line line, int x) const; +	int GetNextTabstop(Sci::Line line, int x) const noexcept;  	void LinesAddedOrRemoved(Sci::Line lineOfPos, Sci::Line linesAdded);  	void DropGraphics(bool freeObjects); diff --git a/src/ElapsedPeriod.h b/src/ElapsedPeriod.h index 6f8cdabdf..e083c0dda 100644 --- a/src/ElapsedPeriod.h +++ b/src/ElapsedPeriod.h @@ -18,7 +18,7 @@ public:  	ElapsedPeriod() noexcept : tp(std::chrono::high_resolution_clock::now()) {  	}  	/// Return duration as floating point seconds -	double Duration(bool reset=false) { +	double Duration(bool reset=false) noexcept {  		const std::chrono::high_resolution_clock::time_point tpNow =  			std::chrono::high_resolution_clock::now();  		const std::chrono::duration<double> stylingDuration = diff --git a/src/MarginView.cxx b/src/MarginView.cxx index 13d55730f..dc4cd165c 100644 --- a/src/MarginView.cxx +++ b/src/MarginView.cxx @@ -172,7 +172,7 @@ void MarginView::RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const View  	}  } -static int SubstituteMarkerIfEmpty(int markerCheck, int markerDefault, const ViewStyle &vs) { +static int SubstituteMarkerIfEmpty(int markerCheck, int markerDefault, const ViewStyle &vs) noexcept {  	if (vs.markers[markerCheck].markType == SC_MARK_EMPTY)  		return markerDefault;  	return markerCheck; diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index 7452a0f29..28d2632fe 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -108,12 +108,12 @@ void LineLayout::Free() noexcept {  	bidiData.reset();  } -void LineLayout::Invalidate(validLevel validity_) { +void LineLayout::Invalidate(validLevel validity_) noexcept {  	if (validity > validity_)  		validity = validity_;  } -int LineLayout::LineStart(int line) const { +int LineLayout::LineStart(int line) const noexcept {  	if (line <= 0) {  		return 0;  	} else if ((line >= lines) || !lineStarts) { @@ -123,7 +123,7 @@ int LineLayout::LineStart(int line) const {  	}  } -int Scintilla::LineLayout::LineLength(int line) const { +int Scintilla::LineLayout::LineLength(int line) const noexcept {  	if (!lineStarts) {  		return numCharsInLine;  	} if (line >= lines - 1) { @@ -133,7 +133,7 @@ int Scintilla::LineLayout::LineLength(int line) const {  	}  } -int LineLayout::LineLastVisible(int line, Scope scope) const { +int LineLayout::LineLastVisible(int line, Scope scope) const noexcept {  	if (line < 0) {  		return 0;  	} else if ((line >= lines-1) || !lineStarts) { @@ -143,16 +143,16 @@ int LineLayout::LineLastVisible(int line, Scope scope) const {  	}  } -Range LineLayout::SubLineRange(int subLine, Scope scope) const { +Range LineLayout::SubLineRange(int subLine, Scope scope) const noexcept {  	return Range(LineStart(subLine), LineLastVisible(subLine, scope));  } -bool LineLayout::InLine(int offset, int line) const { +bool LineLayout::InLine(int offset, int line) const noexcept {  	return ((offset >= LineStart(line)) && (offset < LineStart(line + 1))) ||  		((offset == numCharsInLine) && (line == (lines-1)));  } -int LineLayout::SubLineFromPosition(int posInLine, PointEnd pe) const { +int LineLayout::SubLineFromPosition(int posInLine, PointEnd pe) const noexcept {  	if (!lineStarts || (posInLine > maxLineLength)) {  		return lines - 1;  	} @@ -225,7 +225,7 @@ void LineLayout::RestoreBracesHighlight(Range rangeLine, const Sci::Position bra  	xHighlightGuide = 0;  } -int LineLayout::FindBefore(XYPOSITION x, Range range) const { +int LineLayout::FindBefore(XYPOSITION x, Range range) const noexcept {  	Sci::Position lower = range.start;  	Sci::Position upper = range.end;  	do { @@ -241,7 +241,7 @@ int LineLayout::FindBefore(XYPOSITION x, Range range) const {  } -int LineLayout::FindPositionFromX(XYPOSITION x, Range range, bool charPosition) const { +int LineLayout::FindPositionFromX(XYPOSITION x, Range range, bool charPosition) const noexcept {  	int pos = FindBefore(x, range);  	while (pos < range.end) {  		if (charPosition) { @@ -258,7 +258,7 @@ int LineLayout::FindPositionFromX(XYPOSITION x, Range range, bool charPosition)  	return static_cast<int>(range.end);  } -Point LineLayout::PointFromPosition(int posInLine, int lineHeight, PointEnd pe) const { +Point LineLayout::PointFromPosition(int posInLine, int lineHeight, PointEnd pe) const noexcept {  	Point pt;  	// In case of very long line put x at arbitrary large position  	if (posInLine > maxLineLength) { @@ -287,7 +287,7 @@ Point LineLayout::PointFromPosition(int posInLine, int lineHeight, PointEnd pe)  	return pt;  } -int LineLayout::EndLineStyle() const { +int LineLayout::EndLineStyle() const noexcept {  	return styles[numCharsBeforeEOL > 0 ? numCharsBeforeEOL-1 : 0];  } @@ -397,7 +397,7 @@ void LineLayoutCache::Deallocate() noexcept {  	cache.clear();  } -void LineLayoutCache::Invalidate(LineLayout::validLevel validity_) { +void LineLayoutCache::Invalidate(LineLayout::validLevel validity_) noexcept {  	if (!cache.empty() && !allInvalidated) {  		for (const std::unique_ptr<LineLayout> &ll : cache) {  			if (ll) { @@ -478,7 +478,7 @@ void LineLayoutCache::Dispose(LineLayout *ll) noexcept {  }  // Simply pack the (maximum 4) character bytes into an int -static unsigned int KeyFromString(const char *charBytes, size_t len) { +static unsigned int KeyFromString(const char *charBytes, size_t len) noexcept {  	PLATFORM_ASSERT(len <= 4);  	unsigned int k=0;  	for (size_t i=0; i<len && charBytes[i]; i++) { @@ -710,7 +710,7 @@ void PositionCacheEntry::Clear() noexcept {  }  bool PositionCacheEntry::Retrieve(unsigned int styleNumber_, const char *s_, -	unsigned int len_, XYPOSITION *positions_) const { +	unsigned int len_, XYPOSITION *positions_) const noexcept {  	if ((styleNumber == styleNumber_) && (len == len_) &&  		(memcmp(&positions[len], s_, len)== 0)) {  		for (unsigned int i=0; i<len; i++) { diff --git a/src/PositionCache.h b/src/PositionCache.h index faae023f8..e5a668875 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -97,22 +97,22 @@ public:  	void Resize(int maxLineLength_);  	void EnsureBidiData();  	void Free() noexcept; -	void Invalidate(validLevel validity_); -	int LineStart(int line) const; -	int LineLength(int line) const; +	void Invalidate(validLevel validity_) noexcept; +	int LineStart(int line) const noexcept; +	int LineLength(int line) const noexcept;  	enum class Scope { visibleOnly, includeEnd }; -	int LineLastVisible(int line, Scope scope) const; -	Range SubLineRange(int subLine, Scope scope) const; -	bool InLine(int offset, int line) const; -	int SubLineFromPosition(int posInLine, PointEnd pe) const; +	int LineLastVisible(int line, Scope scope) const noexcept; +	Range SubLineRange(int subLine, Scope scope) const noexcept; +	bool InLine(int offset, int line) const noexcept; +	int SubLineFromPosition(int posInLine, PointEnd pe) const noexcept;  	void SetLineStart(int line, int start);  	void SetBracesHighlight(Range rangeLine, const Sci::Position braces[],  		char bracesMatchStyle, int xHighlight, bool ignoreStyle);  	void RestoreBracesHighlight(Range rangeLine, const Sci::Position braces[], bool ignoreStyle); -	int FindBefore(XYPOSITION x, Range range) const; -	int FindPositionFromX(XYPOSITION x, Range range, bool charPosition) const; -	Point PointFromPosition(int posInLine, int lineHeight, PointEnd pe) const; -	int EndLineStyle() const; +	int FindBefore(XYPOSITION x, Range range) const noexcept; +	int FindPositionFromX(XYPOSITION x, Range range, bool charPosition) const noexcept; +	Point PointFromPosition(int posInLine, int lineHeight, PointEnd pe) const noexcept; +	int EndLineStyle() const noexcept;  };  struct ScreenLine : public IScreenLine { @@ -170,7 +170,7 @@ public:  		llcPage=SC_CACHE_PAGE,  		llcDocument=SC_CACHE_DOCUMENT  	}; -	void Invalidate(LineLayout::validLevel validity_); +	void Invalidate(LineLayout::validLevel validity_) noexcept;  	void SetLevel(int level_) noexcept;  	int GetLevel() const noexcept { return level; }  	LineLayout *Retrieve(Sci::Line lineNumber, Sci::Line lineCaret, int maxChars, int styleClock_, @@ -194,7 +194,7 @@ public:  	~PositionCacheEntry();  	void Set(unsigned int styleNumber_, const char *s_, unsigned int len_, const XYPOSITION *positions_, unsigned int clock_);  	void Clear() noexcept; -	bool Retrieve(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_) const; +	bool Retrieve(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_) const noexcept;  	static unsigned int Hash(unsigned int styleNumber_, const char *s, unsigned int len_) noexcept;  	bool NewerThan(const PositionCacheEntry &other) const noexcept;  	void ResetClock() noexcept; diff --git a/src/Selection.cxx b/src/Selection.cxx index 4a397b4aa..4274b190c 100644 --- a/src/Selection.cxx +++ b/src/Selection.cxx @@ -202,11 +202,11 @@ bool Selection::IsRectangular() const noexcept {  	return (selType == selRectangle) || (selType == selThin);  } -Sci::Position Selection::MainCaret() const { +Sci::Position Selection::MainCaret() const noexcept {  	return ranges[mainRange].caret.Position();  } -Sci::Position Selection::MainAnchor() const { +Sci::Position Selection::MainAnchor() const noexcept {  	return ranges[mainRange].anchor.Position();  } @@ -214,7 +214,7 @@ SelectionRange &Selection::Rectangular() noexcept {  	return rangeRectangular;  } -SelectionSegment Selection::Limits() const { +SelectionSegment Selection::Limits() const noexcept {  	if (ranges.empty()) {  		return SelectionSegment();  	} else { @@ -248,23 +248,23 @@ void Selection::SetMain(size_t r) noexcept {  	mainRange = r;  } -SelectionRange &Selection::Range(size_t r) { +SelectionRange &Selection::Range(size_t r) noexcept {  	return ranges[r];  } -const SelectionRange &Selection::Range(size_t r) const { +const SelectionRange &Selection::Range(size_t r) const noexcept {  	return ranges[r];  } -SelectionRange &Selection::RangeMain() { +SelectionRange &Selection::RangeMain() noexcept {  	return ranges[mainRange];  } -const SelectionRange &Selection::RangeMain() const { +const SelectionRange &Selection::RangeMain() const noexcept {  	return ranges[mainRange];  } -SelectionPosition Selection::Start() const { +SelectionPosition Selection::Start() const noexcept {  	if (IsRectangular()) {  		return rangeRectangular.Start();  	} else { @@ -316,7 +316,7 @@ void Selection::MovePositions(bool insertion, Sci::Position startChange, Sci::Po  	}  } -void Selection::TrimSelection(SelectionRange range) { +void Selection::TrimSelection(SelectionRange range) noexcept {  	for (size_t i=0; i<ranges.size();) {  		if ((i != mainRange) && (ranges[i].Trim(range))) {  			// Trimmed to empty so remove @@ -332,7 +332,7 @@ void Selection::TrimSelection(SelectionRange range) {  	}  } -void Selection::TrimOtherSelections(size_t r, SelectionRange range) { +void Selection::TrimOtherSelections(size_t r, SelectionRange range) noexcept {  	for (size_t i = 0; i<ranges.size(); ++i) {  		if (i != r) {  			ranges[i].Trim(range); @@ -391,7 +391,7 @@ void Selection::CommitTentative() noexcept {  	tentativeMain = false;  } -int Selection::CharacterInSelection(Sci::Position posCharacter) const { +int Selection::CharacterInSelection(Sci::Position posCharacter) const noexcept {  	for (size_t i=0; i<ranges.size(); i++) {  		if (ranges[i].ContainsCharacter(posCharacter))  			return i == mainRange ? 1 : 2; @@ -399,7 +399,7 @@ int Selection::CharacterInSelection(Sci::Position posCharacter) const {  	return 0;  } -int Selection::InSelectionForEOL(Sci::Position pos) const { +int Selection::InSelectionForEOL(Sci::Position pos) const noexcept {  	for (size_t i=0; i<ranges.size(); i++) {  		if (!ranges[i].Empty() && (pos > ranges[i].Start().Position()) && (pos <= ranges[i].End().Position()))  			return i == mainRange ? 1 : 2; diff --git a/src/Selection.h b/src/Selection.h index 741b75277..c5c7993cf 100644 --- a/src/Selection.h +++ b/src/Selection.h @@ -147,10 +147,10 @@ public:  	Selection();  	~Selection();  	bool IsRectangular() const noexcept; -	Sci::Position MainCaret() const; -	Sci::Position MainAnchor() const; +	Sci::Position MainCaret() const noexcept; +	Sci::Position MainAnchor() const noexcept;  	SelectionRange &Rectangular() noexcept; -	SelectionSegment Limits() const; +	SelectionSegment Limits() const noexcept;  	// This is for when you want to move the caret in response to a  	// user direction command - for rectangular selections, use the range  	// that covers all selected text otherwise return the main selection. @@ -158,19 +158,19 @@ public:  	size_t Count() const noexcept;  	size_t Main() const noexcept;  	void SetMain(size_t r) noexcept; -	SelectionRange &Range(size_t r); -	const SelectionRange &Range(size_t r) const; -	SelectionRange &RangeMain(); -	const SelectionRange &RangeMain() const; -	SelectionPosition Start() const; +	SelectionRange &Range(size_t r) noexcept; +	const SelectionRange &Range(size_t r) const noexcept; +	SelectionRange &RangeMain() noexcept; +	const SelectionRange &RangeMain() const noexcept; +	SelectionPosition Start() const noexcept;  	bool MoveExtends() const noexcept;  	void SetMoveExtends(bool moveExtends_) noexcept;  	bool Empty() const noexcept;  	SelectionPosition Last() const noexcept;  	Sci::Position Length() const noexcept;  	void MovePositions(bool insertion, Sci::Position startChange, Sci::Position length) noexcept; -	void TrimSelection(SelectionRange range); -	void TrimOtherSelections(size_t r, SelectionRange range); +	void TrimSelection(SelectionRange range) noexcept; +	void TrimOtherSelections(size_t r, SelectionRange range) noexcept;  	void SetSelection(SelectionRange range);  	void AddSelection(SelectionRange range);  	void AddSelectionWithoutTrim(SelectionRange range); @@ -178,8 +178,8 @@ public:  	void DropAdditionalRanges();  	void TentativeSelection(SelectionRange range);  	void CommitTentative() noexcept; -	int CharacterInSelection(Sci::Position posCharacter) const; -	int InSelectionForEOL(Sci::Position pos) const; +	int CharacterInSelection(Sci::Position posCharacter) const noexcept; +	int InSelectionForEOL(Sci::Position pos) const noexcept;  	Sci::Position VirtualSpaceFor(Sci::Position pos) const noexcept;  	void Clear();  	void RemoveDuplicates(); diff --git a/src/UniConversion.cxx b/src/UniConversion.cxx index 44eceeda6..06de6b8cf 100644 --- a/src/UniConversion.cxx +++ b/src/UniConversion.cxx @@ -49,7 +49,7 @@ size_t UTF8PositionFromUTF16Position(std::string_view u8Text, size_t positionUTF  	return positionUTF8;  } -void UTF8FromUTF16(std::wstring_view wsv, char *putf, size_t len) { +void UTF8FromUTF16(std::wstring_view wsv, char *putf, size_t len) noexcept {  	size_t k = 0;  	for (size_t i = 0; i < wsv.length() && wsv[i];) {  		const unsigned int uch = wsv[i]; diff --git a/src/UniConversion.h b/src/UniConversion.h index bfa247c06..4568e2dea 100644 --- a/src/UniConversion.h +++ b/src/UniConversion.h @@ -16,7 +16,7 @@ constexpr int unicodeReplacementChar = 0xFFFD;  size_t UTF8Length(std::wstring_view wsv) noexcept;  size_t UTF8PositionFromUTF16Position(std::string_view u8Text, size_t positionUTF16) noexcept; -void UTF8FromUTF16(std::wstring_view wsv, char *putf, size_t len); +void UTF8FromUTF16(std::wstring_view wsv, char *putf, size_t len) noexcept;  void UTF8FromUTF32Character(int uch, char *putf) noexcept;  size_t UTF16Length(std::string_view svu8) noexcept;  size_t UTF16FromUTF8(std::string_view svu8, wchar_t *tbuf, size_t tlen); diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 92c94bf5a..b23d7d695 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -154,7 +154,7 @@ ViewStyle::~ViewStyle() {  	fonts.clear();  } -void ViewStyle::CalculateMarginWidthAndMask() { +void ViewStyle::CalculateMarginWidthAndMask() noexcept {  	fixedColumnWidth = marginInside ? leftMarginWidth : 0;  	maskInLine = 0xffffffff;  	int maskDefinedMarkers = 0; @@ -401,7 +401,7 @@ int ViewStyle::ExternalMarginWidth() const noexcept {  	return marginInside ? 0 : fixedColumnWidth;  } -int ViewStyle::MarginFromLocation(Point pt) const { +int ViewStyle::MarginFromLocation(Point pt) const noexcept {  	int margin = -1;  	int x = marginInside ? 0 : -fixedColumnWidth;  	for (size_t i = 0; i < ms.size(); i++) { @@ -416,7 +416,7 @@ bool ViewStyle::ValidStyle(size_t styleIndex) const noexcept {  	return styleIndex < styles.size();  } -void ViewStyle::CalcLargestMarkerHeight() { +void ViewStyle::CalcLargestMarkerHeight() noexcept {  	largestMarkerHeight = 0;  	for (const LineMarker &marker : markers) {  		switch (marker.markType) { @@ -447,7 +447,7 @@ bool ViewStyle::IsLineFrameOpaque(bool caretActive, bool lineContainsCaret) cons  // display itself (as long as it's not an SC_MARK_EMPTY marker).  These are checked in order  // with the earlier taking precedence.  When multiple markers cause background override,  // the colour for the highest numbered one is used. -ColourOptional ViewStyle::Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const { +ColourOptional ViewStyle::Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const noexcept {  	ColourOptional background;  	if (!caretLineFrame && (caretActive || alwaysShowCaretLineBackground) && showCaretLineBackground &&  		(caretLineAlpha == SC_ALPHA_NOALPHA) && lineContainsCaret) { @@ -493,7 +493,7 @@ bool ViewStyle::WhiteSpaceVisible(bool inIndent) const noexcept {  		viewWhitespace == wsVisibleAlways;  } -ColourDesired ViewStyle::WrapColour() const { +ColourDesired ViewStyle::WrapColour() const noexcept {  	if (whitespaceColours.fore.isSet)  		return whitespaceColours.fore;  	else diff --git a/src/ViewStyle.h b/src/ViewStyle.h index 7f6853f13..33ea1d6c2 100644 --- a/src/ViewStyle.h +++ b/src/ViewStyle.h @@ -170,7 +170,7 @@ public:  	ViewStyle &operator=(const ViewStyle &) = delete;  	ViewStyle &operator=(ViewStyle &&) = delete;  	~ViewStyle(); -	void CalculateMarginWidthAndMask(); +	void CalculateMarginWidthAndMask() noexcept;  	void Init(size_t stylesSize_=256);  	void Refresh(Surface &surface, int tabInChars);  	void ReleaseAllExtendedStyles() noexcept; @@ -181,15 +181,15 @@ public:  	void SetStyleFontName(int styleIndex, const char *name);  	bool ProtectionActive() const noexcept;  	int ExternalMarginWidth() const noexcept; -	int MarginFromLocation(Point pt) const; +	int MarginFromLocation(Point pt) const noexcept;  	bool ValidStyle(size_t styleIndex) const noexcept; -	void CalcLargestMarkerHeight(); +	void CalcLargestMarkerHeight() noexcept;  	int GetFrameWidth() const noexcept;  	bool IsLineFrameOpaque(bool caretActive, bool lineContainsCaret) const noexcept; -	ColourOptional Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const; +	ColourOptional Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const noexcept;  	bool SelectionBackgroundDrawn() const noexcept;  	bool WhitespaceBackgroundDrawn() const noexcept; -	ColourDesired WrapColour() const; +	ColourDesired WrapColour() const noexcept;  	bool SetWrapState(int wrapState_) noexcept;  	bool SetWrapVisualFlags(int wrapVisualFlags_) noexcept; | 
