summaryrefslogtreecommitdiffstats
path: root/scintilla/lexlib
diff options
context:
space:
mode:
Diffstat (limited to 'scintilla/lexlib')
-rw-r--r--scintilla/lexlib/Accessor.cxx8
-rw-r--r--scintilla/lexlib/Accessor.h4
-rw-r--r--scintilla/lexlib/LexAccessor.h54
-rw-r--r--scintilla/lexlib/LexerBase.cxx4
-rw-r--r--scintilla/lexlib/LexerBase.h8
-rw-r--r--scintilla/lexlib/LexerModule.cxx8
-rw-r--r--scintilla/lexlib/LexerModule.h6
-rw-r--r--scintilla/lexlib/LexerNoExceptions.cxx8
-rw-r--r--scintilla/lexlib/LexerNoExceptions.h12
-rw-r--r--scintilla/lexlib/LexerSimple.cxx4
-rw-r--r--scintilla/lexlib/LexerSimple.h4
-rw-r--r--scintilla/lexlib/StyleContext.cxx20
-rw-r--r--scintilla/lexlib/StyleContext.h54
13 files changed, 97 insertions, 97 deletions
diff --git a/scintilla/lexlib/Accessor.cxx b/scintilla/lexlib/Accessor.cxx
index 7c8ffe4..0c3b564 100644
--- a/scintilla/lexlib/Accessor.cxx
+++ b/scintilla/lexlib/Accessor.cxx
@@ -32,8 +32,8 @@ int Accessor::GetPropertyInt(const char *key, int defaultValue) const {
return pprops->GetInt(key, defaultValue);
}
-int Accessor::IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader) {
- int end = Length();
+int Accessor::IndentAmount(Sci_Position line, int *flags, PFNIsCommentLeader pfnIsCommentLeader) {
+ Sci_Position end = Length();
int spaceFlags = 0;
// Determines the indentation level of the current line and also checks for consistent
@@ -41,11 +41,11 @@ int Accessor::IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsComment
// Indentation is judged consistent when the indentation whitespace of each line lines
// the same or the indentation of one line is a prefix of the other.
- int pos = LineStart(line);
+ Sci_Position pos = LineStart(line);
char ch = (*this)[pos];
int indent = 0;
bool inPrevPrefix = line > 0;
- int posPrev = inPrevPrefix ? LineStart(line-1) : 0;
+ Sci_Position posPrev = inPrevPrefix ? LineStart(line-1) : 0;
while ((ch == ' ' || ch == '\t') && (pos < end)) {
if (inPrevPrefix) {
char chPrev = (*this)[posPrev++];
diff --git a/scintilla/lexlib/Accessor.h b/scintilla/lexlib/Accessor.h
index c85032c..3fd48cc 100644
--- a/scintilla/lexlib/Accessor.h
+++ b/scintilla/lexlib/Accessor.h
@@ -18,14 +18,14 @@ class Accessor;
class WordList;
class PropSetSimple;
-typedef bool (*PFNIsCommentLeader)(Accessor &styler, int pos, int len);
+typedef bool (*PFNIsCommentLeader)(Accessor &styler, Sci_Position pos, Sci_Position len);
class Accessor : public LexAccessor {
public:
PropSetSimple *pprops;
Accessor(IDocument *pAccess_, PropSetSimple *pprops_);
int GetPropertyInt(const char *, int defaultValue=0) const;
- int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);
+ int IndentAmount(Sci_Position line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);
};
#ifdef SCI_NAMESPACE
diff --git a/scintilla/lexlib/LexAccessor.h b/scintilla/lexlib/LexAccessor.h
index ba4a0e2..26fe129 100644
--- a/scintilla/lexlib/LexAccessor.h
+++ b/scintilla/lexlib/LexAccessor.h
@@ -24,18 +24,18 @@ private:
* in case there is some backtracking. */
enum {bufferSize=4000, slopSize=bufferSize/8};
char buf[bufferSize+1];
- int startPos;
- int endPos;
+ Sci_Position startPos;
+ Sci_Position endPos;
int codePage;
enum EncodingType encodingType;
- int lenDoc;
+ Sci_Position lenDoc;
char styleBuf[bufferSize];
- int validLen;
- unsigned int startSeg;
- int startPosStyling;
+ Sci_Position validLen;
+ Sci_PositionU startSeg;
+ Sci_Position startPosStyling;
int documentVersion;
- void Fill(int position) {
+ void Fill(Sci_Position position) {
startPos = position - slopSize;
if (startPos + bufferSize > lenDoc)
startPos = lenDoc - bufferSize;
@@ -73,7 +73,7 @@ public:
encodingType = encDBCS;
}
}
- char operator[](int position) {
+ char operator[](Sci_Position position) {
if (position < startPos || position >= endPos) {
Fill(position);
}
@@ -86,7 +86,7 @@ public:
return 0;
}
/** Safe version of operator[], returning a defined value for invalid position. */
- char SafeGetCharAt(int position, char chDefault=' ') {
+ char SafeGetCharAt(Sci_Position position, char chDefault=' ') {
if (position < startPos || position >= endPos) {
Fill(position);
if (position < startPos || position >= endPos) {
@@ -102,7 +102,7 @@ public:
EncodingType Encoding() const {
return encodingType;
}
- bool Match(int pos, const char *s) {
+ bool Match(Sci_Position pos, const char *s) {
for (int i=0; *s; i++) {
if (*s != SafeGetCharAt(pos+i))
return false;
@@ -110,21 +110,21 @@ public:
}
return true;
}
- char StyleAt(int position) const {
+ char StyleAt(Sci_Position position) const {
return static_cast<char>(pAccess->StyleAt(position));
}
- int GetLine(int position) const {
+ Sci_Position GetLine(Sci_Position position) const {
return pAccess->LineFromPosition(position);
}
- int LineStart(int line) const {
+ Sci_Position LineStart(Sci_Position line) const {
return pAccess->LineStart(line);
}
- int LineEnd(int line) {
+ Sci_Position LineEnd(Sci_Position line) {
if (documentVersion >= dvLineEnd) {
return (static_cast<IDocumentWithLineEnd *>(pAccess))->LineEnd(line);
} else {
// Old interface means only '\r', '\n' and '\r\n' line ends.
- int startNext = pAccess->LineStart(line+1);
+ Sci_Position startNext = pAccess->LineStart(line+1);
char chLineEnd = SafeGetCharAt(startNext-1);
if (chLineEnd == '\n' && (SafeGetCharAt(startNext-2) == '\r'))
return startNext - 2;
@@ -132,10 +132,10 @@ public:
return startNext - 1;
}
}
- int LevelAt(int line) const {
+ int LevelAt(Sci_Position line) const {
return pAccess->GetLevel(line);
}
- int Length() const {
+ Sci_Position Length() const {
return lenDoc;
}
void Flush() {
@@ -145,24 +145,24 @@ public:
validLen = 0;
}
}
- int GetLineState(int line) const {
+ int GetLineState(Sci_Position line) const {
return pAccess->GetLineState(line);
}
- int SetLineState(int line, int state) {
+ int SetLineState(Sci_Position line, int state) {
return pAccess->SetLineState(line, state);
}
// Style setting
- void StartAt(unsigned int start) {
+ void StartAt(Sci_PositionU start) {
pAccess->StartStyling(start, '\377');
startPosStyling = start;
}
- unsigned int GetStartSegment() const {
+ Sci_PositionU GetStartSegment() const {
return startSeg;
}
- void StartSegment(unsigned int pos) {
+ void StartSegment(Sci_PositionU pos) {
startSeg = pos;
}
- void ColourTo(unsigned int pos, int chAttr) {
+ void ColourTo(Sci_PositionU pos, int chAttr) {
// Only perform styling if non empty range
if (pos != startSeg - 1) {
assert(pos >= startSeg);
@@ -176,7 +176,7 @@ public:
// Too big for buffer so send directly
pAccess->SetStyleFor(pos - startSeg + 1, static_cast<char>(chAttr));
} else {
- for (unsigned int i = startSeg; i <= pos; i++) {
+ for (Sci_PositionU i = startSeg; i <= pos; i++) {
assert((startPosStyling + validLen) < Length());
styleBuf[validLen++] = static_cast<char>(chAttr);
}
@@ -184,15 +184,15 @@ public:
}
startSeg = pos+1;
}
- void SetLevel(int line, int level) {
+ void SetLevel(Sci_Position line, int level) {
pAccess->SetLevel(line, level);
}
- void IndicatorFill(int start, int end, int indicator, int value) {
+ void IndicatorFill(Sci_Position start, Sci_Position end, int indicator, int value) {
pAccess->DecorationSetCurrentIndicator(indicator);
pAccess->DecorationFillRange(start, value, end - start);
}
- void ChangeLexerState(int start, int end) {
+ void ChangeLexerState(Sci_Position start, Sci_Position end) {
pAccess->ChangeLexerState(start, end);
}
};
diff --git a/scintilla/lexlib/LexerBase.cxx b/scintilla/lexlib/LexerBase.cxx
index 0f75851..89f7461 100644
--- a/scintilla/lexlib/LexerBase.cxx
+++ b/scintilla/lexlib/LexerBase.cxx
@@ -61,7 +61,7 @@ const char * SCI_METHOD LexerBase::DescribeProperty(const char *) {
return "";
}
-int SCI_METHOD LexerBase::PropertySet(const char *key, const char *val) {
+Sci_Position SCI_METHOD LexerBase::PropertySet(const char *key, const char *val) {
const char *valOld = props.Get(key);
if (strcmp(val, valOld) != 0) {
props.Set(key, val);
@@ -75,7 +75,7 @@ const char * SCI_METHOD LexerBase::DescribeWordListSets() {
return "";
}
-int SCI_METHOD LexerBase::WordListSet(int n, const char *wl) {
+Sci_Position SCI_METHOD LexerBase::WordListSet(int n, const char *wl) {
if (n < numWordLists) {
WordList wlNew;
wlNew.Set(wl);
diff --git a/scintilla/lexlib/LexerBase.h b/scintilla/lexlib/LexerBase.h
index 03c51a7..780d1fe 100644
--- a/scintilla/lexlib/LexerBase.h
+++ b/scintilla/lexlib/LexerBase.h
@@ -26,11 +26,11 @@ public:
const char * SCI_METHOD PropertyNames();
int SCI_METHOD PropertyType(const char *name);
const char * SCI_METHOD DescribeProperty(const char *name);
- int SCI_METHOD PropertySet(const char *key, const char *val);
+ Sci_Position SCI_METHOD PropertySet(const char *key, const char *val);
const char * SCI_METHOD DescribeWordListSets();
- int SCI_METHOD WordListSet(int n, const char *wl);
- void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0;
- void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0;
+ Sci_Position SCI_METHOD WordListSet(int n, const char *wl);
+ void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) = 0;
+ void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) = 0;
void * SCI_METHOD PrivateCall(int operation, void *pointer);
};
diff --git a/scintilla/lexlib/LexerModule.cxx b/scintilla/lexlib/LexerModule.cxx
index 64b89d0..d3cc124 100644
--- a/scintilla/lexlib/LexerModule.cxx
+++ b/scintilla/lexlib/LexerModule.cxx
@@ -85,20 +85,20 @@ ILexer *LexerModule::Create() const {
return new LexerSimple(this);
}
-void LexerModule::Lex(unsigned int startPos, int lengthDoc, int initStyle,
+void LexerModule::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,
WordList *keywordlists[], Accessor &styler) const {
if (fnLexer)
fnLexer(startPos, lengthDoc, initStyle, keywordlists, styler);
}
-void LexerModule::Fold(unsigned int startPos, int lengthDoc, int initStyle,
+void LexerModule::Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,
WordList *keywordlists[], Accessor &styler) const {
if (fnFolder) {
- int lineCurrent = styler.GetLine(startPos);
+ Sci_Position lineCurrent = styler.GetLine(startPos);
// Move back one line in case deletion wrecked current line fold state
if (lineCurrent > 0) {
lineCurrent--;
- int newStartPos = styler.LineStart(lineCurrent);
+ Sci_Position newStartPos = styler.LineStart(lineCurrent);
lengthDoc += startPos - newStartPos;
startPos = newStartPos;
initStyle = 0;
diff --git a/scintilla/lexlib/LexerModule.h b/scintilla/lexlib/LexerModule.h
index 9c80f14..665e0f9 100644
--- a/scintilla/lexlib/LexerModule.h
+++ b/scintilla/lexlib/LexerModule.h
@@ -15,7 +15,7 @@ namespace Scintilla {
class Accessor;
class WordList;
-typedef void (*LexerFunction)(unsigned int startPos, int lengthDoc, int initStyle,
+typedef void (*LexerFunction)(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,
WordList *keywordlists[], Accessor &styler);
typedef ILexer *(*LexerFactoryFunction)();
@@ -53,9 +53,9 @@ public:
ILexer *Create() const;
- virtual void Lex(unsigned int startPos, int length, int initStyle,
+ virtual void Lex(Sci_PositionU startPos, Sci_Position length, int initStyle,
WordList *keywordlists[], Accessor &styler) const;
- virtual void Fold(unsigned int startPos, int length, int initStyle,
+ virtual void Fold(Sci_PositionU startPos, Sci_Position length, int initStyle,
WordList *keywordlists[], Accessor &styler) const;
friend class Catalogue;
diff --git a/scintilla/lexlib/LexerNoExceptions.cxx b/scintilla/lexlib/LexerNoExceptions.cxx
index e179a74..ef1e1bb 100644
--- a/scintilla/lexlib/LexerNoExceptions.cxx
+++ b/scintilla/lexlib/LexerNoExceptions.cxx
@@ -28,7 +28,7 @@
using namespace Scintilla;
#endif
-int SCI_METHOD LexerNoExceptions::PropertySet(const char *key, const char *val) {
+Sci_Position SCI_METHOD LexerNoExceptions::PropertySet(const char *key, const char *val) {
try {
return LexerBase::PropertySet(key, val);
} catch (...) {
@@ -37,7 +37,7 @@ int SCI_METHOD LexerNoExceptions::PropertySet(const char *key, const char *val)
return -1;
}
-int SCI_METHOD LexerNoExceptions::WordListSet(int n, const char *wl) {
+Sci_Position SCI_METHOD LexerNoExceptions::WordListSet(int n, const char *wl) {
try {
return LexerBase::WordListSet(n, wl);
} catch (...) {
@@ -46,7 +46,7 @@ int SCI_METHOD LexerNoExceptions::WordListSet(int n, const char *wl) {
return -1;
}
-void SCI_METHOD LexerNoExceptions::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+void SCI_METHOD LexerNoExceptions::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) {
try {
Accessor astyler(pAccess, &props);
Lexer(startPos, length, initStyle, pAccess, astyler);
@@ -56,7 +56,7 @@ void SCI_METHOD LexerNoExceptions::Lex(unsigned int startPos, int length, int in
pAccess->SetErrorStatus(SC_STATUS_FAILURE);
}
}
-void SCI_METHOD LexerNoExceptions::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+void SCI_METHOD LexerNoExceptions::Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) {
try {
Accessor astyler(pAccess, &props);
Folder(startPos, length, initStyle, pAccess, astyler);
diff --git a/scintilla/lexlib/LexerNoExceptions.h b/scintilla/lexlib/LexerNoExceptions.h
index 6d1315d..a1d02b7 100644
--- a/scintilla/lexlib/LexerNoExceptions.h
+++ b/scintilla/lexlib/LexerNoExceptions.h
@@ -16,13 +16,13 @@ namespace Scintilla {
class LexerNoExceptions : public LexerBase {
public:
// TODO Also need to prevent exceptions in constructor and destructor
- int SCI_METHOD PropertySet(const char *key, const char *val);
- int SCI_METHOD WordListSet(int n, const char *wl);
- void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess);
- void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *);
+ Sci_Position SCI_METHOD PropertySet(const char *key, const char *val);
+ Sci_Position SCI_METHOD WordListSet(int n, const char *wl);
+ void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *);
- virtual void Lexer(unsigned int startPos, int length, int initStyle, IDocument *pAccess, Accessor &styler) = 0;
- virtual void Folder(unsigned int startPos, int length, int initStyle, IDocument *pAccess, Accessor &styler) = 0;
+ virtual void Lexer(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess, Accessor &styler) = 0;
+ virtual void Folder(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess, Accessor &styler) = 0;
};
#ifdef SCI_NAMESPACE
diff --git a/scintilla/lexlib/LexerSimple.cxx b/scintilla/lexlib/LexerSimple.cxx
index f1b5362..a6f0c03 100644
--- a/scintilla/lexlib/LexerSimple.cxx
+++ b/scintilla/lexlib/LexerSimple.cxx
@@ -42,13 +42,13 @@ const char * SCI_METHOD LexerSimple::DescribeWordListSets() {
return wordLists.c_str();
}
-void SCI_METHOD LexerSimple::Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) {
+void SCI_METHOD LexerSimple::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) {
Accessor astyler(pAccess, &props);
module->Lex(startPos, lengthDoc, initStyle, keyWordLists, astyler);
astyler.Flush();
}
-void SCI_METHOD LexerSimple::Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) {
+void SCI_METHOD LexerSimple::Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) {
if (props.GetInt("fold")) {
Accessor astyler(pAccess, &props);
module->Fold(startPos, lengthDoc, initStyle, keyWordLists, astyler);
diff --git a/scintilla/lexlib/LexerSimple.h b/scintilla/lexlib/LexerSimple.h
index f5794bf..d599332 100644
--- a/scintilla/lexlib/LexerSimple.h
+++ b/scintilla/lexlib/LexerSimple.h
@@ -19,8 +19,8 @@ class LexerSimple : public LexerBase {
public:
explicit LexerSimple(const LexerModule *module_);
const char * SCI_METHOD DescribeWordListSets();
- void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess);
- void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess);
};
#ifdef SCI_NAMESPACE
diff --git a/scintilla/lexlib/StyleContext.cxx b/scintilla/lexlib/StyleContext.cxx
index dcd9891..9fc443c 100644
--- a/scintilla/lexlib/StyleContext.cxx
+++ b/scintilla/lexlib/StyleContext.cxx
@@ -21,12 +21,12 @@
using namespace Scintilla;
#endif
-static void getRange(unsigned int start,
- unsigned int end,
+static void getRange(Sci_PositionU start,
+ Sci_PositionU end,
LexAccessor &styler,
char *s,
- unsigned int len) {
- unsigned int i = 0;
+ Sci_PositionU len) {
+ Sci_PositionU i = 0;
while ((i < end - start + 1) && (i < len-1)) {
s[i] = styler[start + i];
i++;
@@ -34,16 +34,16 @@ static void getRange(unsigned int start,
s[i] = '\0';
}
-void StyleContext::GetCurrent(char *s, unsigned int len) {
+void StyleContext::GetCurrent(char *s, Sci_PositionU len) {
getRange(styler.GetStartSegment(), currentPos - 1, styler, s, len);
}
-static void getRangeLowered(unsigned int start,
- unsigned int end,
+static void getRangeLowered(Sci_PositionU start,
+ Sci_PositionU end,
LexAccessor &styler,
char *s,
- unsigned int len) {
- unsigned int i = 0;
+ Sci_PositionU len) {
+ Sci_PositionU i = 0;
while ((i < end - start + 1) && (i < len-1)) {
s[i] = static_cast<char>(tolower(styler[start + i]));
i++;
@@ -51,6 +51,6 @@ static void getRangeLowered(unsigned int start,
s[i] = '\0';
}
-void StyleContext::GetCurrentLowered(char *s, unsigned int len) {
+void StyleContext::GetCurrentLowered(char *s, Sci_PositionU len) {
getRangeLowered(styler.GetStartSegment(), currentPos - 1, styler, s, len);
}
diff --git a/scintilla/lexlib/StyleContext.h b/scintilla/lexlib/StyleContext.h
index 6473b3d..0b55289 100644
--- a/scintilla/lexlib/StyleContext.h
+++ b/scintilla/lexlib/StyleContext.h
@@ -26,13 +26,13 @@ static inline int MakeLowerCase(int ch) {
class StyleContext {
LexAccessor &styler;
IDocumentWithLineEnd *multiByteAccess;
- unsigned int endPos;
- unsigned int lengthDocument;
+ Sci_PositionU endPos;
+ Sci_PositionU lengthDocument;
// Used for optimizing GetRelativeCharacter
- unsigned int posRelative;
- unsigned int currentPosLastRelative;
- int offsetRelative;
+ Sci_PositionU posRelative;
+ Sci_PositionU currentPosLastRelative;
+ Sci_Position offsetRelative;
StyleContext &operator=(const StyleContext &);
@@ -46,26 +46,26 @@ class StyleContext {
// End of line determined from line end position, allowing CR, LF,
// CRLF and Unicode line ends as set by document.
if (currentLine < lineDocEnd)
- atLineEnd = static_cast<int>(currentPos) >= (lineStartNext-1);
+ atLineEnd = static_cast<Sci_Position>(currentPos) >= (lineStartNext-1);
else // Last line
- atLineEnd = static_cast<int>(currentPos) >= lineStartNext;
+ atLineEnd = static_cast<Sci_Position>(currentPos) >= lineStartNext;
}
public:
- unsigned int currentPos;
- int currentLine;
- int lineDocEnd;
- int lineStartNext;
+ Sci_PositionU currentPos;
+ Sci_Position currentLine;
+ Sci_Position lineDocEnd;
+ Sci_Position lineStartNext;
bool atLineStart;
bool atLineEnd;
int state;
int chPrev;
int ch;
- int width;
+ Sci_Position width;
int chNext;
- int widthNext;
+ Sci_Position widthNext;
- StyleContext(unsigned int startPos, unsigned int length,
+ StyleContext(Sci_PositionU startPos, Sci_PositionU length,
int initStyle, LexAccessor &styler_, char chMask='\377') :
styler(styler_),
multiByteAccess(0),
@@ -90,11 +90,11 @@ public:
styler.StartSegment(startPos);
currentLine = styler.GetLine(startPos);
lineStartNext = styler.LineStart(currentLine+1);
- lengthDocument = static_cast<unsigned int>(styler.Length());
+ lengthDocument = static_cast<Sci_PositionU>(styler.Length());
if (endPos == lengthDocument)
endPos++;
lineDocEnd = styler.GetLine(lengthDocument);
- atLineStart = static_cast<unsigned int>(styler.LineStart(currentLine)) == startPos;
+ atLineStart = static_cast<Sci_PositionU>(styler.LineStart(currentLine)) == startPos;
// Variable width is now 0 so GetNextChar gets the char at currentPos into chNext/widthNext
width = 0;
@@ -131,13 +131,13 @@ public:
atLineEnd = true;
}
}
- void Forward(int nb) {
- for (int i = 0; i < nb; i++) {
+ void Forward(Sci_Position nb) {
+ for (Sci_Position i = 0; i < nb; i++) {
Forward();
}
}
- void ForwardBytes(int nb) {
- size_t forwardPos = currentPos + nb;
+ void ForwardBytes(Sci_Position nb) {
+ Sci_PositionU forwardPos = currentPos + nb;
while (forwardPos > currentPos) {
Forward();
}
@@ -154,13 +154,13 @@ public:
styler.ColourTo(currentPos - ((currentPos > lengthDocument) ? 2 : 1), state);
state = state_;
}
- int LengthCurrent() const {
+ Sci_Position LengthCurrent() const {
return currentPos - styler.GetStartSegment();
}
- int GetRelative(int n) {
+ int GetRelative(Sci_Position n) {
return static_cast<unsigned char>(styler.SafeGetCharAt(currentPos+n, 0));
}
- int GetRelativeCharacter(int n) {
+ int GetRelativeCharacter(Sci_Position n) {
if (n == 0)
return ch;
if (multiByteAccess) {
@@ -170,8 +170,8 @@ public:
posRelative = currentPos;
offsetRelative = 0;
}
- int diffRelative = n - offsetRelative;
- int posNew = multiByteAccess->GetRelativePosition(posRelative, diffRelative);
+ Sci_Position diffRelative = n - offsetRelative;
+ Sci_Position posNew = multiByteAccess->GetRelativePosition(posRelative, diffRelative);
int chReturn = multiByteAccess->GetCharacterAndWidth(posNew, 0);
posRelative = posNew;
currentPosLastRelative = currentPos;
@@ -220,8 +220,8 @@ public:
return true;
}
// Non-inline
- void GetCurrent(char *s, unsigned int len);
- void GetCurrentLowered(char *s, unsigned int len);
+ void GetCurrent(char *s, Sci_PositionU len);
+ void GetCurrentLowered(char *s, Sci_PositionU len);
};
#ifdef SCI_NAMESPACE