aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PositionCache.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2017-05-10 13:58:06 +1000
committerNeil <nyamatongwe@gmail.com>2017-05-10 13:58:06 +1000
commit91c4a9ff07821dce93dab3ffd77df081893b723d (patch)
tree04717f8b9f4c64280f07cc6c2d402e2753700683 /src/PositionCache.h
parent1d41f1635e3a01bd99f0beb689c4d3ff6fea6e30 (diff)
downloadscintilla-mirror-91c4a9ff07821dce93dab3ffd77df081893b723d.tar.gz
Use unique_ptr fpr Partitioning, RunStyles, SparseVector, PositionCache and
Document.
Diffstat (limited to 'src/PositionCache.h')
-rw-r--r--src/PositionCache.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/PositionCache.h b/src/PositionCache.h
index e7008a456..402d657b8 100644
--- a/src/PositionCache.h
+++ b/src/PositionCache.h
@@ -47,7 +47,7 @@ enum PointEnd {
class LineLayout {
private:
friend class LineLayoutCache;
- int *lineStarts;
+ std::unique_ptr<int []>lineStarts;
int lenLineStarts;
/// Drawing is only performed for @a maxLineLength characters on each line.
Sci::Line lineNumber;
@@ -63,9 +63,9 @@ public:
bool highlightColumn;
bool containsCaret;
int edgeColumn;
- char *chars;
- unsigned char *styles;
- XYPOSITION *positions;
+ std::unique_ptr<char[]> chars;
+ std::unique_ptr<unsigned char[]> styles;
+ std::unique_ptr<XYPOSITION[]> positions;
char bracePreviousStyles[2];
// Hotspot support
@@ -102,7 +102,7 @@ public:
*/
class LineLayoutCache {
int level;
- std::vector<LineLayout *>cache;
+ std::vector<std::unique_ptr<LineLayout>>cache;
bool allInvalidated;
int styleClock;
int useCount;
@@ -133,7 +133,7 @@ class PositionCacheEntry {
unsigned int styleNumber:8;
unsigned int len:8;
unsigned int clock:16;
- XYPOSITION *positions;
+ std::unique_ptr<XYPOSITION []> positions;
public:
PositionCacheEntry();
// Copy constructor not currently used, but needed for being element in std::vector.