diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2017-07-17 15:18:31 +1000 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2017-07-17 15:18:31 +1000 |
commit | 46d35a2e30079cb7ce690cd60aece17cc00f1de1 (patch) | |
tree | 586b2d92f94d0dbf09329bde04caa9f2736d71c3 /lexlib/SparseState.h | |
parent | 5d888154b02ae8665464bcdfaf89e0be3a582320 (diff) | |
download | scintilla-mirror-46d35a2e30079cb7ce690cd60aece17cc00f1de1.tar.gz |
Backport: Update types for Unix LP64 after changes to Sci_Position/Sci_PositionU.
Backport of changeset 6352:df1416e3ff3a.
Diffstat (limited to 'lexlib/SparseState.h')
-rw-r--r-- | lexlib/SparseState.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lexlib/SparseState.h b/lexlib/SparseState.h index e767d6710..22f58baef 100644 --- a/lexlib/SparseState.h +++ b/lexlib/SparseState.h @@ -17,9 +17,9 @@ namespace Scintilla { template <typename T> class SparseState { struct State { - int position; + Sci_Position position; T value; - State(int position_, T value_) : position(position_), value(value_) { + State(Sci_Position position_, T value_) : position(position_), value(value_) { } inline bool operator<(const State &other) const { return position < other.position; @@ -28,26 +28,26 @@ class SparseState { return (position == other.position) && (value == other.value); } }; - int positionFirst; + Sci_Position positionFirst; typedef std::vector<State> stateVector; stateVector states; - typename stateVector::iterator Find(int position) { + typename stateVector::iterator Find(Sci_Position position) { State searchValue(position, T()); return std::lower_bound(states.begin(), states.end(), searchValue); } public: - explicit SparseState(int positionFirst_=-1) { + explicit SparseState(Sci_Position positionFirst_=-1) { positionFirst = positionFirst_; } - void Set(int position, T value) { + void Set(Sci_Position position, T value) { Delete(position); if (states.empty() || (value != states[states.size()-1].value)) { states.push_back(State(position, value)); } } - T ValueAt(int position) { + T ValueAt(Sci_Position position) { if (states.empty()) return T(); if (position < states[0].position) @@ -62,7 +62,7 @@ public: return low->value; } } - bool Delete(int position) { + bool Delete(Sci_Position position) { typename stateVector::iterator low = Find(position); if (low != states.end()) { states.erase(low, states.end()); @@ -75,7 +75,7 @@ public: } // Returns true if Merge caused a significant change - bool Merge(const SparseState<T> &other, int ignoreAfter) { + bool Merge(const SparseState<T> &other, Sci_Position ignoreAfter) { // Changes caused beyond ignoreAfter are not significant Delete(ignoreAfter+1); |