aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PositionCache.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-05-24 09:24:44 +1000
committerNeil <nyamatongwe@gmail.com>2018-05-24 09:24:44 +1000
commitbbfd34adc0e800ae2feec487a3c407873bb289e3 (patch)
tree06e19116e923a7ae0005070e1d9a695e5b212878 /src/PositionCache.cxx
parent70c14b70b935ae8b0656df0c8b7c64b481feea18 (diff)
downloadscintilla-mirror-bbfd34adc0e800ae2feec487a3c407873bb289e3.tar.gz
Fix warnings. Add const, constexpr, and noexcept. Initialize. Standard methods.
Replace 0 and NULL with nullptr for COM, DirectWrite and least ambiguous cases.
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r--src/PositionCache.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index b218c39e0..44f9caa0c 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -63,12 +63,11 @@ LineLayout::LineLayout(int maxLineLength_) :
highlightColumn(false),
containsCaret(false),
edgeColumn(0),
+ bracePreviousStyles{},
hotspot(0,0),
widthLine(wrapWidthInfinite),
lines(1),
wrapIndent(0) {
- bracePreviousStyles[0] = 0;
- bracePreviousStyles[1] = 0;
Resize(maxLineLength_);
}
@@ -422,7 +421,7 @@ LineLayout *LineLayoutCache::Retrieve(Sci::Line lineNumber, Sci::Line lineCaret,
}
allInvalidated = false;
Sci::Position pos = -1;
- LineLayout *ret = 0;
+ LineLayout *ret = nullptr;
if (level == llcCaret) {
pos = 0;
} else if (level == llcPage) {
@@ -512,12 +511,12 @@ const Representation *SpecialRepresentations::RepresentationFromCharacter(const
PLATFORM_ASSERT(len <= 4);
const unsigned char ucStart = charBytes[0];
if (!startByteHasReprs[ucStart])
- return 0;
+ return nullptr;
MapRepresentation::const_iterator it = mapReprs.find(KeyFromString(charBytes, len));
if (it != mapReprs.end()) {
return &(it->second);
}
- return 0;
+ return nullptr;
}
bool SpecialRepresentations::Contains(const char *charBytes, size_t len) const {
@@ -536,7 +535,7 @@ void SpecialRepresentations::Clear() {
}
void BreakFinder::Insert(Sci::Position val) {
- int posInLine = static_cast<int>(val);
+ const int posInLine = static_cast<int>(val);
if (posInLine > nextBreak) {
const std::vector<int>::iterator it = std::lower_bound(selAndEdge.begin(), selAndEdge.end(), posInLine);
if (it == selAndEdge.end()) {
@@ -626,7 +625,7 @@ TextSegment BreakFinder::Next() {
if (nextBreak == prev) {
nextBreak += charWidth;
} else {
- repr = 0; // Optimize -> should remember repr
+ repr = nullptr; // Optimize -> should remember repr
}
if ((nextBreak - prev) < lengthStartSubdivision) {
return TextSegment(prev, nextBreak - prev, repr);