diff options
author | Neil <nyamatongwe@gmail.com> | 2019-03-19 11:52:17 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-03-19 11:52:17 +1100 |
commit | 37e58367e8b48e53032f1849de570668811e81fb (patch) | |
tree | da1df333b21ac0d19600ab4c990c539cda30bed3 /src | |
parent | 79299db113ee3a2390235cf2d81b949076d6a4ad (diff) | |
download | scintilla-mirror-37e58367e8b48e53032f1849de570668811e81fb.tar.gz |
Make constructors of simple classes noexcept.
Diffstat (limited to 'src')
-rw-r--r-- | src/ElapsedPeriod.h | 2 | ||||
-rw-r--r-- | src/Indicator.h | 8 | ||||
-rw-r--r-- | src/KeyMap.h | 2 | ||||
-rw-r--r-- | src/PerLine.h | 2 | ||||
-rw-r--r-- | src/Selection.cxx | 2 | ||||
-rw-r--r-- | src/Selection.h | 14 | ||||
-rw-r--r-- | src/ViewStyle.h | 8 |
7 files changed, 19 insertions, 19 deletions
diff --git a/src/ElapsedPeriod.h b/src/ElapsedPeriod.h index 1e2c96eb4..6f8cdabdf 100644 --- a/src/ElapsedPeriod.h +++ b/src/ElapsedPeriod.h @@ -15,7 +15,7 @@ class ElapsedPeriod { std::chrono::high_resolution_clock::time_point tp; public: /// Capture the moment - ElapsedPeriod() : tp(std::chrono::high_resolution_clock::now()) { + ElapsedPeriod() noexcept : tp(std::chrono::high_resolution_clock::now()) { } /// Return duration as floating point seconds double Duration(bool reset=false) { diff --git a/src/Indicator.h b/src/Indicator.h index 7e9a00ce3..9e5fda221 100644 --- a/src/Indicator.h +++ b/src/Indicator.h @@ -13,9 +13,9 @@ namespace Scintilla { struct StyleAndColour { int style; ColourDesired fore; - StyleAndColour() : style(INDIC_PLAIN), fore(0, 0, 0) { + StyleAndColour() noexcept : style(INDIC_PLAIN), fore(0, 0, 0) { } - StyleAndColour(int style_, ColourDesired fore_ = ColourDesired(0, 0, 0)) : style(style_), fore(fore_) { + StyleAndColour(int style_, ColourDesired fore_ = ColourDesired(0, 0, 0)) noexcept : style(style_), fore(fore_) { } bool operator==(const StyleAndColour &other) const { return (style == other.style) && (fore == other.fore); @@ -33,9 +33,9 @@ public: int fillAlpha; int outlineAlpha; int attributes; - Indicator() : under(false), fillAlpha(30), outlineAlpha(50), attributes(0) { + Indicator() noexcept : under(false), fillAlpha(30), outlineAlpha(50), attributes(0) { } - Indicator(int style_, ColourDesired fore_=ColourDesired(0,0,0), bool under_=false, int fillAlpha_=30, int outlineAlpha_=50) : + Indicator(int style_, ColourDesired fore_=ColourDesired(0,0,0), bool under_=false, int fillAlpha_=30, int outlineAlpha_=50) noexcept : sacNormal(style_, fore_), sacHover(style_, fore_), under(under_), fillAlpha(fillAlpha_), outlineAlpha(outlineAlpha_), attributes(0) { } void Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine, const PRectangle &rcCharacter, DrawState drawState, int value) const; diff --git a/src/KeyMap.h b/src/KeyMap.h index b4299feec..6f30abf00 100644 --- a/src/KeyMap.h +++ b/src/KeyMap.h @@ -25,7 +25,7 @@ class KeyModifiers { public: int key; int modifiers; - KeyModifiers(int key_, int modifiers_) : key(key_), modifiers(modifiers_) { + KeyModifiers(int key_, int modifiers_) noexcept : key(key_), modifiers(modifiers_) { } bool operator<(const KeyModifiers &other) const { if (key == other.key) diff --git a/src/PerLine.h b/src/PerLine.h index bf0968f28..94dc17a20 100644 --- a/src/PerLine.h +++ b/src/PerLine.h @@ -17,7 +17,7 @@ namespace Scintilla { struct MarkerHandleNumber { int handle; int number; - MarkerHandleNumber(int handle_, int number_) : handle(handle_), number(number_) {} + MarkerHandleNumber(int handle_, int number_) noexcept : handle(handle_), number(number_) {} }; /** diff --git a/src/Selection.cxx b/src/Selection.cxx index dbb3afc5c..105b93315 100644 --- a/src/Selection.cxx +++ b/src/Selection.cxx @@ -177,7 +177,7 @@ void SelectionRange::MinimizeVirtualSpace() { } } -Selection::Selection() : mainRange(0), moveExtends(false), tentativeMain(false), selType(selStream) { +Selection::Selection() noexcept : mainRange(0), moveExtends(false), tentativeMain(false), selType(selStream) { AddSelection(SelectionRange(SelectionPosition(0))); } diff --git a/src/Selection.h b/src/Selection.h index 8f2166961..82fc4aa48 100644 --- a/src/Selection.h +++ b/src/Selection.h @@ -14,7 +14,7 @@ class SelectionPosition { Sci::Position position; Sci::Position virtualSpace; public: - explicit SelectionPosition(Sci::Position position_=INVALID_POSITION, Sci::Position virtualSpace_=0) : position(position_), virtualSpace(virtualSpace_) { + explicit SelectionPosition(Sci::Position position_=INVALID_POSITION, Sci::Position virtualSpace_=0) noexcept : position(position_), virtualSpace(virtualSpace_) { PLATFORM_ASSERT(virtualSpace < 800000); if (virtualSpace < 0) virtualSpace = 0; @@ -84,15 +84,15 @@ struct SelectionRange { SelectionPosition caret; SelectionPosition anchor; - SelectionRange() : caret(), anchor() { + SelectionRange() noexcept : caret(), anchor() { } - explicit SelectionRange(SelectionPosition single) : caret(single), anchor(single) { + explicit SelectionRange(SelectionPosition single) noexcept : caret(single), anchor(single) { } - explicit SelectionRange(Sci::Position single) : caret(single), anchor(single) { + explicit SelectionRange(Sci::Position single) noexcept : caret(single), anchor(single) { } - SelectionRange(SelectionPosition caret_, SelectionPosition anchor_) : caret(caret_), anchor(anchor_) { + SelectionRange(SelectionPosition caret_, SelectionPosition anchor_) noexcept : caret(caret_), anchor(anchor_) { } - SelectionRange(Sci::Position caret_, Sci::Position anchor_) : caret(caret_), anchor(anchor_) { + SelectionRange(Sci::Position caret_, Sci::Position anchor_) noexcept : caret(caret_), anchor(anchor_) { } bool Empty() const { return anchor == caret; @@ -141,7 +141,7 @@ public: enum selTypes { noSel, selStream, selRectangle, selLines, selThin }; selTypes selType; - Selection(); + Selection() noexcept; ~Selection(); bool IsRectangular() const; Sci::Position MainCaret() const; diff --git a/src/ViewStyle.h b/src/ViewStyle.h index 4ef82c393..ba0524d86 100644 --- a/src/ViewStyle.h +++ b/src/ViewStyle.h @@ -66,9 +66,9 @@ enum WrapMode { eWrapNone, eWrapWord, eWrapChar, eWrapWhitespace }; class ColourOptional : public ColourDesired { public: bool isSet; - ColourOptional(ColourDesired colour_=ColourDesired(0,0,0), bool isSet_=false) : ColourDesired(colour_), isSet(isSet_) { + ColourOptional(ColourDesired colour_=ColourDesired(0,0,0), bool isSet_=false) noexcept : ColourDesired(colour_), isSet(isSet_) { } - ColourOptional(uptr_t wParam, sptr_t lParam) : ColourDesired(static_cast<int>(lParam)), isSet(wParam != 0) { + ColourOptional(uptr_t wParam, sptr_t lParam) noexcept : ColourDesired(static_cast<int>(lParam)), isSet(wParam != 0) { } }; @@ -80,10 +80,10 @@ struct ForeBackColours { struct EdgeProperties { int column; ColourDesired colour; - EdgeProperties(int column_ = 0, ColourDesired colour_ = ColourDesired(0)) : + EdgeProperties(int column_ = 0, ColourDesired colour_ = ColourDesired(0)) noexcept : column(column_), colour(colour_) { } - EdgeProperties(uptr_t wParam, sptr_t lParam) : + EdgeProperties(uptr_t wParam, sptr_t lParam) noexcept : column(static_cast<int>(wParam)), colour(static_cast<int>(lParam)) { } }; |