diff options
author | Neil <nyamatongwe@gmail.com> | 2021-03-26 15:40:37 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-03-26 15:40:37 +1100 |
commit | f96ffc423d8af568c0f1dc066a4adbec54d49bdb (patch) | |
tree | 457f7781c3e87345d13ec9734e5497d3d8134990 /src | |
parent | a74c58f96fb97cfaa92e347bfe7e45e58d72558b (diff) | |
download | scintilla-mirror-f96ffc423d8af568c0f1dc066a4adbec54d49bdb.tar.gz |
Minor changes: const, constexpr, and noexcept.
Diffstat (limited to 'src')
-rw-r--r-- | src/EditView.cxx | 4 | ||||
-rw-r--r-- | src/MarginView.cxx | 4 | ||||
-rw-r--r-- | src/PositionCache.cxx | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index d8c4e45fe..44c25ada0 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -340,7 +340,7 @@ constexpr XYPOSITION epsilon = 0.0001f; // A small nudge to avoid floating point * This only affects ASCII characters and is provided for languages with case-insensitive * ASCII keywords where the user wishes to view keywords in a preferred case. */ -inline char CaseForce(Style::CaseForce caseForce, char chDoc, char chPrevious) { +inline char CaseForce(Style::CaseForce caseForce, char chDoc, char chPrevious) noexcept { switch (caseForce) { case Style::CaseForce::mixed: return chDoc; @@ -1305,7 +1305,7 @@ void EditView::DrawEOLAnnotationText(Surface *surface, const EditModel &model, c rcSegment.right = rcSegment.left + static_cast<XYPOSITION>(widthEOLAnnotationText); const ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret); - ColourDesired textFore = vsDraw.styles[style].fore; + const ColourDesired textFore = vsDraw.styles[style].fore; const ColourDesired textBack = TextBackground(model, vsDraw, ll, background, false, false, static_cast<int>(style), -1); diff --git a/src/MarginView.cxx b/src/MarginView.cxx index 04e9cad72..7c7998e07 100644 --- a/src/MarginView.cxx +++ b/src/MarginView.cxx @@ -121,7 +121,7 @@ void MarginView::DropGraphics() noexcept { void MarginView::RefreshPixMaps(Surface *surfaceWindow, const ViewStyle &vsDraw) { if (!pixmapSelPattern) { - const int patternSize = 8; + constexpr int patternSize = 8; pixmapSelPattern = surfaceWindow->AllocatePixMap(patternSize, patternSize); pixmapSelPatternOffset1 = surfaceWindow->AllocatePixMap(patternSize, patternSize); // This complex procedure is to reproduce the checkerboard dithered pattern used by windows @@ -356,7 +356,7 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, marks &= vs.ms[margin].mask; - PRectangle rcMarker( + const PRectangle rcMarker( rcSelMargin.left, static_cast<XYPOSITION>(yposScreen), rcSelMargin.right, diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index 7e3459e5f..50858edd7 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -493,7 +493,7 @@ static unsigned int KeyFromString(const char *charBytes, size_t len) noexcept { } SpecialRepresentations::SpecialRepresentations() { - const short none = 0; + constexpr short none = 0; std::fill(startByteHasReprs, std::end(startByteHasReprs), none); } @@ -540,7 +540,7 @@ bool SpecialRepresentations::Contains(const char *charBytes, size_t len) const { void SpecialRepresentations::Clear() { mapReprs.clear(); - const short none = 0; + constexpr short none = 0; std::fill(startByteHasReprs, std::end(startByteHasReprs), none); } |