diff options
author | Neil <nyamatongwe@gmail.com> | 2018-03-01 11:03:37 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-03-01 11:03:37 +1100 |
commit | 1b808ad6a4e623c564513a72cedc17581426942f (patch) | |
tree | f0671c60ec9680f4c4d2e9f7e8c85028b833b0cf /src/PerLine.cxx | |
parent | 13f7cab5a5894313d2245ae56d6f2e7b1f0d7307 (diff) | |
download | scintilla-mirror-1b808ad6a4e623c564513a72cedc17581426942f.tar.gz |
Backport: Mark variables as const where simple.
Backport of changeset 6470:d78a4b522662.
Diffstat (limited to 'src/PerLine.cxx')
-rw-r--r-- | src/PerLine.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/PerLine.cxx b/src/PerLine.cxx index 2afbf3161..cc71c4678 100644 --- a/src/PerLine.cxx +++ b/src/PerLine.cxx @@ -179,7 +179,7 @@ bool LineMarkers::DeleteMark(Sci::Line line, int markerNum, bool all) { } void LineMarkers::DeleteMarkFromHandle(int markerHandle) { - Sci::Line line = LineFromHandle(markerHandle); + const Sci::Line line = LineFromHandle(markerHandle); if (line >= 0) { markers[line]->RemoveHandle(markerHandle); if (markers[line]->Empty()) { @@ -197,7 +197,7 @@ void LineLevels::Init() { void LineLevels::InsertLine(Sci::Line line) { if (levels.Length()) { - int level = (line < levels.Length()) ? levels[line] : SC_FOLDLEVELBASE; + const int level = (line < levels.Length()) ? levels[line] : SC_FOLDLEVELBASE; levels.InsertValue(line, 1, level); } } @@ -255,7 +255,7 @@ void LineState::Init() { void LineState::InsertLine(Sci::Line line) { if (lineStates.Length()) { lineStates.EnsureLength(line); - int val = (line < lineStates.Length()) ? lineStates[line] : 0; + const int val = (line < lineStates.Length()) ? lineStates[line] : 0; lineStates.Insert(line, val); } } @@ -402,7 +402,7 @@ void LineAnnotation::SetStyles(Sci::Line line, const unsigned char *styles) { if (!annotations[line]) { annotations[line].reset(AllocateAnnotation(0, IndividualStyles)); } else { - AnnotationHeader *pahSource = reinterpret_cast<AnnotationHeader *>(annotations[line].get()); + const AnnotationHeader *pahSource = reinterpret_cast<AnnotationHeader *>(annotations[line].get()); if (pahSource->style != IndividualStyles) { char *allocation = AllocateAnnotation(pahSource->length, IndividualStyles); AnnotationHeader *pahAlloc = reinterpret_cast<AnnotationHeader *>(allocation); |