aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-07-16 08:03:19 +1000
committerNeil <nyamatongwe@gmail.com>2020-07-16 08:03:19 +1000
commit5a72039e1a39c200b50f134e4917d216ea68fb48 (patch)
treed298ff48cafd3e6742af9235c6a1401e925aeaf0 /src
parent8aeb0e4b77a0f6905981df5f2d9c4622d55a12fb (diff)
downloadscintilla-mirror-5a72039e1a39c200b50f134e4917d216ea68fb48.tar.gz
Add some const, constexpr.
Diffstat (limited to 'src')
-rw-r--r--src/Document.cxx2
-rw-r--r--src/EditView.cxx2
-rw-r--r--src/Editor.cxx2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index 95792fa1f..07ed604fd 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -2399,7 +2399,7 @@ StyledText Document::EOLAnnotationStyledText(Sci::Line line) const noexcept {
void Document::EOLAnnotationSetText(Sci::Line line, const char *text) {
if (line >= 0 && line < LinesTotal()) {
EOLAnnotations()->SetText(line, text);
- DocModification mh(SC_MOD_CHANGEEOLANNOTATION, LineStart(line),
+ const DocModification mh(SC_MOD_CHANGEEOLANNOTATION, LineStart(line),
0, 0, 0, line);
NotifyModified(mh);
}
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 38dc3af21..e54899bbd 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -1049,7 +1049,7 @@ void EditView::DrawEOL(Surface *surface, const EditModel &model, const ViewStyle
rcSegment.left = rcLine.left;
rcSegment.right = rcLine.right;
- bool drawEOLAnnotationStyledText = (vsDraw.eolAnnotationVisible != EOLANNOTATION_HIDDEN) && model.pdoc->EOLAnnotationStyledText(line).text;
+ const bool drawEOLAnnotationStyledText = (vsDraw.eolAnnotationVisible != EOLANNOTATION_HIDDEN) && model.pdoc->EOLAnnotationStyledText(line).text;
const bool fillRemainder = (!lastSubLine || (!model.GetFoldDisplayText(line) && !drawEOLAnnotationStyledText));
if (fillRemainder) {
// Fill the remainder of the line
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 28fa89120..8e4d85902 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1545,7 +1545,7 @@ bool Editor::WrapLines(WrapScope ws) {
}
} else if (ws == WrapScope::wsIdle) {
// Try to keep time taken by wrapping reasonable so interaction remains smooth.
- const double secondsAllowed = 0.01;
+ constexpr double secondsAllowed = 0.01;
const Sci::Line linesInAllowedTime = std::clamp<Sci::Line>(
static_cast<Sci::Line>(secondsAllowed / durationWrapOneLine.Duration()),
LinesOnScreen() + 50, 0x10000);