aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexlib/SparseState.h
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2017-07-17 15:18:31 +1000
committerNeil Hodgson <nyamatongwe@gmail.com>2017-07-17 15:18:31 +1000
commit7f6f9643d38f799155a76c108c8273f5cb2136ca (patch)
tree61fbfbb41de93e469f907d75db612a93f07995f1 /lexlib/SparseState.h
parent83f45b0a9b0ed59736e7de796ec6db14c90be5c8 (diff)
downloadscintilla-mirror-7f6f9643d38f799155a76c108c8273f5cb2136ca.tar.gz
Update types for Unix LP64 after changes to Sci_Position/Sci_PositionU.
Diffstat (limited to 'lexlib/SparseState.h')
-rw-r--r--lexlib/SparseState.h18
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);